[Bioperl-l] About Bio::DB::GenBank!
yaofx
yaofx at xymu.net
Fri Aug 1 09:39:18 EDT 2003
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);
}
More information about the Bioperl-l
mailing list