[Bioperl-l] Bio::DB::GenBank problem?

wxu wxu at msi.umn.edu
Mon Sep 8 19:33:29 EDT 2003


Hello,
I wrote a simple bioperl program to retrieve genBank sequences by genBank
accession numbers using $gb->get_Stream_by_id function.
But it seems to me it can only work on GI number, not work on accession
numbers. I use $gb->get_Stream_by_acc, the result is the same. In my
following code, it only give me 2981014 sequences. I search NCBI web
manually, all "J00522","AF303112","2981014","BG065024","BG065143" work.
And I tried $gb->get_Seq_by_acc("J00522"); It complains "No such acc error".

What is the problem?
Your help would be greatly appreciated.

Wayne
--

----------------------------------------------------------
#!/usr/local/bin/perl
use lib "/usr/local/bioperl/bioperl-1.2";
use lib qw(/home/wxu/bioperl);

use Bio::Perl;
use Bio::DB::GenBank;
use Bio::SeqIO;
my $gb = new Bio::DB::GenBank();

my $seqio =
$gb->get_Stream_by_id(["J00522","AF303112","2981014","BG065024","BG065143"])
;

while( my $seq =  $seqio->next_seq ) {
    #print "seq length is ", $seq->length,"\n";
    write_sequence('>>outputfile', 'fasta', $seq)
  }
----------------------------------------------------------------------------
--
Wayne Xu
Computational Genomics Specialist  www.msi.umn.edu/user_support/compgen

Supercomputing Institute
550 Walter Library
117 Pleasant Street SE
University of Minnesota
Minneapolis, Minnesota 55455
email: wxu at msi.umn.edu        help email:  help at msi.umn.edu
phone: 612-624-1447           help phone:  612-626-0802
fax:   612-624-8861




More information about the Bioperl-l mailing list