Graph

Struct Graph 

Source
pub struct Graph<N> {
    pub graph: FxMapGraph,
    pub inv_names: Vec<N>,
}
Expand description

An adjacency list representation of a generic graph, including the map required to go from node index to the original node name. The N type parameter is the node name in the original graph, e.g. BString for GFA graphs, or usize for graphs that use integer names.

Fields§

§graph: FxMapGraph§inv_names: Vec<N>

Implementations§

Source§

impl Graph<usize>

Source

pub fn from_edges<I>(input: I) -> Graph<usize>
where I: Iterator<Item = (usize, usize)>,

Construct an adjacency graph from an iterator over the edges of an existing graph. Both the input and output have usize node IDs, but from_edges performs a transformation to ensure all the node IDs are consecutive starting from 0.

Source§

impl Graph<Vec<u8>>

Source

pub fn from_gfa_reader<T: BufRead>(reader: &mut T) -> Graph<Vec<u8>>

Constructs an adjacency list representation of the given GFA file input stream, parsing the GFA line-by-line and only keeping the links. Returns the graph as an adjacency list and a map from graph indices to GFA segment names.

Source§

impl<N: Clone> Graph<N>

Source

pub fn invert_components(&self, components: Vec<Vec<usize>>) -> Vec<Vec<N>>

Given a vector of graph components (as produced by

Auto Trait Implementations§

§

impl<N> Freeze for Graph<N>

§

impl<N> RefUnwindSafe for Graph<N>
where N: RefUnwindSafe,

§

impl<N> Send for Graph<N>
where N: Send,

§

impl<N> Sync for Graph<N>
where N: Sync,

§

impl<N> Unpin for Graph<N>
where N: Unpin,

§

impl<N> UnwindSafe for Graph<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.