bpp::RaaSpeciesTree Class Reference

To work with the species tree classification of the database. More...

#include <RaaSpeciesTree.h>

List of all members.

Public Member Functions

int findNode (const std::string &taxon, bool allowsynonym=false)
 Returns the database rank of a taxon identified by its name.
int findNode (int tid)
 Returns the database rank of a taxon identified by a TID.
std::string getName (int rank)
 Returns the name of a taxon identified by its database rank.
int parent (int rank)
 Returns the database rank of the parent of a taxon in the tree.
int getTid (int rank)
 Returns the TID of a taxon.
int count (int rank)
 Returns the number of sequences attached to a taxon or to taxa below it in the species tree.
std::string label (int rank)
 Returns the label of a taxon of given rank.
int firstChild (int rank)
 Returns the rank of the first child taxon of a given taxon.
int nextChild (int parent, int child)
 Allows to loop around all child taxa of a given taxon.
bool isChild (int parent, int child)
 Tells whether there is a downward path from taxon parent to taxon child in the species tree.
int nextSynonym (int rank)
 Allows to loop around all synonymous taxa of a given taxon.
int getMajor (int rank)
 Gives the major taxon among all synonyms of a given taxon.

Friends

class RAA


Detailed Description

To work with the species tree classification of the database.

The tree can be walked up or down starting from a string, a database species rank, or an NCBI taxonID (TID) value. The species tree also contains synonymous names. The root of the tree is named "ROOT" and has database rank 2.


Member Function Documentation

int RaaSpeciesTree::count ( int  rank  ) 

Returns the number of sequences attached to a taxon or to taxa below it in the species tree.

Parameters:
rank The database rank of a taxon.
Returns:
The number of sequences attached to this taxon or to taxa below it, or 0 if no such taxon exists in tree.

int RaaSpeciesTree::findNode ( int  tid  ) 

Returns the database rank of a taxon identified by a TID.

Parameters:
tid A TID value.
Returns:
The database rank of this taxon, or 0 if no such taxon exists in tree.

int bpp::RaaSpeciesTree::findNode ( const std::string &  taxon,
bool  allowsynonym = false 
)

Returns the database rank of a taxon identified by its name.

Parameters:
taxon A taxon name. Case is not significant.
allowsynonym If true, the return value will give the synonym's rank rather than the rank of its major taxon.
Returns:
The database rank of this taxon, or 0 if no such taxon exists in tree.

int RaaSpeciesTree::firstChild ( int  rank  ) 

Returns the rank of the first child taxon of a given taxon.

Parameters:
rank The database rank of a taxon.
Returns:
The rank of its first child taxon, or 0 if no child taxon exists in tree.

int RaaSpeciesTree::getMajor ( int  rank  ) 

Gives the major taxon among all synonyms of a given taxon.

Parameters:
rank The database rank of a taxon.
Returns:
The rank of the major taxon of taxon rank (can be itself).

string RaaSpeciesTree::getName ( int  rank  ) 

Returns the name of a taxon identified by its database rank.

Parameters:
rank The database rank of a taxon.
Returns:
The name of this taxon.

int RaaSpeciesTree::getTid ( int  rank  ) 

Returns the TID of a taxon.

Parameters:
rank The database rank of a taxon.
Returns:
The TID of this taxon, or 0 if no such taxon exists in tree.

bool RaaSpeciesTree::isChild ( int  parent,
int  child 
)

Tells whether there is a downward path from taxon parent to taxon child in the species tree.

Parameters:
parent The database rank of a taxon.
child The database rank of another taxon.
Returns:
true iff child is below parent (possibly with intermediate nodes) in the species tree.

string RaaSpeciesTree::label ( int  rank  ) 

Returns the label of a taxon of given rank.

Labels may contain taxon common names, genetic code information, TID values, and taxonomic level information (e.g., genus, order).

Parameters:
rank The database rank of a taxon.
Returns:
The label of this taxon, or "" if no such taxon or label exists in tree.

int RaaSpeciesTree::nextChild ( int  parent,
int  child 
)

Allows to loop around all child taxa of a given taxon.

Parameters:
parent The database rank of a taxon.
child The database rank of a child of taxon of rank parent.
Returns:
The rank of the next child taxon of parent after taxon child, or 0 if no more child taxon exists in tree.

int RaaSpeciesTree::nextSynonym ( int  rank  ) 

Allows to loop around all synonymous taxa of a given taxon.

Synonymous taxa of a taxon are chained in a closed loop, among which only one, the major taxon, has a parent taxon.

Parameters:
rank The database rank of a taxon.
Returns:
The rank of the next synonymous taxon, or 0 if taxon rank has no synonymous taxon.

int RaaSpeciesTree::parent ( int  rank  ) 

Returns the database rank of the parent of a taxon in the tree.

Parameters:
rank The database rank of a taxon.
Returns:
The database rank of the parent of this taxon in the tree, or 0 if no such taxon exists in tree.


The documentation for this class was generated from the following files:

Generated on Sat Sep 5 17:53:47 2009 for RAA by  doxygen 1.5.9