[Bioperl-l] Fwd: [Bioperl-guts-l] a question of retrieval information

Heikki Lehvaslaiho heikki at ebi.ac.uk
Tue Jul 5 11:06:10 EDT 2005

----------  Forwarded Message  ----------

Subject: [Bioperl-guts-l] a question of retrieval information
Date: Tuesday 05 July 2005 15:05
From: jinsun at indiana.edu
To: bioperl-guts-l at bioperl.org

To whom it is concerned:

I try to write a perl program using bioperl and want to retrieve information
from ncbi website. The purpose of this program is to get protein's annotation
with a gi number. For example if given a gi number 16128448, I would get
 acrAB operon repressor [Escherichia coli K12]

I wrote bioperl like this:

use Bio::DB::GenBank;

$gb = new Bio::DB::GenBank;
$seqobj = $gb->get_Seq_by_gi('16128448');
$ann_coll = $seqobj->annotation;

for $ann ($ann_coll->get_Annotations) {
    print "Features: ",$ann->as_text if ($ann->tagname eq "features");
    print "Comment: ",$ann->as_text if ($ann->tagname eq "comment");
    print "Title: ",$ann->as_text if ($ann->tagname eq "title");
    print "Organism: ",$ann->as_text if ($ann->tagname eq "organism");
    print "Definition: ",$ann->as_text if ($ann->tagname eq "definition");

It does not work. For some gi numbers I can not get $seqobj, for other gi
 numbers I can get $seqobj but not any annotation.

Could you please help me how to get information from ncbi with a program?
Thank you.

Jingjun Sun

----- End forwarded message -----

Bioperl-guts-l mailing list
Bioperl-guts-l at portal.open-bio.org


______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho    heikki at_ebi _ac _uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambridge, CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________

More information about the Bioperl-l mailing list