[Bioperl-l] get_Seq_by_acc() in Bio::DB::GeneBank failed

Gregory Wilson gdw1 at cornell.edu
Wed Jul 2 21:12:02 EDT 2003


Related problem. I know it is sloppy but can anyone explain why this
code dumps the genbank record to the screen, but does not store the
information in $seq? I have the bioperl-cvs from June 17th. Happens for
get_Seq_by_id and _by_acc.

<code>
my $gb = Bio::DB::GenBank->new(-reldate => '30',-db => 'nucleotide');
my $seq;
my $attempt_counter = 0;
select STDERR;
print "accession: " . $accession ." ";
# try a bunch of times to connect to NCBI/Genbank to get the BAC
while ($attempt_counter<$maxConnectionAttempts){
        eval{
                $seq = $gb->get_Seq_by_id($accession);  #or _by_acc
        };
        if (substr($@,1,4) eq "----"){ print "Obtained record\n"; last;
        }
        else { print ".";}
                $attempt_counter++;
        }
}
if (!(defined($seq))){
  print "ugh";
  die;
}
</code>

This code outputs:
  The genbank record
  "Obtained record"
  "ugh"
  ------------- EXCEPTION  -------------
  MSG: id does not exist
  STACK
Bio::DB::WebDBSeqI::get_Seq_by_id/usr/lib/perl5/site_perl/5.8.0/Bio/DB/WebDBSeqI.pm:155
  STACK (eval) ../qbatch_data/qbatch.pl:73
  STACK toplevel ../qbatch_data/qbatch.pl:72
  --------------------------------------


Greg

On Fri, 2003-06-13 at 15:29, Qunfeng Dong wrote:
> Heikki Lehvaslaiho helped me with the similar problem. You can try this:
> 
> 1. go to http://cvs.bioperl.org/cgi-bin/viewcvs/viewcvs.cgi/bioperl-
> live/Bio/DB/?cvsroot=bioperl
> 
> 2. download Bio::DB::{GenBank.pm&NCBIHelper.pm&WebDBSeqI.pm} and put them into 
> place like /usr/lib/perl5/site_perl/5.6.1/Bio/DB, where the originals are.
> 
> Good luck.
> 
> Qunfeng
> 
> 
> > Hi, Eveyone,
> > I just downloaded and installed bioperl on my linux 9 machine, after that, I 
> > tried test 1 to 22 of the bptutorial.pl. All test run fine except the test 
> > 11, the remote db access. I also tried the getGeneBank.pl script , the same 
> > error happened.
> > Error message
> > 
> > ------------- EXCEPTION  -------------
> > MSG: acc does not exist
> > STACK Bio::DB::WebDBSeqI::get_Seq_by_acc 
> > /usr/lib/perl5/site_perl/5.8.0/Bio/DB/WebDBSeqI.pm:176
> > 
> > The debug is also tried, seems I never get anything from the buffer or 
> > readline ...
> > I am wondering where or not the firewall is an issue? But I can use NCBI web 
> > site to find the gene that I am fetching by bioperl ...
> > Does anyone have any idea about this problem?
> > 
> > Jun Hu
> > UMDNJ
> > 
> > _________________________________________________________________
> > MSN 8 with e-mail virus protection service: 2 months FREE*  
> > http://join.msn.com/?page=features/virus
> > 
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> > 
> 
> 
> Qunfeng Dong, Ph.D
> ZmDB Manager 
> 2104 Molecular Biology Building
> Iowa State University
> Ames, IA 50010
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list