pub struct NCGfa<T: OptFields> {
pub header: Header,
pub nodes: Vec<NCNode<T>>,
pub paths: Vec<NCPath>,
pub edges: Option<Vec<NCEdge<T>>>,
pub mapper: Vec<String>,
}Expand description
The graph contains of nodes, path and edges. NCGfa = NumericCompactGfa This is a compact graph representation of the GFA file.
Comment: Implementation here are much faster and do include some derivates of parser and data structures that are not parsing the whole file and/or are faster with the downside of more memory.
Fields§
§header: Header§nodes: Vec<NCNode<T>>§paths: Vec<NCPath>§edges: Option<Vec<NCEdge<T>>>§mapper: Vec<String>Implementations§
Source§impl<T: OptFields> NCGfa<T>
impl<T: OptFields> NCGfa<T>
Sourcepub fn parse_gfa_file_direct(&mut self, file_name: &str, edge: bool)
pub fn parse_gfa_file_direct(&mut self, file_name: &str, edge: bool)
Sourcepub fn parse_gfa_file_and_convert(&mut self, file_name: &str, edges: bool)
pub fn parse_gfa_file_and_convert(&mut self, file_name: &str, edges: bool)
Sourcepub fn make_mapper(&mut self, graph: &Gfa<T>) -> HashMap<String, usize>
pub fn make_mapper(&mut self, graph: &Gfa<T>) -> HashMap<String, usize>
Creat a map from string node id -> numeric node id
Sourcepub fn convert_with_mapper(
&mut self,
mapper: HashMap<String, usize>,
graph: &Gfa<T>,
)
pub fn convert_with_mapper( &mut self, mapper: HashMap<String, usize>, graph: &Gfa<T>, )
Convert the “old” graph with the mapper
Using the mapper from “make_mapper”
Sourcepub fn get_old_node(&self, node_id: &usize) -> &String
pub fn get_old_node(&self, node_id: &usize) -> &String
Get original (string) node
Sourcepub fn check_numeric(&self) -> bool
pub fn check_numeric(&self) -> bool
Check if the graph is really numeric
Sourcepub fn remove_mapper(&mut self)
pub fn remove_mapper(&mut self)
Remove the mapper if not needed
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NCGfa<T>
impl<T> RefUnwindSafe for NCGfa<T>where
T: RefUnwindSafe,
impl<T> Send for NCGfa<T>where
T: Send,
impl<T> Sync for NCGfa<T>where
T: Sync,
impl<T> Unpin for NCGfa<T>where
T: Unpin,
impl<T> UnwindSafe for NCGfa<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more