MASON_FRAG_SEQUENCING(1)

πŸ“¦
version 2.5.2 Β· 2 versions
, in ubuntu stonking

πŸ’… MASON_FRAG_SEQUENCING πŸ’…

ok bestie, so mason_frag_sequencing is a manual page from section 1, and it's giving fragment sequencing simulation realness. let's get into it 🫢


✨ NAME ✨

mason_frag_sequencing β€” Fragment Sequencing Simulation

like literally, that's the whole name. short. iconic. no notes. πŸ‘‘


🌸 SYNOPSIS 🌸

mason_frag_sequencing [OPTIONS] -i IN.fa -o OUT.{fa,fq} [-or OUT2.{fa,fq}]

so you feed it an input with -i (IN.fa), you get yourself an output with -o (OUT.{fa,fq}), and if you're feeling extra you can also drop a second output file with -or (OUT2.{fa,fq}). the {fa,fq} is doing the most β€” it means FASTA or FASTQ, whichever you vibe with. and yeah, [OPTIONS] is up there front and center bc there's a whole menu of them. iykyk. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: you hand it a FASTA file that's full of fragments, and it simulates the sequencing of those fragments. that's the whole gig. fragment in, reads out, slay. πŸ’«

now let's talk about what it is vs what it isn't, bc this matters:

  • it's a more lightweight version of mason_sequencing β€” the cute minimalist sibling basically πŸ™ˆ
  • it does not support the application of VCF 🌈 (no variant calling chaos here, sorry)
  • it does not support fragment sampling πŸŽ€
  • output of SAM is also not available πŸ’€ like, that format is simply not invited to this party

BUT β€” and this is the part where it eats β€” it uses the same code for the simulation of the reads as the more powerful mason_simulator. so even though it's the smaller one, the actual read-simulating engine is highkey the same. no cap. πŸ”₯

so when should you reach for this one instead of the big kids? the manpage says: use mason_frag_sequencing if you want to implement your own fragmentation behaviour β€” like, for example, if you've already implemented your own bias models. that's your moment. main character energy, honestly. 🧚

fr fr, if you want VCF support, fragment sampling, or SAM output, this is not the tool for you β€” this one is deliberately the lightweight one. πŸ‘‘

✨ OPTIONS ✨

okay bestie, here's the whole command-line menu πŸ’… every flag, every default, no skips, no cap.

  • -h, --help β€” pops up the help message. your emotional support flag 🫢
  • --version β€” tells you what version you're running.
  • -q, --quiet β€” low verbosity. she's shy.
  • -v, --verbose β€” higher verbosity. she's talking more.
  • -vv, --very-verbose β€” highest verbosity. she is telling you EVERYTHING 😭
  • --seed UINT64 β€” the seed for the random number generator. Default: 0.
  • -i, --in INPUT_FILE β€” path to your input file. valid filetypes are: .sam[.*], .raw[.*], .gbk[.*], .frn[.*], .fq[.*], .fna[.*], .ffn[.*], .fastq[.*], .fasta[.*], .fas[.*], .faa[.*], .fa[.*], .embl[.*], and .bam, where * is any of the following extensions: gz, bz2, and bgzf for transparent (de)compression. so yes, the [.*] thing is just built-in (de)compression glow-up ✨
  • -o, --out OUTPUT_FILE β€” output for single-end reads / left end reads. valid filetypes are: .sam[.*], .raw[.*], .frn[.*], .fq[.*], .fna[.*], .ffn[.*], .fastq[.*], .fasta[.*], .fas[.*], .faa[.*], .fa[.*], and .bam, where * is any of the following extensions: gz, bz2, and bgzf for transparent (de)compression.
  • -or, --out-right OUTPUT_FILE β€” output for the right reads. giving this option is what turns on paired-end simulation πŸ’– valid filetypes are: .sam[.*], .raw[.*], .frn[.*], .fq[.*], .fna[.*], .ffn[.*], .fastq[.*], .fasta[.*], .fas[.*], .faa[.*], .fa[.*], and .bam, where * is any of the following extensions: gz, bz2, and bgzf for transparent (de)compression.
  • --force-single-end β€” forces single-end simulation even though you literally handed her --out-right. she said no paired-end today πŸ™ˆ

