Expand description
A wrapper of petgraph’s directed Graph struct, applied to a GFA. The edge weights included are the Orientation’s of the adjacent segments, and the coverage of this edge.
Tuple Fields
0: Graph<usize, (Orientation, Orientation, Option<i64>)>Implementations
sourceimpl GFAdigraph
impl GFAdigraph
sourcepub fn dot(&self, gfa: GFAtk) -> Result<()>
pub fn dot(&self, gfa: GFAtk) -> Result<()>
The main function called from gfatk dot.
It is a somewhat modified, simplified version of this: https://docs.rs/petgraph/latest/src/petgraph/dot.rs.html#1-349
Generating a DOT language output of a GFA file.
sourcepub fn weakly_connected_components(
&self,
graph_indices: GFAGraphLookups
) -> Result<Vec<Vec<usize>>>
pub fn weakly_connected_components(
&self,
graph_indices: GFAGraphLookups
) -> Result<Vec<Vec<usize>>>
Split the GFA digraph into subgraphs which are the weakly connected components of the graph.
sourcepub fn all_paths_all_node_pairs(
&self,
graph_indices: &GFAGraphLookups,
rel_coverage_map: Option<&HashMap<NodeIndex, usize>>
) -> Result<(Vec<(NodeIndex, Orientation)>, Vec<usize>, String)>
pub fn all_paths_all_node_pairs(
&self,
graph_indices: &GFAGraphLookups,
rel_coverage_map: Option<&HashMap<NodeIndex, usize>>
) -> Result<(Vec<(NodeIndex, Orientation)>, Vec<usize>, String)>
The main function called from gfatk linear.
This function will generate the longest path through the GFA, by
filtering the output of all_paths, and choosing the path with
the highest cumulative edge coverage.
sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Simple wrapper of Graph.node_count() in petgraph.
sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Simple wrapper of Graph.edge_count() in petgraph.
sourcepub fn trim(&self, graph_indices: GFAGraphLookups) -> Vec<usize>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn trim(&self, graph_indices: GFAGraphLookups) -> Vec<usize>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trim a graph to include only nodes connected to two or more other nodes.
This algorithm will loop for as long as the longest branch in the GFA yields a segment connected to only a single node.
Auto Trait Implementations
impl RefUnwindSafe for GFAdigraph
impl Send for GFAdigraph
impl Sync for GFAdigraph
impl Unpin for GFAdigraph
impl UnwindSafe for GFAdigraph
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more