Camelia, the Perl 6 bug

IRC log for #bioperl, 2011-08-01

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:20 zenman joined #bioperl
03:13 zenman__ joined #bioperl
03:13 zenman left #bioperl
03:27 CIA-72 bioperl-live: Chris Fields master * r26ecb04 / t/SearchIO/blast.t : buglet (bad test count), reported by George Hartzell - https://github.com/bioperl/bioperl-live/comm​it/26ecb042753f5b6c59d6520463d6891ea5c978c7
03:42 ank left #bioperl
03:43 ank joined #bioperl
03:54 ank left #bioperl
05:18 CIA-72 bioperl-live: Chris Fields master * r256d5d2 / Bio/SimpleAlign.pm : remove_seq() bug, patch courtesy James Allen, fixes bug #3269 - https://github.com/bioperl/bioperl-live/comm​it/256d5d2dae9ec70563e2919530c2285432b35c07
05:31 zeropointo left #bioperl
06:17 svaksha left #bioperl
06:17 svaksha joined #bioperl
09:20 kai hm, I can't use open(FH, "cat filename |") on windows, can I?
09:21 j_wright why would you?
09:21 j_wright if you have cygwin, but you could just open the file
10:51 kai j_wright: I'm trying to write a test reproducing the issue from bug #3264
10:52 kai and that's the example the bug reporter provided
10:52 j_wright someone plus oned the bioperl wiki page on bugs?
10:52 j_wright heh
10:52 kai I'm still struggling with the bioperl-run hmmer modules, because the hmmer2 executables are named differently on my system
10:55 j_wright oh yeah, not going to be a seekable stream
11:00 kai ah, now I see the bug in my test :)
11:06 j_wright you can use pushback and _readline then?
11:09 kai yes, trying to see how to get the Bio::Root::IO class to deal with the input then
11:12 carandraug joined #bioperl
11:25 carandraug left #bioperl
11:25 carandraug joined #bioperl
12:22 kai ok, I'm beginning to really dislike my "neat solution"
12:50 j_wright what if you bless your BIO::Root::IO object into Bio::SearchIO::${format} instead of creating a new object?
12:52 kai I'm currently a bit confused by my own callstack
12:54 kai wait
12:56 kai right, that might work, I never actually define a new "new" function in the subclasses
12:57 kai so I bless the Root::IO object and then call new() on that so I get into my expected code path?
12:57 j_wright yeah
12:57 j_wright hmm wait, maybe not new
12:58 kai no, I guess initialize is what I want
12:58 kai but then I'd miss the $class->SUPER::new call
12:58 j_wright but SUPER is Bio::SearchIO, you're in it
12:59 svaksha left #bioperl
12:59 kai no, I'm in Bio::SearchIO::hmmer
12:59 j_wright oh true
12:59 svaksha joined #bioperl
12:59 j_wright no wait
13:00 kai if I had a perl license, I'd give it back right now. I clearly don't understand code that claims I wrote it :)
13:00 j_wright the class::super->new
13:01 j_wright $class is Bio::SearchIO::hmmer{1,2} at that point
13:01 j_wright 2,3 you know what i mean
13:01 kai yeah
13:01 j_wright and that super is Bio::SearchIO::hmmer
13:01 kai ok, so SUPER->new is hmmer->new
13:01 j_wright yeah
13:02 kai how does that return a class then? :)
13:02 j_wright this is a little bit twisted really
13:03 j_wright subclasses calling superclasses calling back the subclass
13:04 kai I mean, if $class is e.g. SearchIO::hmmer2, I calll SUPER->new(), so I enter hmmer->new again, this time $class should be SearchIO::hmmer, right?
13:05 kai so I enter the else branch, returning "Bio::SearchIO::${format}"->new(@args), meaning I call the subclass' new function again
13:05 kai how the heck does this work in the first place?
13:05 * kai goes to look for his perl book
13:06 kai I'm sure I didn't come up with that convoluted thing in the first place
13:08 kai interesting
13:08 kai if I add a print for $class, I only ever seem to be going down the callstack
13:09 kai yeah, so I'm first going down the else branch, then the original one.
13:12 j_wright ok so put some of the code in the original in the else
13:12 kai "It is important to note that SUPER refers to the superclass(es) of the current package and not to the superclass(es) of the object"
13:12 kai ah
13:13 kai so, the current package is SearchIO::hmmer, regardless if called from the hmmer or hmmer2
13:14 kai hmm, ok
13:15 kai so instead of doing that trick, I could always do the bless
13:15 j_wright well the bless idea requires an object, not a class, but what new do we call
13:15 j_wright Bio::SearchIO->new(@args) ?
13:17 kai I always do my $self = $class->SUPER::new(@args);
13:18 kai then I do the version detection, but now I can use $self->_readline and $self->_pushback, as $self is a Root::IO
13:18 j_wright ok so something like my $self = $class->SUPER::new(@args) before the version check, and bless $self, "Bio::SearchIO::${format}"; $self->_initialize(@args); after
13:18 kai yeah
13:18 kai clearly I violated the "don't write code as smart as possible" rule here :)
13:19 j_wright what's that bwk quote
13:19 j_wright Debugging is twice as hard as writing the code in the first place.  Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
13:21 kai yes, exactly what I meant
13:21 j_wright i've written code like that, but i left that job before i had to debug it
13:23 zenman__ left #bioperl
13:24 kai hm, still doesn't seem to work.. now I'm confused
13:24 j_wright time to break out perl -d?
13:25 kai I guess
13:26 j_wright how is it failing? the same?
13:27 kai yeah
13:27 kai and I think I know why
13:28 kai Root::IO->_initialize_io(), called from Root::IO->initialize() deletes the readbuffer :/
13:29 j_wright ah and _initialize goes all the way back up the heirarchy
13:30 j_wright how about initializeing before doing the check?
13:30 kai yeah
13:30 kai I'm wondering if I can do without it
13:31 j_wright it sets some id string
13:31 kai which should be overwritten in the parser anyway :)
13:32 kai of course if I delete that call it seems like my tests explode right into my face :)
13:35 kai aha
13:36 kai this is a bit weird
13:37 kai so far I did $a = $self->_readline, $b = $self->_readline; $version = figure_out_version($b); $self->_pushback($b); $self->pushback($a);
13:37 kai but apparently this isn't a stack but a FIFO
13:40 kai fun stuff
13:40 j_wright odd
13:40 kai so now the only thing that's broken is the algorithm version parsing in hmmer3
13:40 kai didn't touch that, but whatever :)
13:46 kai it does work for hmmer2, and the code is nearly identical as well..
14:15 carandraug left #bioperl
14:16 carandraug joined #bioperl
14:34 carandraug left #bioperl
14:35 carandraug joined #bioperl
15:44 kai I don't get it
15:44 kai somewhere, the results factory is dropping my RESULTS-algorithm_version value
15:48 kai oh, I'm beginning to see this
15:48 kai there's something funny going on with _pushback
15:50 kai aha
15:50 kai _pushback _has_ to work like a stack, everything else is madness
15:55 kai gotcha!
15:56 kai ok, if I change the pushback logic to work like a stack, everything works
16:00 j_wright yay
16:01 kai so, that's what was happening
16:02 scottcain joined #bioperl
16:02 kai I used _pushback twice in the hmmer module, so my readbuffer was ['first line', 'second line']....
16:02 kai if this was a hmmer2 sequence, the parser would do readline, get 'first line', be happy
16:03 kai if this was hmmer3, the parser would first readline to see if that still was defined, and then pushback, ending up with a readbuffer of ['second line', 'first line']
16:04 kai also, the hmmer3 parser decides to start a new element every time it hits a line matching the 'first line' pattern
16:05 kai because 'second line' isn't inside a valid result element when the parser hits it, it's discarded even though it's correctly triggered, which my debug printout showed
17:12 ank joined #bioperl
18:08 dnewkirk left #bioperl
18:19 kblin joined #bioperl
18:53 ank left #bioperl
18:54 ank joined #bioperl
19:19 ank left #bioperl
19:37 carandraug left #bioperl
19:37 svaksha left #bioperl
19:38 svaksha joined #bioperl
20:43 scottcain left #bioperl
21:07 carandraug joined #bioperl
21:17 carandraug left #bioperl
21:17 carandraug joined #bioperl
21:19 sl33v3_ joined #bioperl
21:21 sl33v3 left #bioperl
21:21 sl33v3_ is now known as sl33v3
21:57 ank joined #bioperl
23:10 ank left #bioperl
23:11 ank joined #bioperl
23:38 ank left #bioperl
23:39 ank joined #bioperl

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary