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

Heikki Lehvaslaiho heikki at ebi.ac.uk
Tue Jul 5 11:32:33 EDT 2005


Jinsun,

Your code works for me. It retrieves the sequence text file, creates the 
objects and prints out the comment. Are you sure the other gi numbers are 
valid? Try them first  on Entrez to see entry.

There are no annotations with names like 'features', 'title' or 'definition'. 
These are attributes of the sequence object itself.

Try
 $seqobj->id
 $seqobj->desc
 $seqobj->species
        $seqobj->all_SeqFeatures


Some of these return strings, some objects or arrays of objects.

These are good places to start learn how bioperl works:
 http://bio.perl.org/HOWTOs/
 http://bio.perl.org/Core/Latest/faq.html

Yours,

 -Heikki


P.S. Do not post to the guts mailing list. It is only for automatically 
generated reports.

 
On Tuesday 05 July 2005 15:05, jinsun at indiana.edu wrote:
> 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] gi|16128448|ref|NP_414997.1|
> [16128448].
>
> 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://portal.open-bio.org/mailman/listinfo/bioperl-guts-l
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
______ _/      _/_____________________________________________________
      _/      _/                      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