Skip to main content

Simulate

Struct Simulate 

Source
pub struct Simulate {
Show 25 fields pub reference: ReferenceOptions, pub vcf: VcfOptions, pub bed: BedOptions, pub output: OutputPrefixOptions, pub seed: SeedOptions, pub coverage: f64, pub read_length: usize, pub fragment_mean: usize, pub fragment_stddev: usize, pub min_fragment_length: usize, pub single_end: bool, pub adapter_r1: String, pub adapter_r2: String, pub min_error_rate: f64, pub max_error_rate: f64, pub max_n_frac: f64, pub methylation_mode: Option<MethylationMode>, pub methylation_conversion_rate: Option<f64>, pub methylation_failure_rate: Option<f64>, pub cpg_truth_bedgraph: Option<PathBuf>, pub golden_bam: bool, pub golden_vcf: bool, pub simple_names: bool, pub compression: u8, pub threads: usize,
}
Expand description

Simulate sequencing reads from a reference genome.

Generates paired-end or single-end FASTQ files with optional ground-truth BAM and VCF outputs for benchmarking alignment and variant calling pipelines. Variants are applied from an input VCF to construct haplotype sequences, and reads are sampled with a position-dependent Illumina error model.

Fields§

§reference: ReferenceOptions§vcf: VcfOptions§bed: BedOptions§output: OutputPrefixOptions§seed: SeedOptions§coverage: f64

Mean sequencing coverage depth.

§read_length: usize

Length of each read in bases.

§fragment_mean: usize

Mean insert size (outer distance between read pair ends).

§fragment_stddev: usize

Standard deviation of the insert size distribution.

§min_fragment_length: usize

Minimum fragment length in bases; sampled lengths below this are clamped up. Fragments shorter than the read length are padded with adapter sequence. Must be at least 1.

§single_end: bool

Generate single-end reads instead of paired-end.

§adapter_r1: String

Adapter sequence appended to read 1 when the fragment is shorter than the read length.

§adapter_r2: String

Adapter sequence appended to read 2 when the fragment is shorter than the read length.

§min_error_rate: f64

Minimum per-base error rate, applied at the start of reads.

§max_error_rate: f64

Maximum per-base error rate, applied at the end of reads.

§max_n_frac: f64

Maximum fraction of a read’s bases that may come from ambiguous reference positions (IUPAC codes or N). Reference bases resolved from ambiguity codes are flagged at load time and counted per read; read pairs whose R1 or R2 exceeds this fraction are rejected and resampled. Setting this to 1.0 disables the filter; setting it to 0.0 requires every base to come from an unambiguous reference position. Value must be in [0.0, 1.0].

§methylation_mode: Option<MethylationMode>

Enable methylation chemistry simulation. em-seq (or bisulfite) converts unmethylated cytosines to thymine and preserves methylated ones (matches both bisulfite and em-seq protocols). taps is the inverse: methylated cytosines convert to thymine while unmethylated ones are preserved. When omitted, no methylation chemistry is applied. Requires a methylation-annotated VCF (MT/MB FORMAT fields) produced by holodeck methylate.

§methylation_conversion_rate: Option<f64>

Probability that the converting class of cytosines (unmethylated for em-seq/bisulfite, methylated for TAPS) is converted to thymine in a molecule that converted normally. 1.0 is perfect chemistry; real protocols typically achieve 0.990.999. Only takes effect when --methylation-mode is set; passing this flag without a mode is rejected. Defaults to 0.999 when --methylation-mode is set without this flag.

§methylation_failure_rate: Option<f64>

Fraction of molecules that are whole-molecule conversion failures. Real bisulfite/EM-seq conversion is bimodal: most molecules convert near-completely, a small fraction (fragments that fail to denature or re-anneal too fast) escape conversion as a coherent unit. A failed molecule converts its should-convert cytosines at 1 - methylation-conversion-rate (near-zero), so it retains almost all of them as C across both mates. The golden BAM stamps each record with cf:i:{0|1} recording which camp the molecule was in. Only takes effect when --methylation-mode is set; passing this flag without a mode is rejected. Defaults to 0.01 (1%) when --methylation-mode is set without this flag; pass 0.0 to disable.

§cpg_truth_bedgraph: Option<PathBuf>

Write a per-CpG ground-truth methylation tally in MethylDackel’s extract CpG bedGraph format. Columns: chrom start end rate (0–100) n_methylated n_unmethylated. For every reference CpG covered by at least one simulated read, counts how many reads called the site as methylated vs unmethylated according to the simulator’s per-haplotype, per-strand methylation bitmap (NOT the post-conversion sequenced base). Lets downstream evaluators measure aligner-derived methylation calls against ground truth using the same code paths that consume MethylDackel output. Requires --methylation-mode.

§golden_bam: bool

Write a ground-truth BAM file with correct alignments.

§golden_vcf: bool

Write a ground-truth VCF annotated with simulated coverage.

§simple_names: bool

Use simple read names (holodeck::N) instead of encoding truth coordinates in the read name.

§compression: u8

BGZF compression level (0-12). Lower values are faster with larger output files; higher values produce smaller files at the cost of speed. Level 0 is no compression; 1 is fastest; 12 is maximum compression.

§threads: usize

Number of threads for parallel BGZF output compression.

Trait Implementations§

Source§

impl Args for Simulate

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Command for Simulate

Source§

fn execute(&self) -> Result<()>

Execute the command. Read more
Source§

impl CommandFactory for Simulate

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Simulate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Simulate

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Simulate

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

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> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. 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> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V