[−][src]Struct debruijn::graph::DebruijnGraph
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
pub fn find_link(&self, kmer: K, dir: Dir) -> Option<(usize, Dir, bool)>
[src]
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]
&self,
node_id: usize,
valid_nodes: Option<&BitSet>
) -> Exts
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]
F: Fn(&D) -> f32,
F2: Fn(&D) -> bool,
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]
&self,
path: I
) -> DnaString
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]
&self,
path: P,
node_label: &F
)
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]
&self,
gfa_out: P,
tag_func: F
) -> Result<(), Error>
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]
&self,
fmt_func: F,
writer: &mut W,
rest: Option<Value>
)
pub fn to_json<W: Write, F: Fn(&D) -> Value, RF: Fn(&mut W)>(
&self,
fmt_func: F,
writer: &mut W
)
[src]
&self,
fmt_func: F,
writer: &mut W
)
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]
&self,
beam: usize,
score: F,
_solid_path: F2
) -> Vec<(usize, Dir)> where
F: Fn(&D) -> f32,
F2: Fn(&D) -> bool,
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?
fn into_iter(self) -> Self::IntoIter
[src]
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]
K: Serialize,
D: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, K: Hash, D> Deserialize<'de> for DebruijnGraph<K, D> where
K: Deserialize<'de>,
D: Deserialize<'de>,
[src]
K: Deserialize<'de>,
D: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<K, D> Send for DebruijnGraph<K, D> where
D: Send,
K: Send,
D: Send,
K: Send,
impl<K, D> Sync for DebruijnGraph<K, D> where
D: Sync,
K: Sync,
D: Sync,
K: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,