[Bioperl-l] Enquiry on Bio::DB::Taxonomy

Jason Stajich jason at bioperl.org
Sun Aug 22 14:29:30 EDT 2010


Hi Amali -

This is how I'd print out the full classification by using the Tree 
methods (with probably a different way of initializing the $db object to 
your flatfiles location).

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

my $db= Bio::DB::Taxonomy->new(-source => 'flatfile',
                    -nodesfile => 'taxonomy/nodes.dmp',
                    -namesfile => 'taxonomy/names.dmp');

my $taxonid = $db->get_taxonid('Homo sapiens');
my $taxon = $db->get_taxon(-taxonid => $taxonid);
my $tree = Bio::Tree::Tree->new(-node => $taxon);
my @taxa = $tree->get_nodes;
print join(",", map { $_->scientific_name } @taxa), "\n";

-jason

Amali Thrimawithana wrote, On 8/18/10 3:56 PM:
> Dear Dr Stajich,
>
> I am a Masters student at Auckland university and my research is on
> identifying yeast species present in wine by the use of 454 sequencing. In
> order to carry out this research, a pipeline is being built in which at the
> final step each representative OTU need to be classified at different
> taxonomic levels (ie: at Phylum, family, class, genus and species) by using
> the results from BLAST. To identify the sequences at each taxonomic level, I
> have been trying out the Bio::DB::Taxonomy module in bioperl. Using this
> module, I am able to get the genus and species level by splitting the
> scientific name returned by the Bio::taxon object. But unfortunately I am
> uncertain on how to get the information for the other levels of the rank. I
> have tried several commands including "my @class = $node->classification;",
> but it does not work. Hence, could you please let me know how I might be
> able to get the higher levels of taxonomy such as class and phylum using
> bioperl?
>
> Look forward to hearing from you soon
>
> Thanking You
>
> Amali
>    



More information about the Bioperl-l mailing list