[Bioperl-l] Bio::Index::Fasta return object problem

david vilanova danova at andorra.ad
Mon Apr 28 16:47:24 EDT 2003


Dear all,
I have some problems when I try to retreive sequences from an indexed file.
The Index::Fasta  seems to return a Bio::Seq object however the method
write_seq requires a valid Bio::PrimarySeqI object. How can I can go through
this problem.

Thanks
------------- EXCEPTION  -------------
MSG: Did not provide a valid Bio::PrimarySeqI object
STACK Bio::SeqIO::fasta::write_seq
/usr/local/psu/bioperl-live/Bio/SeqIO/fasta.pm:175
STACK toplevel fasta.pl:21


use Bio::Index::Fasta;
use strict;

my ($Index_File_Name,$Fasta_File) = @ARGV;
my $inx = Bio::Index::Fasta->new(
'-filename' => $Index_File_Name,
'-write_flag' => 1);
$inx->make_index($Fasta_File);

# Print out several sequences present in the index
# in Fasta format

my $out = Bio::SeqIO->new('-format' => 'Fasta','-fh' => \*STDOUT);

foreach my $id ($Index_File_Name) {
my $seq = $inx->fetch($id); # Returns Bio::Seq object
$out->write_seq($seq);#requires a valid Bio::PrimarySeqI object
}




More information about the Bioperl-l mailing list