pub struct Omnitigs<Graph: GraphBase> { /* private fields */ }
Expand description
A structure containing omnitigs of a graph.
Implementations§
source§impl<Graph: StaticGraph + SubgraphBase<RootGraph = Graph>> Omnitigs<Graph>
impl<Graph: StaticGraph + SubgraphBase<RootGraph = Graph>> Omnitigs<Graph>
sourcepub fn compute_non_trivial_only(graph: &Graph) -> Self
pub fn compute_non_trivial_only(graph: &Graph) -> Self
Computes the maximal non-trivial omnitigs of the graph.
sourcepub fn compute_trivial_only(graph: &Graph) -> Self
pub fn compute_trivial_only(graph: &Graph) -> Self
Computes the maximal trivial omnitigs of the given graph, including those that are subwalks of maximal non-trivial omnitigs.
sourcepub fn compute_trivial_only_non_scc(graph: &Graph) -> Self
pub fn compute_trivial_only_non_scc(graph: &Graph) -> Self
Computes the maximal trivial omnitigs of the given graph, including those that are subwalks of maximal non-trivial omnitigs. This algorithm allows the graph to be not strongly connected, but it is a bit slower, especially for long trivial omnitigs.
sourcepub fn compute_multi_safe(graph: &Graph) -> Self
pub fn compute_multi_safe(graph: &Graph) -> Self
Computes the maximal multi-safe walks of the given graph.
sourcepub fn transform_to_multi_safe_strict_model(
&mut self,
truncation_mode: TruncationMode
)
pub fn transform_to_multi_safe_strict_model( &mut self, truncation_mode: TruncationMode )
The univocal extension of a multi-safe walk is not multi-safe in the strict model if the left and the right extension share any arcs.
In this case, we can truncate the walk to remove the repetitions.
However, there are multiple points at which we could truncate.
The parameter truncation_mode
decides which of the truncations should be reported.
source§impl<Graph: StaticEdgeCentricBigraph> Omnitigs<Graph>where
Graph::EdgeData: BidirectedData + Eq,
Graph::NodeData: Debug,
impl<Graph: StaticEdgeCentricBigraph> Omnitigs<Graph>where Graph::EdgeData: BidirectedData + Eq, Graph::NodeData: Debug,
sourcepub fn remove_reverse_complements(&mut self, graph: &Graph)
pub fn remove_reverse_complements(&mut self, graph: &Graph)
Retains only one direction of each pair of reverse-complemental omnitigs.
Note: I am not sure if this method is correct in all cases, but it will panic if it finds a case where it is not correct. For practical genomes it seems to work.
source§impl<Graph: GraphBase> Omnitigs<Graph>
impl<Graph: GraphBase> Omnitigs<Graph>
sourcepub fn new(
omnitigs: Vec<Omnitig<Graph>>,
omnitigs_per_macrotig: Vec<usize>
) -> Self
pub fn new( omnitigs: Vec<Omnitig<Graph>>, omnitigs_per_macrotig: Vec<usize> ) -> Self
Creates a new Omnitigs
struct from the given omnitigs and statistics.
sourcepub fn iter(&self) -> impl Iterator<Item = &Omnitig<Graph>>
pub fn iter(&self) -> impl Iterator<Item = &Omnitig<Graph>>
Returns an iterator over the omnitigs in this struct.
sourcepub fn omnitigs_per_macrotig(&self) -> &[usize]
pub fn omnitigs_per_macrotig(&self) -> &[usize]
Returns a slice of omnitig counts per macrotig.
Trait Implementations§
source§impl<Graph: GraphBase> BorrowMut<[Omnitig<Graph>]> for Omnitigs<Graph>
impl<Graph: GraphBase> BorrowMut<[Omnitig<Graph>]> for Omnitigs<Graph>
source§fn borrow_mut(&mut self) -> &mut [Omnitig<Graph>]
fn borrow_mut(&mut self) -> &mut [Omnitig<Graph>]
source§impl<Graph: GraphBase, IndexType> Index<IndexType> for Omnitigs<Graph>where
Vec<Omnitig<Graph>>: Index<IndexType>,
impl<Graph: GraphBase, IndexType> Index<IndexType> for Omnitigs<Graph>where Vec<Omnitig<Graph>>: Index<IndexType>,
source§impl<Graph: GraphBase> IntoIterator for Omnitigs<Graph>
impl<Graph: GraphBase> IntoIterator for Omnitigs<Graph>
source§impl<Graph: GraphBase> PartialEq<Omnitigs<Graph>> for Omnitigs<Graph>where
Graph::EdgeIndex: PartialEq,
impl<Graph: GraphBase> PartialEq<Omnitigs<Graph>> for Omnitigs<Graph>where Graph::EdgeIndex: PartialEq,
impl<Graph: GraphBase> Eq for Omnitigs<Graph>where Graph::EdgeIndex: Eq,
Auto Trait Implementations§
impl<Graph> RefUnwindSafe for Omnitigs<Graph>where <Graph as GraphBase>::EdgeIndex: RefUnwindSafe,
impl<Graph> Send for Omnitigs<Graph>where <Graph as GraphBase>::EdgeIndex: Send,
impl<Graph> Sync for Omnitigs<Graph>where <Graph as GraphBase>::EdgeIndex: Sync,
impl<Graph> Unpin for Omnitigs<Graph>where <Graph as GraphBase>::EdgeIndex: Unpin,
impl<Graph> UnwindSafe for Omnitigs<Graph>where <Graph as GraphBase>::EdgeIndex: 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
§impl<T> Conv for T
impl<T> Conv for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.