pub enum PathStartSource<'a> {
Index(&'a GBWT, usize),
Map(HashMap<usize, usize>),
}Expand description
A structure that determines the GBWT starting positions for paths in a graph.
The starting positions are iterated in order. If a GBWT index is provided, the starting positions are determined from the paths in the index. Otherwise the starting positions for a unidirectional index are computed on the fly.
Variants§
Index(&'a GBWT, usize)
A GBWT index of the paths and the next sequence id that has not been iterated.
Map(HashMap<usize, usize>)
A map storing the number of paths starting from each node so far.
Implementations§
Source§impl<'a> PathStartSource<'a>
impl<'a> PathStartSource<'a>
Sourcepub fn next(&mut self, node_id: usize) -> Option<Pos>
pub fn next(&mut self, node_id: usize) -> Option<Pos>
Returns the starting position of the next path.
If the source is a GBWT index, the provided node identifier is ignored.
Returns None if the path is empty or all paths in the index have been iterated.
If the source is a map, returns the starting position that would be assigned to the next path starting from the given node.
Returns None if the path is empty (if the node identifier is ENDMARKER).