🌈 Global Read Simulation Options

  • --seq-technology STRING β€” which sequencing technology to simulate. one of illumina, 454, and sanger. Default: illumina.
  • --seq-mate-orientation STRING β€” orientation for paired reads. go read the Read Orientation section below, bestie. one of FR, RF, FF, and FF2. Default: FR.
  • --seq-strands STRING β€” which strands to simulate from, only applies to paired sequencing simulation. one of forward, reverse, and both. Default: both.
  • --embed-read-info β€” whether or not to embed read information.
  • --read-name-prefix STRING β€” your read names get this prefix. Default: simulated..

πŸŽ€ BS-Seq Options

  • --enable-bs-seq β€” enables BS-seq simulation.
  • --bs-seq-protocol STRING β€” the protocol to use for BS-Seq simulation. one of directional and undirectional. Default: directional.
  • --bs-seq-conversion-rate DOUBLE β€” conversion rate for unmethylated Cs to turn into Ts. In range [0..1]. Default: 0.99.

🧚 Illumina Options

  • --illumina-read-length INTEGER β€” read length for Illumina simulation. In range [1..inf]. Default: 100.
  • --illumina-error-profile-file INPUT_FILE β€” path to the file with the Illumina error profile. it has to be a text file with floating point numbers separated by space, each one giving a positional error rate. valid filetype is: .txt.
  • --illumina-prob-insert DOUBLE β€” per-base probability of insertion in Illumina sequencing. In range [0..1]. Default: 0.00005.
  • --illumina-prob-deletion DOUBLE β€” per-base probability of deletion in Illumina sequencing. In range [0..1]. Default: 0.00005.
  • --illumina-prob-mismatch-scale DOUBLE β€” scaling factor for Illumina mismatch probability. In range [0..inf]. Default: 1.0.
  • --illumina-prob-mismatch DOUBLE β€” average per-base mismatch probability in Illumina sequencing. In range [0.0..1.0]. Default: 0.004.
  • --illumina-prob-mismatch-begin DOUBLE β€” per-base mismatch probability of the first base in Illumina sequencing. In range [0.0..1.0]. Default: 0.002.
  • --illumina-prob-mismatch-end DOUBLE β€” per-base mismatch probability of the last base in Illumina sequencing. In range [0.0..1.0]. Default: 0.012.
  • --illumina-position-raise DOUBLE β€” the point where the error curve raises, relative to read length. In range [0.0..1.0]. Default: 0.66.
  • --illumina-quality-mean-begin DOUBLE β€” mean PHRED quality for non-mismatch bases of the first base in Illumina sequencing. Default: 40.0.
  • --illumina-quality-mean-end DOUBLE β€” mean PHRED quality for non-mismatch bases of the last base in Illumina sequencing. Default: 39.5.
  • --illumina-quality-stddev-begin DOUBLE β€” standard deviation of PHRED quality for non-mismatch bases of the first base in Illumina sequencing. Default: 0.05.
  • --illumina-quality-stddev-end DOUBLE β€” standard deviation of PHRED quality for non-mismatch bases of the last base in Illumina sequencing. Default: 10.0.
  • --illumina-mismatch-quality-mean-begin DOUBLE β€” mean PHRED quality for mismatch bases of the first base in Illumina sequencing. Default: 40.0.
  • --illumina-mismatch-quality-mean-end DOUBLE β€” mean PHRED quality for mismatch bases of the last base in Illumina sequencing. Default: 30.0.
  • --illumina-mismatch-quality-stddev-begin DOUBLE β€” standard deviation of PHRED quality for mismatch bases of the first base in Illumina sequencing. Default: 3.0.
  • --illumina-mismatch-quality-stddev-end DOUBLE β€” standard deviation of PHRED quality for mismatch bases of the last base in Illumina sequencing. Default: 15.0.
  • --illumina-left-template-fastq INPUT_FILE β€” a FASTQ file to use as a template for the left-end reads. valid filetypes are: .sam[.*], .raw[.*], .gbk[.*], .frn[.*], .fq[.*], .fna[.*], .ffn[.*], .fastq[.*], .fasta[.*], .fas[.*], .faa[.*], .fa[.*], .embl[.*], and .bam, where * is any of the following extensions: gz, bz2, and bgzf for transparent (de)compression.
  • --illumina-right-template-fastq INPUT_FILE β€” a FASTQ file to use as a template for the right-end reads. valid filetypes are: .sam[.*], .raw[.*], .gbk[.*], .frn[.*], .fq[.*], .fna[.*], .ffn[.*], .fastq[.*], .fasta[.*], .fas[.*], .faa[.*], .fa[.*], .embl[.*], and .bam, where * is any of the following extensions: gz, bz2, and bgzf for transparent (de)compression.

