[Bioperl-l] bioperl module to get organism feature from Entre z?

simon andrews (BI) simon.andrews@bbsrc.ac.uk
Thu, 25 Jul 2002 09:52:45 +0100


> -----Original Message-----
> From: Dan Kortschak [mailto:kortschak@rsbs.anu.edu.au]
> Sent: Thursday, July 25, 2002 8:50 AM
> To: bioperl-l@bioperl.org
> Subject: [Bioperl-l] bioperl module to get organism feature 
> from Entrez?
> 
> 
> Hi All, I've been looking for a while, but I can find nothing 
> that will grab the organism/taxon field from a GenBank/Pept 
> record. Is there something that will do this?

Sure.  I'm assuming that you don't have the sequence file locally and you want to do the whole thing from an entry code/accession number/gi number.  If you have the file locally then just use Bio::SeqIO to create your sequence object instead of Bio::DB::GenBank.

---------------------------------------------------
#!/usr/bin/perl -w
use strict;
use Bio::DB::GenBank;

my $gbobj = Bio::DB::GenBank -> new();

my $seqobj = $gbobj -> get_Seq_by_id('MUSIGHBA1');

my $species = $seqobj -> species() -> binomial();

print "Species is $species\n";
--------------------------------------------------

See perldoc Bio::DB::GenBank for other access methods (accession or gi).

See perldoc Bio::Species if you want to retrieve the full classification, not just the binomial representation of the name.

Hope this helps

Simon.