[Bioperl-l] possible bug in Bio::SeqIO::fastq

Albert Vilella avilella at gmail.com
Tue Oct 12 14:54:46 UTC 2010


aah! thanks!

On Tue, Oct 12, 2010 at 3:50 PM, Chris Fields <cjfields at illinois.edu> wrote:
> Albert,
>
> Have you tried bioperl-live?  This is already fixed there.
>
> chris
>
> On Oct 12, 2010, at 7:34 AM, Albert Vilella wrote:
>
>> Hi,
>>
>> I found what seems to me could be a bug in the fastq module, which is
>> that if the
>> last line of the raw_quality section is a single "0" character, a
>> "if($line)" isn't
>> returning it properly, because it should be "if(defined $line)" instead.
>>
>> Find here a test case and the line in question:
>>
>> ----
>> use strict;
>> use Bio::SeqIO;
>>
>> my $consio = Bio::SeqIO->new
>>  (-format => 'fastq',
>>   -fh => \*DATA);
>>
>> my $onelineconsout = Bio::SeqIO->new
>>  (-format => 'fastq',
>>   -fh => \*STDOUT);
>>
>> while (my $seq = $consio->next_seq) {
>>  next if ($seq->seq =~ /^n+$/);
>>  $seq->seq(uc($seq->seq));
>>  $onelineconsout->write_seq($seq);
>> }
>> $consio->close;
>> $onelineconsout->close;
>>
>> __DATA__
>> @SRR031652.634472
>> agtgcgctgatctgtggcccgtattgcctcaacgcaagctcaatagcttgagtatattaa
>> a
>> +
>> 01111111111111100111111--,,011111101111111110111111111111110
>> 0
>> ----
>>
>> --- /homes/avilella/src/BioPerl-1.6.1/Bio/SeqIO/fastq.pm
>> 2010-10-12 13:26:06.491743000 +0100
>> +++ /homes/avilella/src/BioPerl-1.6.1/Bio/SeqIO/fastq.pm~
>> 2010-10-12 13:07:27.462833000 +0100
>> @@ -80,7 +80,7 @@
>>                 last FASTQ
>>             }
>>             chomp $line;
>> -            if (!defined($line)) {
>> +            if (!$line) {
>>                 delete $self->{lastline};
>>                 last FASTQ;
>>             }
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>




More information about the Bioperl-l mailing list