The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::LITE::Taxonomy - Lightweight and efficient taxonomic tree manager

SYNOPSIS

 use Bio::LITE::Taxonomy

 my $taxNCBI = Bio::LITE::Taxonomy::NCBI->new (
                                               names=> "/path/to/names.dmp",
                                               nodes=>"/path/to/nodes.dmp"
                                              );

 my @taxNCBI = $taxNCBI->get_taxonomy(1442);

 my $taxRDP = Bio::LITE::Taxonomy::RDP->new (
                                             bergeyXML=>"/media/disk-1/bergeyTrainingTree.xml"
                                            )

 my @taxRDP = $taxRDP->get_taxonomy(22075);

DESCRIPTION

This module provides easy and efficient access to different taxonomies (NCBI and RDP) with minimal dependencies and without intermediate databases. This module should be used through specific taxonomic interfaces (e.g. Bio::LITE::Taxonomy::NCBI or Bio::LITE::Taxonomy::RDP).

This module is not part of the Bioperl bundle. For Bioperl alternatives, see the "SEE ALSO" section of this document. If you are dealing with big datasets or you don't need the rest of the Bioperl bundle to process taxonomic queries this module is for you.

These modules are designed with performance in mind. The trees are stored in memory (as plain hashes). The GI to Taxid mappings provided by Bio::LITE::Taxonomy::NCBI::Gi2taxid are very efficient. It also supports both NCBI and RDP taxonomies following the same interface.

METHODS

The following methods are available:

get_taxonomy

Accepts a taxid as input and returns an array with its ascendants ordered from top to bottom.

  my @tax = $tax->get_taxonomy($taxid);
  print "$_\n" for (@tax);

If called in scalar context, returns an array reference.

get_taxonomy_with_levels

The same as get_taxonomy but instead of getting the ascendants returns an array of array references. Each array reference has the ascendant and its taxonomic level (at positions 0 and 1 respectively). This is simpler than it sounds. Check this:

  my @taxL = $tax->get_taxonomy_with_levels($taxid);
  for my $l (@taxL) {
    print "Taxon $l->[0] has rank $l->[1]\n";
  }

If called in scalar context, returns an array reference.

get_taxid_from_name

Accepts the scientific name of a taxon and returns its associated taxid.

get_taxonomy_from_name

Same as before but returns the full taxonomy of the scientific name. This is the same as:

 my $taxid = $tax->get_taxid_from_name($name);
 my @taxonomy = $tax->get_taxonomy($taxid);

If called in scalar context returns an array reference.

get_term_at_level

Given a taxid and a taxonomic level as input, returns the taxon. For example,

  my $taxon = $tax->get_term_at_level(1442,"family"); # $taxon = Bacillaceae
get_level_from_name

Given a taxon's scientific name, returns its associated taxonomic level.

SEE ALSO

Bio::LITE::Taxonomy::RDP

Bio::LITE::Taxonomy::NCBI

Bio::LITE::Taxonomy::NCBI::Gi2taxid: Module to obtain NCBIs Taxids from GIs.

Bio::DB::Taxonomy::*: Bioperl alternative to handle taxonomies.

Bio::Taxon: Bioperl module to handle nodes in taxonomies

AUTHOR

Miguel Pignatelli

Any comments or suggestions should be addressed to emepyc@gmail.com

LICENSE

Copyright 2009 Miguel Pignatelli, all rights reserved.

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.