[Bioperl-l] Problems retrieving sequences with
Bio::DB::Query::GenBank
michael watson (IAH-C)
michael.watson at bbsrc.ac.uk
Mon Aug 9 04:52:42 EDT 2004
Hi
I am having a few problems with Bio::DB::Query::GenBank (Bioperl 1.4,
Suse Linux). Here is my script:
#!/usr/bin/perl
use Bio::DB::Query::GenBank;
use Bio::SeqIO;
use Bio::DB::GenBank;
my $query_string = 'Avian infectious bronchitis virus [Organism]';
my $query = Bio::DB::Query::GenBank->new(-db => 'nucleotide',
-query =>
$query_string,
-verbose => 0);
my $count = $query->count;
print "Query has $count sequences\n";
my $db = new Bio::DB::GenBank;
my $stream = $db->get_Stream_by_query($query);
my $out = Bio::SeqIO->new(-format => 'Fasta' ,
-file => '>out.fasta');
while (my($seq) = $stream->next_seq()) {
$out->write_seq($seq);
}
So this is all "by the book" code, mostly taken directly from the docs.
What happens is that out.fasta fills up with 500 sequences (there should
be 810) and then I get an error:
------------- EXCEPTION -------------
MSG: Did not provide a valid Bio::PrimarySeqI object
STACK Bio::SeqIO::fasta::write_seq
/usr/local/bioperl-1.4/Bio/SeqIO/fasta.pm:178
STACK toplevel scripts/get_seqs.pl:26
--------------------------------------
Speaking from personal experience, I have never been able to get the
"get_stream_by..." methods to work.
Does anyone have a clue what might be going wrong?
Thanks
Mick
More information about the Bioperl-l
mailing list