[][src]Struct ncbitaxonomy::NcbiFileTaxonomy

pub struct NcbiFileTaxonomy { /* fields omitted */ }

Implementations

impl NcbiFileTaxonomy[src]

pub fn from_ncbi_files(
    nodes_filename: &str,
    names_filename: &str
) -> Result<NcbiFileTaxonomy, NcbiTaxonomyError>
[src]

from_ncbi_files

Reads the nodes.dmp file and names.dmp file from the NCBI Taxonomy database to generate a NcbiTaxonomy structure

Examples

use ncbitaxonomy::*;

let taxonomy = NcbiFileTaxonomy::from_ncbi_files("data/nodes.dmp", "data/names.dmp");

pub fn save_to_sqlite(
    &self,
    db_url: Option<&str>
) -> Result<SqliteConnection, ToSqliteError>
[src]

pub fn get_node_by_id(&self, id: i32) -> Option<&NodeId>[src]

get_node_by_id

get a NodeId from a numeric NCBI Taxonomy ID

pub fn traversal(&self, from: i32) -> Option<Traverse<i32>>[src]

traversal

traverse the tree nodes (in depth first order) from the node with a given NCBI Taxonomy ID

pub fn get_id_by_node(&self, node_id: NodeId) -> Option<i32>[src]

get_id_by_node

get the NCBI Taxonomy ID held by the node with a given NodeId

Trait Implementations

impl Debug for NcbiFileTaxonomy[src]

impl NcbiTaxonomy for NcbiFileTaxonomy[src]

fn contains_id(&self, id: i32) -> bool[src]

contains_id

check whether the taxonomy contains a (number) ID

fn contains_name(&self, name: &str) -> bool[src]

contains_name

check whether the taxonomy contains a node with the specified name

note: the name used is what is reported as a the 'scientific name' in the NCBI Taxonomy database. synonyms are currently not supported

fn is_descendant(&self, name: &str, ancestor_name: &str) -> bool[src]

is_descendant

check if a certain named node is a descendant of another named named

fn is_descendant_taxid(&self, taxid: i32, ancestor_taxid: i32) -> bool[src]

is_descendant_taxid

check if a certain node with taxid is a descendant of another taxid

fn get_name_by_id(&self, id: i32) -> Option<String>[src]

get_name_by_id

get the scientific name associated with a given NCBI Taxonomy ID

fn get_lineage(&self, name: &str) -> Option<Vec<i32>>[src]

get_lineage

get the list of IDs of a taxon and its parents (up to the root)

fn get_distance_to_common_ancestor_taxid(
    &self,
    taxid1: i32,
    taxid2: i32,
    only_canonical: bool
) -> Option<(i32, i32)>
[src]

get_distance_to_common_ancestor_id

get the distance (in steps in the tree) between taxid1 and the common ancestor with taxid2

fn get_distance_to_common_ancestor(
    &self,
    name1: &str,
    name2: &str,
    only_canonical: bool
) -> Option<(i32, String)>
[src]

get_distance_to_common_ancestor

find the distance in the tree between name1 and name2

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.