#[non_exhaustive]pub struct ReadConfig {
pub number: NonZeroU32,
pub mapq_range: OrdPair<u8>,
pub base_qual_range: OrdPair<u8>,
pub len_range: OrdPair<F32Bw0and1>,
pub barcode: Option<DNARestrictive>,
pub delete: Option<OrdPair<F32Bw0and1>>,
pub insert_middle: Option<DNARestrictive>,
pub mismatch: Option<F32Bw0and1>,
pub mods: Vec<ModConfig>,
}Expand description
Configuration for read generation. Also refer to SimulationConfig
to see how this struct can be used, and to ReadConfigBuilder for
how to build this (as shown below in the examples).
§Example 1
Request reads without modifications
use nanalogue_core::Error;
use nanalogue_core::simulate_mod_bam::ReadConfigBuilder;
// 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)).build()?;
§Example 2
Request reads with modifications, but also with insertions, deletions, and a mismatch rate.
use nanalogue_core::Error;
use nanalogue_core::simulate_mod_bam::{ReadConfigBuilder, ModConfigBuilder};
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 = ReadConfigBuilder::default()
.number(200)
.mapq_range((30, 40))
.base_qual_range((50, 60))
.barcode("AATTG".into())
.len_range((0.7, 0.8))
.delete((0.2, 0.3))
.insert_middle("ATCGA".into())
.mismatch(0.1)
.mods(vec![mod_config]).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: NonZeroU32Total number of reads to generate
mapq_range: OrdPair<u8>Mapping quality range [min, max]
base_qual_range: OrdPair<u8>Base quality score range [min, max]
len_range: OrdPair<F32Bw0and1>Read length range as fraction of contig [min, max] (e.g.: [0.1, 0.8] = 10% to 80%)
barcode: Option<DNARestrictive>Optional barcode DNA sequence to add to read ends
delete: Option<OrdPair<F32Bw0and1>>Optional deletion: fractional range [start, end] of read to delete (e.g., [0.5, 0.7] deletes middle 20%)
insert_middle: Option<DNARestrictive>Optional sequence to insert at the middle of the read
mismatch: Option<F32Bw0and1>Optional mismatch fraction: random fraction of bases to mutate (e.g., 0.5 = 50% of bases)
mods: Vec<ModConfig>Modification configurations
Trait Implementations§
Source§impl Clone for ReadConfig
impl Clone for ReadConfig
Source§fn clone(&self) -> ReadConfig
fn clone(&self) -> ReadConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReadConfig
impl Debug for ReadConfig
Source§impl Default for ReadConfig
impl Default for ReadConfig
Source§impl<'de> Deserialize<'de> for ReadConfigwhere
ReadConfig: Default,
impl<'de> Deserialize<'de> for ReadConfigwhere
ReadConfig: 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 ReadConfig
impl PartialEq for ReadConfig
Source§impl Serialize for ReadConfig
impl Serialize for ReadConfig
impl StructuralPartialEq for ReadConfig
Auto Trait Implementations§
impl Freeze for ReadConfig
impl RefUnwindSafe for ReadConfig
impl Send for ReadConfig
impl Sync for ReadConfig
impl Unpin for ReadConfig
impl UnwindSafe for ReadConfig
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.