Struct NcbiFileTaxonomy

Source
pub struct NcbiFileTaxonomy { /* private fields */ }

Implementations§

Source§

impl NcbiFileTaxonomy

Source

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

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");
Source

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

Source

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

get_node_by_id

get a NodeId from a numeric NCBI Taxonomy ID

Source

pub fn traversal(&self, from: i32) -> Option<Traverse<'_, i32>>

traversal

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

Source

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

get_id_by_node

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

Trait Implementations§

Source§

impl Debug for NcbiFileTaxonomy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl NcbiTaxonomy for NcbiFileTaxonomy

Source§

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

contains_id

check whether the taxonomy contains a (number) ID

Source§

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

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

Source§

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

is_descendant

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

Source§

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

is_descendant_taxid

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

Source§

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

get_name_by_id

get the scientific name associated with a given NCBI Taxonomy ID

Source§

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

get_lineage

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

Source§

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

get_distance_to_common_ancestor_id

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

Source§

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

get_distance_to_common_ancestor

find the distance in the tree between name1 and name2

Source§

fn get_id_by_name(&self, name: &str) -> Option<i32>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>,

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T