#[non_exhaustive]pub struct ContigConfig {
pub number: NonZeroU32,
pub len_range: OrdPair<NonZeroU64>,
pub repeated_seq: Option<DNARestrictive>,
}Expand description
Configuration for contig generation
The struct contains parameters which can then be passed to other
functions to construct the actual contig. Also refer to SimulationConfig
to see how this struct can be used, and ContigConfigBuilder for how
to build this (as shown below in the examples).
§Examples
Request two contigs with lengths randomly chosen from 1000 - 2000 bp. The DNA of the contigs are randomly-generated.
use nanalogue_core::Error;
use nanalogue_core::simulate_mod_bam::ContigConfigBuilder;
let contig_config = ContigConfigBuilder::default()
.number(2)
.len_range((1000,2000)).build()?;
Request similar contigs as above but with the DNA of the contigs consisting of the same sequence repeated over and over.
let contig_config = ContigConfigBuilder::default()
.number(2)
.len_range((1000,2000))
.repeated_seq("AAGCTTGA".into()).build()?;
Request a contig with a fixed length and sequence. As the repeated sequence’s length is equal to the contig length, and the contig length is precisely fixed, you get a non-randomly generated contig.
let contig_config = ContigConfigBuilder::default()
.number(1)
.len_range((20,20))
.repeated_seq("ACGTACGTACGTACGTACGT".into()).build()?;
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.number: NonZeroU32Number of contigs to generate
len_range: OrdPair<NonZeroU64>Contig length range in bp [min, max]
repeated_seq: Option<DNARestrictive>Optional repeated sequence to use for contigs instead of random generation
Trait Implementations§
Source§impl Clone for ContigConfig
impl Clone for ContigConfig
Source§fn clone(&self) -> ContigConfig
fn clone(&self) -> ContigConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContigConfig
impl Debug for ContigConfig
Source§impl Default for ContigConfig
impl Default for ContigConfig
Source§impl<'de> Deserialize<'de> for ContigConfigwhere
ContigConfig: Default,
impl<'de> Deserialize<'de> for ContigConfigwhere
ContigConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ContigConfig
impl PartialEq for ContigConfig
Source§impl Serialize for ContigConfig
impl Serialize for ContigConfig
impl StructuralPartialEq for ContigConfig
Auto Trait Implementations§
impl Freeze for ContigConfig
impl RefUnwindSafe for ContigConfig
impl Send for ContigConfig
impl Sync for ContigConfig
impl Unpin for ContigConfig
impl UnwindSafe for ContigConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.