#[non_exhaustive]pub struct SimulationConfig {
pub contigs: ContigConfig,
pub reads: Vec<ReadConfig>,
}Expand description
Main configuration struct for simulation.
After construction, you can pass it to crate::simulate_mod_bam::run
to create a mod BAM file. You can build this using SimulationConfigBuilder
as shown below.
§Example
Below struct can be used in appropriate routines to create a BAM file.
use nanalogue_core::Error;
use nanalogue_core::simulate_mod_bam::{ContigConfigBuilder, SimulationConfigBuilder,
ReadConfigBuilder, ModConfigBuilder};
// Request two contigs with lengths randomly chosen from 1000 - 2000 bp.
let contig_config = ContigConfigBuilder::default()
.number(2)
.len_range((1000,2000)).build()?;
// First set of reads
let read_config1 = ReadConfigBuilder::default()
.number(100)
.mapq_range((10, 20))
.base_qual_range((30, 40))
.len_range((0.5, 0.6));
// second set of reads, now 200 requested with a modification and a barcode
let mod_config = ModConfigBuilder::default()
.base('C')
.is_strand_plus(true)
.mod_code("m".into())
.win(vec![2, 3])
.mod_range(vec![(0.1, 0.8), (0.3, 0.4)]).build()?;
let read_config2 = read_config1.clone()
.number(200)
.barcode("AATTG".into())
.mods(vec![mod_config]);
// set simulation config, ready to be fed into an appropriate function
let sim_config = SimulationConfigBuilder::default()
.contigs(contig_config)
.reads(vec![read_config1.build()?, read_config2.build()?]).build()?;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.contigs: ContigConfigConfiguration for contig generation
reads: Vec<ReadConfig>Configuration for read generation
Trait Implementations§
Source§impl Clone for SimulationConfig
impl Clone for SimulationConfig
Source§fn clone(&self) -> SimulationConfig
fn clone(&self) -> SimulationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimulationConfig
impl Debug for SimulationConfig
Source§impl Default for SimulationConfig
impl Default for SimulationConfig
Source§fn default() -> SimulationConfig
fn default() -> SimulationConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SimulationConfigwhere
SimulationConfig: Default,
impl<'de> Deserialize<'de> for SimulationConfigwhere
SimulationConfig: 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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SimulationConfig
impl PartialEq for SimulationConfig
Source§impl Serialize for SimulationConfig
impl Serialize for SimulationConfig
impl StructuralPartialEq for SimulationConfig
Auto Trait Implementations§
impl Freeze for SimulationConfig
impl RefUnwindSafe for SimulationConfig
impl Send for SimulationConfig
impl Sync for SimulationConfig
impl Unpin for SimulationConfig
impl UnwindSafe for SimulationConfig
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.