πŸ¦‹ Sanger Sequencing Options

  • --sanger-read-length-model STRING β€” the model used to sample the Sanger read length. one of normal and uniform. Default: normal.
  • --sanger-read-length-min INTEGER β€” the minimal read length when the read length is sampled uniformly. In range [0..inf]. Default: 400.
  • --sanger-read-length-max INTEGER β€” the maximal read length when the read length is sampled uniformly. In range [0..inf]. Default: 600.
  • --sanger-read-length-mean DOUBLE β€” the mean read length when the read length is sampled with a normal distribution. In range [0..inf]. Default: 400.
  • --sanger-read-length-error DOUBLE β€” the read length standard deviation when the read length is sampled uniformly. In range [0..inf]. Default: 40.
  • --sanger-prob-mismatch-scale DOUBLE β€” scaling factor for Sanger mismatch probability. In range [0..inf]. Default: 1.0.
  • --sanger-prob-mismatch-begin DOUBLE β€” per-base mismatch probability of the first base in Sanger sequencing. In range [0.0..1.0]. Default: 0.005.
  • --sanger-prob-mismatch-end DOUBLE β€” per-base mismatch probability of the last base in Sanger sequencing. In range [0.0..1.0]. Default: 0.001.
  • --sanger-prob-insertion-begin DOUBLE β€” per-base insertion probability of the first base in Sanger sequencing. In range [0.0..1.0]. Default: 0.0025.
  • --sanger-prob-insertion-end DOUBLE β€” per-base insertion probability of the last base in Sanger sequencing. In range [0.0..1.0]. Default: 0.005.
  • --sanger-prob-deletion-begin DOUBLE β€” per-base deletion probability of the first base in Sanger sequencing. In range [0.0..1.0]. Default: 0.0025.
  • --sanger-prob-deletion-end DOUBLE β€” per-base deletion probability of the last base in Sanger sequencing. In range [0.0..1.0]. Default: 0.005.
  • --sanger-quality-match-start-mean DOUBLE β€” mean PHRED quality for non-mismatch bases of the first base in Sanger sequencing. Default: 40.0.
  • --sanger-quality-match-end-mean DOUBLE β€” mean PHRED quality for non-mismatch bases of the last base in Sanger sequencing. Default: 39.5.
  • --sanger-quality-match-start-stddev DOUBLE β€” mean PHRED quality for non-mismatch bases of the first base in Sanger sequencing. Default: 0.1.
  • --sanger-quality-match-end-stddev DOUBLE β€” mean PHRED quality for non-mismatch bases of the last base in Sanger sequencing. Default: 2.
  • --sanger-quality-error-start-mean DOUBLE β€” mean PHRED quality for erroneous bases of the first base in Sanger sequencing. Default: 30.
  • --sanger-quality-error-end-mean DOUBLE β€” mean PHRED quality for erroneous bases of the last base in Sanger sequencing. Default: 20.
  • --sanger-quality-error-start-stddev DOUBLE β€” mean PHRED quality for erroneous bases of the first base in Sanger sequencing. Default: 2.
  • --sanger-quality-error-end-stddev DOUBLE β€” mean PHRED quality for erroneous bases of the last base in Sanger sequencing. Default: 5.

