pub struct DB { /* private fields */ }
Expand description
The local taxonony database
Implementations§
source§impl DB
impl DB
sourcepub fn populate(&self, dump: &PathBuf) -> Result<(), Box<dyn Error>>
pub fn populate(&self, dump: &PathBuf) -> Result<(), Box<dyn Error>>
Populate the local taxonony database using that dump.
dump is expected to be the path to an accessible copy of the
taxdmp.zip
file, as the one available on the NCBI FTP servers.
sourcepub fn get_taxids(&self, names: Vec<String>) -> Result<Vec<i64>, Box<dyn Error>>
pub fn get_taxids(&self, names: Vec<String>) -> Result<Vec<i64>, Box<dyn Error>>
Get the Taxonomy IDs corresponding to this scientific names. The used name class are “scientific name”, “synonym” and “genbank synonym”. Either return all the IDs or an error.
sourcepub fn get_nodes(&self, ids: Vec<i64>) -> Result<Vec<Node>, Box<dyn Error>>
pub fn get_nodes(&self, ids: Vec<i64>) -> Result<Vec<Node>, Box<dyn Error>>
Get the Nodes corresponding to the IDs. The Nodes are ordered in the same way as the IDs. If an ID is invalid, an error is returned.
sourcepub fn get_lineage(&self, id: i64) -> Result<Vec<Node>, Box<dyn Error>>
pub fn get_lineage(&self, id: i64) -> Result<Vec<Node>, Box<dyn Error>>
Get the Node corresponding to this unique ID, then all Nodes in the path to the root (the special node with taxonomy ID 1). The Nodes are ordered, with the root last.
sourcepub fn get_children(
&self,
id: i64,
species_only: bool
) -> Result<Vec<Node>, Box<dyn Error>>
pub fn get_children( &self, id: i64, species_only: bool ) -> Result<Vec<Node>, Box<dyn Error>>
Get the children of the Node corresponding to this unique ID. If
species_only
is true, then stop when the children are species, else
continue until the children are tips.
Note that the ID given as argument is included in the results. Thus, the
resulting vector contains at least one element.