in reply to Having a problem with my code!

This is my first time using packages for object orientation extensively, so there could be any kind of error in here

See all those global variables in package MirDeepParse;? They should be part of your object

Did you know miRDeep is perl software? :)

Replies are listed 'Best First'.
Re^2: Having a problem with my code!
by kotoroshinoto (Initiate) on Dec 23, 2010 at 14:51 UTC
    I think i found the problem, simple one really, i forgot to initialize the data variable in the else block before using it.
Re^2: Having a problem with my code!
by kotoroshinoto (Initiate) on Dec 22, 2010 at 19:00 UTC
    Oh and yes I was quite aware that it is perl software. I'm the one that ran it for my lab after all. I tend to prefer C/C++ & Java but perl has its niceties, especially as it comes to parsing like this.
Re^2: Having a problem with my code!
by kotoroshinoto (Initiate) on Dec 22, 2010 at 18:58 UTC
    Thanks for that info, I somewhat suspected that already, but my main point was just to get it to work first. I'm pretty sure they're not responsible for the error, because it happened after the program is finished with the parser.
      Thanks for that info, I somewhat suspected that already, but my main point was just to get it to work first. I'm pretty sure they're not responsible for the error, because it happened after the program is finished with the parser.

      I'm not sure about that. For example, I have no idea which variable this is

      %data->{$_} = $df; #store constructed data set
      $data or %data? One is local, one is global.

      I also can't get your program to produce any output, much less something with "star" or "mature" which would demonstrate your bug.

      I've made a simple modification below to avoid using Switch when possible (no need to use Switch if perl comes with given/when/default)

      I suggest you take this modification, do some more cleanup, reduce the line count (html/code, divide and conquer) and ask again :)

        I adjusted the code to use HTML::TableReader which eliminated the part of my code that used switching and made it a little more tolerable to look at.

        Whats weird is I'm still getting "Duplicate detected messages thrown up when on items with no duplicates, and weirdly, it prints one iteration too late, but still manages to print its name...;
        example: (part of output)

        hsa-miR-382 shortens to hsa-miR-382
        hsa-miR-99b* shortens to hsa-miR-99b
        Duplicate Detected! hsa-miR-382
        hsa-miR-196b shortens to hsa-miR-196b