pub struct Graph { /* private fields */ }Expand description
A safe, idiomatic Rust wrapper around a C++ odgi::graph_t object.
A Graph instance represents a pangenome graph loaded into memory.
Once loaded, you can use its methods to perform various queries, such as
retrieving node sequences, finding paths, and traversing the graph structure.
The only way to create a Graph is by calling Graph::load.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn node_count(&self) -> u64
pub fn node_count(&self) -> u64
Returns the total number of nodes in the graph.
Sourcepub fn get_path_names(&self) -> Vec<String>
pub fn get_path_names(&self) -> Vec<String>
Returns a list of all path names in the graph.
Sourcepub fn project(&self, _path_name: &str, _pos: u64) -> Option<PathPosition>
pub fn project(&self, _path_name: &str, _pos: u64) -> Option<PathPosition>
Projects a 0-based linear coordinate on a path to graph coordinates.
Sourcepub fn get_node_sequence(&self, _node_id: u64) -> String
pub fn get_node_sequence(&self, _node_id: u64) -> String
Gets the DNA sequence for a given node ID.
Sourcepub fn get_node_len(&self, _node_id: u64) -> u64
pub fn get_node_len(&self, _node_id: u64) -> u64
Gets the length of the sequence for a given node ID.
Sourcepub fn get_successors(&self, _node_id: u64) -> Vec<Edge>
pub fn get_successors(&self, _node_id: u64) -> Vec<Edge>
Gets all successor edges for a given node ID.
Sourcepub fn get_predecessors(&self, _node_id: u64) -> Vec<Edge>
pub fn get_predecessors(&self, _node_id: u64) -> Vec<Edge>
Gets all predecessor edges for a given node ID.
Sourcepub fn get_paths_on_node(&self, _node_id: u64) -> Vec<String>
pub fn get_paths_on_node(&self, _node_id: u64) -> Vec<String>
Gets the names of all paths that step on a given node ID.
Sourcepub fn get_path_length(&self, _path_name: &str) -> Option<u64>
pub fn get_path_length(&self, _path_name: &str) -> Option<u64>
Gets the total length of a path in base pairs.
Trait Implementations§
impl Send for Graph
Marks the Graph struct as safe to send between threads.
impl Sync for Graph
Marks the Graph struct as safe to share between threads.