shUMI simulates high-throughput UMI-tagged molecule amplification and sequencing experiments from source genomes, through molecular tagging and amplification, to raw sequencing reads.
The current implementation models a staged assay workflow:
- Input molecule population generation or loading
- Single- or double-UMI tagging, with transcription errors, indels, and recombination
- PCR amplification with stocastic copying (efficiency), substitutions, indels, recombination
- Sequencing by PacBio CCS, ONT, or a lightweight generic read simulator
The recommended entry point is a YAML configuration file with the shumi full command. Each stage can also be run directly as a subcommand for modular workflows.
For a conda-based install with compatible compiled dependencies, the following installation commands will configure a new environment and install shUMI:
conda create -n shumi-env \
-c conda-forge -c bioconda \
--strict-channel-priority \
python=3.10 pip \
biopython h5py matplotlib numpy scipy pysam pyyaml tqdm \
"samtools>=1.16" seqkit pbsim3 pbccs
conda activate shumi-env
git clone git@github.com:niaid/shumi.git
cd shumi
python -m pip install --no-deps -e .
shumi --versionFor manual installation, just make sure the following requirements are available on PATH, and then install shUMI via pip.
- Python 3.10 or newer
- Python packages listed in
pyproject.toml - pbsim3, providing a
pbsimexecutable and model files - samtools (≥1.16)
- seqkit
- PacBio pbccs
Run a complete configured simulation:
shumi full \
--config config/shumi-minimal.yaml \
--run-id example \
--out-dir shumi_outInspect available commands:
shumi --help
shumi full --help
shumi populate --help
shumi umi --help
shumi pcr --help
shumi pbccs --help
shumi ont --help
shumi genericseq --helpA complete reference of options available in each subcommand is included at config/shumi-reference.yaml.
shumi full
: Run the end-to-end workflow: population generation/loading, UMI tagging and transcription, PCR, sequencing, visualizations, and template summary exports.
shumi populate
: Create or load an input molecule population from a single sequence, an aligned population FASTA, or a random sequence.
shumi umi
: Attach one or two UMI tags to input molecules. The default mode is umi; use --mode 2umi with --second-umi-tag for a second UMI-tagging stage.
shumi pcr
: Amplify templates while modeling amplification efficiency, substitution errors, insertions, deletions, recombination, molecule sampling, and optional orientation shuffling.
shumi pbccs
: Simulate PacBio CCS reads from PCR molecules using PBSIM, samtools, ccs, and seqkit.
shumi ont
: Simulate ONT reads from PCR molecules using PBSIM and seqkit.
shumi genericseq
: Generate simple substitution-only FASTQ/FASTA reads from PCR molecules.
The simulated population represents the assayed amplicon region, not the entire genome sequence. Population inputs are configured in the populate section:
input_seq: a FASTA file containing one base sequence. Use withclonal: truefor one haplotype, or withdirichletandnhapsfor a diversified population.input_pop: a FASTA file containing an existing population or alignment. Relative abundances are inferred fromsize=Nannotations when present, or by counting duplicate sequences otherwise.random: generate a random sequence of the requested length.
Input FASTA sequences are normalized to DNA alphabet at the input boundary:
U is converted to T, and ambiguity codes are rejected for molecule input
except for alignment gaps in input_pop.
UMI tag schemas support standard bases, IUPAC ambiguity symbols, grouped
homopolymers such as (N)3, and explicit UMI blocks in square brackets. The
bracketed region defines the UMI sequence that is tracked as the molecule tag.
IUPAC ambiguous bases outside the brackets are treated as degenerate primer
bases: they are sampled independently when the primer is attached, but they are
not included in the UMI identity.
Use ambiguous symbols inside brackets when those positions are part of the UMI:
umi:
mode: umi
umi_tag: GGCCACGTACGTACGT[NNNNNNNN]AAGCGCTTAAGCGCTT
fp: AATTGGCCAAGGTTCCKeep ambiguous primer bases outside the brackets when they are part of the primer itself:
umi:
mode: 2umi
umi_tag: GTTTGGCACCTCGATGTCG[NNNYRNNNYRNNNYRNNN]GATCTCGGTGGTCGCCGTATCATT
second_umi_tag: CAAGCAGAAGACGGCATACGAGAT[NNNYRNNNYRNNNYRNNN]AGRGTTYGATYMTGGCTCAGTwo-UMI mode uses a first tag and a second tag:
umi:
mode: 2umi
umi_tag: CAGGTACCTTTAAGACCAATGAC[NNNNNNNN]GTATAGTATAGTGAGTCGTCGGACGGAGCGG
second_umi_tag: GATCTACACTCTTTCCCTACACGAC[NNNNNNNN]TAGGCATCTCCTATGGCAGGAAGAAGFirst-tag error parameters use the tag_* prefix. Second-tag error parameters
use the ss_tag_* prefix:
umi:
tag_error_rate: 1.0e-4
tag_recomb_rate: 0.0
ss_tag_error_rate: 4.95e-6
ss_tag_recomb_rate: 0.0Config files are YAML documents with sections matching pipeline stages.
global:
seed: 271828
threads: 4
out_dir: shumi_out
run_id: demo
populate:
input_seq: sequences/sars-cov-2-spike-amplicon.fasta
clonal: true
umi:
mode: umi
n_templates: 500
umi_tag: GGCCACGTACGTACGT[NNNNNNNN]AAGCGCTTAAGCGCTT
fp: AATTGGCCAAGGTTCC
pcr:
cycles: 12
sampled_molecules: 1000
copy_prob: 0.95
error_rate: 4.40e-5
del_rate: 5.0e-6
ins_rate: 5.0e-6
recomb_rate: 1.0e-3
max_molecules: 1000000
genericseq:
reads: 1000
error_rate: 0.01Output-path interpolation is supported for string fields:
pcr:
input_templates: "{umi.output_templates}"
output_molecules: "{out_dir}/{run_id}.pcr_molecules.fasta"
genericseq:
input_molecules: "{pcr.output_molecules}"
output_fastq: "{out_dir}/{run_id}.genericseq.fastq.gz"Generate a clonal input molecule population:
shumi populate \
--input-seq sequences/sars-cov-2-spike-amplicon.fasta \
--clonal \
--output shumi_out/demo.molecules.fasta \
--output-abundances shumi_out/demo.abundances.tsvGenerate UMI-tagged templates:
shumi umi \
--input-molecules shumi_out/demo.molecules.fasta \
--abundances shumi_out/demo.abundances.tsv \
--umi-tag 'GGCCACGTACGTACGT[NNNNNNNN]AAGCGCTTAAGCGCTT' \
--fp AATTGGCCAAGGTTCC \
--n-templates 100 \
--output-templates shumi_out/demo.templates.fastaRun PCR and sample output molecules:
shumi pcr \
--input-templates shumi_out/demo.templates.fasta \
--output-molecules shumi_out/demo.pcr_molecules.fasta \
--cycles 6 \
--copy-prob 0.95 \
--sampled-molecules 2000Generate generic sequencing reads:
shumi genericseq \
--input-molecules shumi_out/demo.pcr_molecules.fasta \
--output-fastq shumi_out/demo.genericseq.fastq.gz \
--reads 100 \
--error-rate 0.01Generate PacBio CCS reads:
shumi pbccs \
--input-molecules shumi_out/demo.pcr_molecules.fasta \
--output-fastq shumi_out/demo.ccs.fastq.gz \
--reads 1000 \
--movie-time 24 \
--overhead 1.5pbccs samples input molecules without replacement before running the PacBio
simulation, so reads * overhead must not exceed the number of available input
molecules.
Generate ONT reads:
shumi ont \
--input-molecules shumi_out/demo.pcr_molecules.fasta \
--output-fastq shumi_out/demo.ont.fastq.gz \
--reads 1000 \
--model QSHMM-ONT-HQ.model \
--mean-accuracy 0.92Output names depend on out_dir, run_id, and any explicit paths in the config
or command line. A full run typically produces:
- input molecule population FASTA and abundance TSV
- UMI-tagged template FASTA and mutation TSV
- optional two-UMI template FASTA and mutation TSV
- sampled post-PCR molecule FASTA
- optional PCR history HDF5 file
- sequencing FASTQ/FASTA outputs for enabled sequencing stages
- sequencing read-to-molecule mapping files
- PCR and sequencing summary visualizations
- a template summary CSV with PCR and read representation
PCR molecule names include lineage metadata:
mol_1_template=<template_id>_copies=<n>_muts=<n>_recomb=<bool>_revcomp=<bool>
PCR history HDF5 files store enough structure to reconstruct sampled PCR molecules and inspect their lineages:
pcr_history.h5
templates/
ids
sequences
molecules/
mol_<n>/
attrs: parent_template_id, copy_count, total_mutations
segments
events/
seg_<n>/
substitutions
deletions
insertions
Use --seed or global.seed to make stochastic stages reproducible. Use
--threads or global.threads to control multiprocessing where supported.
Citation TBD.
