[Bioperl-l] reading gz fastq File
Roy Chaudhuri
roy.chaudhuri at gmail.com
Wed Feb 27 13:22:28 UTC 2019
Correction - it's not a bug since the SeqIO documentation for 1.7.1 now
states "To read from or write to a piped command, open a filehandle and
use the -fh option.".
The relevant (closed) bug is here:
https://github.com/bioperl/bioperl-live/issues/117
Cheers,
Roy.
On 27/02/2019 13:11, Roy Chaudhuri wrote:
> Hi Shalu,
>
> Yes, I can replicate this error with bioperl 1.7.1, but 1.6.923 works as
> expected. I think it's a bug since the docs suggest that it should work.
>
> As a workaround you can use:
>
> open my $fh, "gunzip -c $ARGV[0]|" or die $!;
> my $in=Bio::SeqIO->new(-fh=>$fh, -format=>'fastq');
>
> Cheers,
> Roy.
>
> On 25/02/2019 16:00, shalu sharma wrote:
>> Hi Everyone,
>> So i am trying to work on gzip fastq files. In past my script
>> used to work fine. Now when i ran the same script it gives me an error.
>> I am just pasting few lines for example and an error message.
>> Would really appreciate your help.
>>
>> use Bio::SeqIO;
>>
>> use Bio::Seq::Quality;
>>
>> $in = Bio::SeqIO->new(-file => "gunzip -c $ARGV[0]|", -format =>
>> 'fastq');
>>
>> while(my $seq = $in->next_seq){
>>
>> my $id = $seq->id;
>>
>> print "$id\n";
>>
>> }
>>
>>
>> Error message:
>>
>> MSG: Could not read file 'gunzip -c com.fastq.gz|': No such file or
>> directory
>>
>> STACK: Error::throw
>>
>> STACK: Bio::Root::Root::throw
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/Root/Root.pm:447
>>
>>
>> STACK: Bio::Root::IO::_initialize_io
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/Root/IO.pm:268
>>
>>
>> STACK: Bio::SeqIO::_initialize
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/SeqIO.pm:513
>>
>>
>> STACK: Bio::SeqIO::fastq::_initialize
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/SeqIO/fastq.pm:30
>> <http://fastq.pm:30>
>>
>> STACK: Bio::SeqIO::new
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/SeqIO.pm:389
>>
>>
>> STACK: Bio::SeqIO::new
>> /usr/local/apps/eb/BioPerl/1.7.1-foss-2016b-Perl-5.24.1/lib/perl5/site_perl/5.24.1/Bio/SeqIO.pm:435
>>
>>
>> STACK: testGZ.pl:5
>>
>>
>> Thanks
>>
>> Shalu
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at mailman.open-bio.org
>> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
>>
More information about the Bioperl-l
mailing list