πŸ’œ 454 Sequencing Options

  • --454-read-length-model STRING β€” the model used to sample the 454 read length. one of normal and uniform. Default: normal.
  • --454-read-length-min INTEGER β€” the minimal read length when the read length is sampled uniformly. In range [0..inf]. Default: 10.
  • --454-read-length-max INTEGER β€” the maximal read length when the read length is sampled uniformly. In range [0..inf]. Default: 600.
  • --454-read-length-mean DOUBLE β€” the mean read length when the read length is sampled with a normal distribution. In range [0..inf]. Default: 400.
  • --454-read-length-stddev DOUBLE β€” the read length standard deviation when the read length is sampled with a normal distribution. In range [0..inf]. Default: 40.
  • --454-no-sqrt-in-std-dev β€” for the error model: if this is set, (sigma = k * r)) is used, otherwise (sigma = k * sqrt(r)).
  • --454-proportionality-factor DOUBLE β€” proportionality factor for calculating the standard deviation proportional to the read length. In range [0..inf]. Default: 0.15.
  • --454-background-noise-mean DOUBLE β€” mean of the lognormal distribution used for the noise. In range [0..inf]. Default: 0.23.
  • --454-background-noise-stddev DOUBLE β€” standard deviation of the lognormal distribution used for the noise. In range [0..inf]. Default: 0.15.

⭐ SEQUENCING SIMULATION ⭐

couple of things you truly need to know before you hit enter, bestie:

  • base quality simulation is disabled when you're writing out FASTA files. so if you wanted qualities, FASTA is not the vibe πŸ‘‘
  • paired-end sequencing simulation gets enabled when you specify two output files. two files in, two reads out, that's the math πŸ’–

Reads are not all floating around doing their own thing, bestie β€” paired-end has ✨orientation✨ and you get to pick it with --mate-orientation. Here are the valid values, no cap:

  • FR β€” reads are inward-facing, same energy as Illumina paired-end reads: R1 --> <-- R2. The classic. The main character. πŸ’…
  • RF β€” reads are outward-facing, exactly like Illumina mate-pair reads: R1 <-- --> R2. Backwards but make it fashion πŸ¦‹
  • FF β€” reads are on the same strand: R1 --> --> R2. Matching fits, slay 🌸
  • FF2 β€” reads are on the same strand BUT the "right" reads get sequenced to the left of the "left" reads, same as 454 paired: R2 --> --> R1. iconic chaotic energy fr fr πŸ’€

✨ PARALLELISM ✨

🌈 General

So here's the vibe: the contigs are processed sequentially, one after another, no cutting the line πŸšΆβ™€οΈ

But within each contig? Oh she's fast. The fragments/reads get simulated in parallel by --num-threads many threads, and each of those threads simulates batches of chunks-size many fragments at a time. They just keep going like little worker bees until no more fragments are left to be simulated 🐝✨

πŸ’– CPU-Utilization

Okay so here's the tea, and it's lowkey important πŸ‘€

When the number of fragments to simulate per contig is low, it can happen that NOT all your threads get utilized. Not a bug, just math, bestie. Example time, because I know you love one:

When there are 20,000 fragments to simulate for a contig, 32 threads are available, and each thread simulates batches of 1000 (--chunk-size) fragments β€” only 20 threads are utilized. The other 12 are just sitting there, hydrated, unbothered, doing nothing 😭

So yeah: --chunk-size affects CPU-utilization. That's the whole point of mentioning it.

BUT. Very low chunk-sizes also lead to a large overhead, especially when you're using only one thread. The bookkeeping eats your gains, and it's giving diminishing returns πŸ’€

We set a sensible default, so don't stress β€” but perfomance gains may be achieved by trying different chunk-sizes. Tinker, queen πŸ‘‘

πŸŽ€ Randomization

Heads up: both --chunk-size and --num-threads affect randomization. Different values for these parameters yield different results. So if you're chasing reproducibility of a specific run, don't just go changing these and then act surprised, iykyk πŸ™ˆ


⭐ tl;dr β€” sequential contigs, parallel fragments, --mate-orientation controls which way your pairs point, and --chunk-size + --num-threads quietly change your results too. Change them on purpose, not by accident 🫢

That's the whole page, bestie β€” this was mason_frag_sequencing 2.0.13, from the [tarball], living in the MASON_FRAG_SEQUENCING(1) manual. Now go simulate some fragments, you got this πŸ’œβœ¨πŸ§š

πŸ“¦ where this page comes from