[][src]Struct debruijn::graph::DebruijnGraph

pub struct DebruijnGraph<K: Hash, D> {
    pub base: BaseGraph<K, D>,
    // some fields omitted
}

A compressed DeBruijn graph carrying auxiliary data on each node of type D. The struct carries sorted index arrays the allow the graph to be walked efficiently.

Fields

base: BaseGraph<K, D>

Methods

impl<K: Kmer, D: Debug> DebruijnGraph<K, D>[src]

pub fn len(&self) -> usize[src]

Total number of nodes in the DeBruijn graph

pub fn get_node<'a>(&'a self, node_id: usize) -> Node<'a, K, D>[src]

Get a node given it's node_id

Important traits for NodeIter<'a, K, D>
pub fn iter_nodes<'a>(&'a self) -> NodeIter<'a, K, D>[src]

Return an iterator over all nodes in the graph

Find a link in the graph, possibly handling a RC switch.

pub fn is_compressed(&self) -> Option<(usize, usize)>[src]

Check whether the graph is fully compressed. Return None if it's compressed, otherwise return Some(node1, node2) representing a pair of node that could be collapsed. Probably only useful for testing.

pub fn fix_exts(&mut self, valid_nodes: Option<&BitSet>)[src]

Remove non-existent extensions that may be created due to filtered kmers

pub fn get_valid_exts(
    &self,
    node_id: usize,
    valid_nodes: Option<&BitSet>
) -> Exts
[src]

pub fn max_path<F, F2>(&self, score: F, solid_path: F2) -> Vec<(usize, Dir)> where
    F: Fn(&D) -> f32,
    F2: Fn(&D) -> bool
[src]

Find the highest-scoring, unambiguous path in the graph. Each node get a score given by score. Any node where solid_path(node) == True are valid paths - paths will be terminated if there are multiple valid paths emanating from a node.

pub fn sequence_of_path<'a, I: 'a + Iterator<Item = &'a (usize, Dir)>>(
    &self,
    path: I
) -> DnaString
[src]

Get the sequence of a path through the graph. The path is given as a sequence of node_id integers

pub fn to_dot<P: AsRef<Path>, F: Fn(&D) -> String>(
    &self,
    path: P,
    node_label: &F
)
[src]

Write the graph to a dot file.

pub fn to_gfa<P: AsRef<Path>>(&self, gfa_out: P) -> Result<(), Error>[src]

Write the graph to GFA format

pub fn write_gfa(&self, wtr: &mut impl Write) -> Result<(), Error>[src]

pub fn to_gfa_with_tags<P: AsRef<Path>, F: Fn(&Node<K, D>) -> String>(
    &self,
    gfa_out: P,
    tag_func: F
) -> Result<(), Error>
[src]

Write the graph to GFA format

pub fn to_json_rest<W: Write, F: Fn(&D) -> Value>(
    &self,
    fmt_func: F,
    writer: &mut W,
    rest: Option<Value>
)
[src]

pub fn to_json<W: Write, F: Fn(&D) -> Value, RF: Fn(&mut W)>(
    &self,
    fmt_func: F,
    writer: &mut W
)
[src]

Write the graph to JSON

pub fn print(&self)[src]

Print a text representation of the graph.

pub fn print_with_data(&self)[src]

pub fn to_supernova_bv(&self, w: &mut dyn Write) -> Result<(), Error>[src]

pub fn max_path_beam<F, F2>(
    &self,
    beam: usize,
    score: F,
    _solid_path: F2
) -> Vec<(usize, Dir)> where
    F: Fn(&D) -> f32,
    F2: Fn(&D) -> bool
[src]

Trait Implementations

impl<'a, K: Kmer + 'a, D: Debug + 'a> IntoIterator for &'a DebruijnGraph<K, D>[src]

type Item = NodeKmer<'a, K, D>

The type of the elements being iterated over.

type IntoIter = NodeIntoIter<'a, K, D>

Which kind of iterator are we turning this into?

impl<K: Debug + Hash, D: Debug> Debug for DebruijnGraph<K, D>[src]

impl<K: Hash, D> Serialize for DebruijnGraph<K, D> where
    K: Serialize,
    D: Serialize
[src]

impl<'de, K: Hash, D> Deserialize<'de> for DebruijnGraph<K, D> where
    K: Deserialize<'de>,
    D: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<K, D> Send for DebruijnGraph<K, D> where
    D: Send,
    K: Send

impl<K, D> Sync for DebruijnGraph<K, D> where
    D: Sync,
    K: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]