[Bioperl-l] About Bio::DB::GenBank!
Jonathan Manning
jmanning at genome.wi.mit.edu
Fri Aug 1 13:18:22 EDT 2003
I just encountered the same error. It looks like both Bio::DB::GenBank
and Bio::DB::GenPept search the protein database. So, Bio::DB::GenBank
is not returning anything when you query for an accession.
To verify this, change:
my $gb = new Bio::DB::GenBank;
to:
my $gb = new Bio::DB::GenBank(-format => 'fasta',
-verbose => 1);
For me, this prints:
url is
http://www.ncbi.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&db=protein&id=AC068609&tool=bioperl&retmode=text&usehistory=n
Sure enough, visiting this gives me a blank page. However, if I
substitute 'db=nucleotide' for 'db=protein' in that url, it works.
This bug seems to exist in 1.2 and 1.2.1, but I think is fixed in 1.2.2.
(at least in the CVS head I checked...)
Either upgrade to 1.2.2 or edit Bio/DB/GenBank.pm and change 'protein'
to 'nucleotide' in the BEGIN block.
~Jonathan
yaofx wrote:
> Hello,
>
> I have installed Perl 5.6.1 for WIN32, and Bioperl version 1.2.1.
> The following is the script ,which can retrieve data from GenBank by
> sequences' gi,
> but can not get the results by accession number.
> I replace "get_Stream_by_id" with ""get_Stream_by_acc", also failed.
>
> The error message is :
>
> ------------- EXCEPTION -------------
> MSG: WebDBSeqI Error - check query sequences!
>
> STACK Bio::DB::WebDBSeqI::get_seq_stream
> c:/Perl/site/lib/Bio/DB/WebDBSeqI.pm:46
> 4
> STACK Bio::DB::WebDBSeqI::get_Stream_by_id
> c:/Perl/site/lib/Bio/DB/WebDBSeqI.pm:
> 259
> STACK toplevel web_gi2seq_vi.pl:50
>
> --------------------------------------
>
> BTW, I don't change any code about Bioperl package.
> What's matter with it? and how will i do next?
>
> Thanks in advance for any kind of help
>
> Fengxia
>
>
> #!/usr/bin/perl
>
> $idlist = $ARGV[0];
>
> if (@ARGV != 1){
> print "USAGE: perl web_id2seq.pl <ID list file>\n";
> exit(1);
> }
>
> $faoutfile = $idlist."_fa.txt";
> (unlink $faoutfile) if (-e $faoutfile);
>
> open (INPUT,$idlist);
>
> while ($line = <INPUT>){
> chomp ($line);
> $line =~ s/\r//;
> push (@querylist,$line);
> }
> $list = join ",", at querylist;
> close INPUT;
>
> use Bio::SeqIO;
> use Bio::DB::GenBank;
> my $gb = new Bio::DB::GenBank;
>
> my $seqout = new Bio::SeqIO(-file => ">$faoutfile", -format => 'fasta');
> my $seqio = $gb->get_Stream_by_id([$list]);
>
> while($seq = $seqio->next_seq ) {
> $seqout->write_seq($seq);
> }
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
--
Jonathan Manning <jmanning at genome.wi.mit.edu>
Whitehead Institute Center for Genome Research
Finishing Process Analyst / Data Analyst
More information about the Bioperl-l
mailing list