pub struct GFAtk(pub GFA<usize, OptionalFields>);Expand description
A wrapper around GFA from the gfa crate TODO: make GFAtk generic for any segment name, not just usize.
Tuple Fields
0: GFA<usize, OptionalFields>Implementations
sourceimpl GFAtk
impl GFAtk
sourcepub fn into_ungraph(&self) -> Result<(GFAGraphLookups, GFAungraph)>
pub fn into_ungraph(&self) -> Result<(GFAGraphLookups, GFAungraph)>
Returns a tuple of GFAGraphLookups (a struct of indices/node names) and an undirected GFA graph structure.
sourcepub fn into_digraph(&self) -> Result<(GFAGraphLookups, GFAdigraph)>
pub fn into_digraph(&self) -> Result<(GFAGraphLookups, GFAdigraph)>
Returns a tuple of GFAGraphLookups (a struct of indices/node names) and an directed GFA graph structure.
Most functionality of this binary is on directed graph structures
sourcepub fn print_extract(&self, sequences_to_keep: Vec<usize>)
pub fn print_extract(&self, sequences_to_keep: Vec<usize>)
A method to print a GFA to STDOUT, given a vector of sequence ID’s to keep.
sourcepub fn make_overlaps(&self, extend_length: usize) -> Result<Overlaps>
pub fn make_overlaps(&self, extend_length: usize) -> Result<Overlaps>
Returns the overlaps between all the segments in a GFA.
sourcepub fn print_sequences(
&self,
subgraph_index_header: Option<String>
) -> Result<()>
pub fn print_sequences(
&self,
subgraph_index_header: Option<String>
) -> Result<()>
The internal function called when gfatk fasta is called.
Prints all segments of the GFA as-is.
sourcefn parse_coverage_opt(opt: &OptFieldVal) -> Result<&f32>
fn parse_coverage_opt(opt: &OptFieldVal) -> Result<&f32>
Two internal functions below to parse coverage of a GFA segment.
Used in gfatk stats.
fn get_coverage(&self) -> Result<f32>
sourcepub fn node_seq_len_and_cov(&self, node: usize) -> Result<(usize, f32)>
pub fn node_seq_len_and_cov(&self, node: usize) -> Result<(usize, f32)>
Return the coverage and sequence length for a segment, given a segment name.
Note segment names are always usize.
sourcepub fn sequence_stats(
&self,
genome_type: GenomeType,
tabular: bool
) -> Result<(f32, f32, usize)>
pub fn sequence_stats(
&self,
genome_type: GenomeType,
tabular: bool
) -> Result<(f32, f32, usize)>
The internal function called in gfatk stats.
Returns average GC%, average coverage, and total sequence length for a GFA (sub)graph.
sourcepub fn gen_cov_hash(
&self,
graph_lookup: &GFAGraphLookups
) -> Result<HashMap<NodeIndex, usize>>
pub fn gen_cov_hash(
&self,
graph_lookup: &GFAGraphLookups
) -> Result<HashMap<NodeIndex, usize>>
Returns a HashMap of relative coverage of each node (segment) in the GFA.
Relative here indicates that each segment coverage is divided by the lowest coverage node, and rounded.