We present Trio-barcoded ONT Adaptive Sampling (TBAS), a cost-efficient long-read sequencing strategy combining sample barcoding and adaptive enrichment to sequence rare-disease trios on a single PromethION/P2 flow cell. TBAS achieved near-complete variant phasing and detection of small variants, structural variants, and tandem repeats with high accuracy and 77% potential solve rate. This scalable approach retains methylation data and enables clinically relevant, phenotype-guided long-read diagnostics at a fraction of current costs.
- The software pipeline entrypoint is
tbas-pipeline, implemented intbas_pipeline/. - The software version runs tools directly (no
sbatchgeneration). - The notebook
TBAS_pipeline_slurm.ipynbis kept as-is for historical/reference workflow. - The
analysis/folder contains downstream analysis notebooks organized by topic (SNV/Trio calling, coverage, methylation, tandem repeats, and variant counting). - Benchmarking materials and example HG002 results are provided under
benchmarking/, with data available at the Zenodo record below.
TBAS is not only a cheaper way to sequence trios — its analytical approach is co-designed with long-read sequencing (LRS) to extract signal that short-read trio pipelines cannot. Three points are novel:
-
Automated trio variant ranking (built into the pipeline). Small and structural variants are called per trio member and genotyped trio-aware (
kanpig trio), then annotated (ANNOVAR for SNVs, AnnotSV for SVs) and ranked by therank_snv/rank_svstages: a four-tier SNV system that combines allele frequency, REVEL/CADD, ClinVar, and the trio inheritance pattern (de novo, recessive, compound-heterozygous), plus pathogenic SV filtering. Because reads are natively phased on a single flow cell, compound-heterozygous and parent-of-origin calls are made directly instead of inferred. SeeMETHODS.mdfor the exact databases and tiering rules. -
DNA methylation from LRS as an independent marker of pathogenic expansions — including from adaptive-sampling rejected reads. TBAS preserves native 5mC/5hmC modification tags end to end (methylation tags are carried through read extraction and emitted as phased and unphased pileups by
modkit). Locus hypermethylation is then used as an orthogonal signal for repeat-expansion disorders even where the expansion is not fully spanned. To our knowledge this is the first approach to combine LRS methylation with adaptive sampling to flag pathogenic expansions such as NAXE and DIP2B, notably by recovering methylation signal from reads that adaptive sampling rejected (unblocked/off-target) rather than discarding them (worked examples inanalysis/methylation/). -
Trio-aware tandem-repeat length comparison. Long reads span full repeat alleles, so
medaka tandemresolves per-sample allele lengths andtdbcollates the proband and both parents into one database. This lets the pipeline compare repeat length across the trio directly and flag a proband allele that is expanded relative to the parents (de novo expansion or further somatic/germline expansion) — a comparison prior tandem-repeat pipelines, built for single samples, did not make. See thepatho_ATN1_FGF14example (ATN1/DRPLACAG, FGF14/SCA27BGAA).
Together these turn TBAS's LRS strengths — native methylation, read phasing, full-length repeat spanning, and the trio structure itself — into diagnostic evidence, at a fraction of the cost of running trios on separate flow cells.
- Python 3.10+.
- Standard long-read analysis command-line tools used by the pipeline:
samtools,minimap2,sniffles,mosdepth,run_clair3.sh,kanpig,bedtools,bgzip,bcftools,whatshap,medaka,modkit,tdb.
The easiest way to get all of these is the bundled conda environment (see below), which installs the whole toolchain in one command.
- Install the external tools and the package into a single self-contained
environment. With micromamba (or swap
micromambaformamba/conda):
micromamba env create -f environment.yml
micromamba activate tbas
pip install -e .This one environment provides the entire toolchain (samtools, minimap2,
sniffles, mosdepth, Clair3, kanpig, bedtools, bcftools, whatshap, medaka,
modkit, tdb) — no separate per-tool envs or from-source builds. tdb installs
from GitHub via pip as declared in environment.yml. For a byte-for-byte
reproducible environment, create from the pinned environment.lock.yml instead.
Or, if the command-line tools are already on your PATH, just:
pip install -e .- Verify the toolchain is complete before running:
tbas-pipeline --manifest example_data/test_subset_chr22/manifest_example.csv --check-depsThis lists the tools required by the selected stages and reports any that are
missing from PATH. A real run also performs this check automatically and
aborts early if a tool is missing (pass --skip-dep-check to override).
- Create a manifest CSV/TSV with at least:
sample_id(example:4_6_Gregor_Trio)bed_file(example:Epilepsy,CMRG,WGS, or a direct BED path)proband_gender(used by medaka stages, example:female)
Optional columns:
calls_bam(explicit path tocalls*.bam; if omitted, the pipeline searches under<output_folder>/<sample_id>/calls*.bam)read_group_prefix(skip BAM-header inference during demultiplex stage)tr_bed_file(TR catalog BED formedaka_local; if omitted, the pipeline derives this frombed_filevia built-in mapping)
- Run a dry run starting from demultiplexing:
tbas-pipeline \
--manifest example_data/test_subset_chr22/manifest_example.csv \
--output-folder demo_output \
--stages demultiplex \
--dry-run- Run full pipeline:
tbas-pipeline \
--manifest example_data/test_subset_chr22/manifest_example.csv \
--output-folder demo_outputTwo real-data bundles under example_data/ (subsets of the 4_6_Gregor_Trio
sample) let you smoke-test the pipeline end to end:
example_data/test_subset_chr22/— CMRG genes onchr22:42.6-42.74 Mb. Exercises stages 1-16 fully;medaka_pathois skipped because this window contains no known pathogenic STR loci.example_data/patho_ATN1_FGF14/— windows around ATN1 (DRPLA,CAG) and FGF14 (SCA27B,GAA). These loci are in the pathogenic catalog, so this bundle also exercisesmedaka_pathoandtdbon real disease repeats.
Both runs need a GRCh38 reference, a Clair3 model directory, and the pathogenic
TR BED, passed via --reference, --clair3-model, and --adotto-pheno.
Default stage order:
demultiplexfastq_extractminimap2bam_sortsniffles_globalbam_mosdepthclair3_localkanpig_pileupkanpig_gtkanpig_triowhatshap_single_sample_local_phasingwhatshap_haplotagmedaka_localmedaka_pathomodkitmodkit_nohptdbmerge_trio_snv— merge the trio's small-variant VCFs (proband first)annovar— annotate small variants (ANNOVAR)rank_snv— tier and rank SNVs →<sample>.snv.ranked.tsvannotsv— annotate structural variants (AnnotSV)rank_sv— keep (likely) pathogenic SVs →<sample>_<barcode>.sv.pathogenic.tsvrank_tr— trio tandem-repeat comparison →<sample>.tr.trio_distinct.tsv
You can run a subset with --stages stage1,stage2,....
The annotation/ranking stages (18–23) turn raw calls into ranked candidates: an
ANNOVAR-based SNV tiering system, AnnotSV pathogenic SV filtering, and a
STRchive-restricted trio tandem-repeat comparison that flags proband repeat
alleles distinct from both parents. They need ANNOVAR (table_annovar.pl + a
humandb directory), AnnotSV, and a STRchive BED — configured via
--annovar-humandb, --annotsv-build, and --strchive-bed. See METHODS.md
for the exact databases, tiering rules, and filtering criteria.
TBAS_pipeline_slurm.ipynbis preserved and unchanged.- Use it as reference for the original SLURM-oriented workflow.
The analysis/ directory contains topic-focused notebooks and resources:
-
SNV/Trio calling
analysis/snv_trio_analysis.ipynb: downstream analysis notebook for small variants and trio evaluation.
-
Coverage
analysis/covearge/mosdepth_analysis.ipynb: coverage analysis with mosdepth.analysis/covearge/mosdepth_summary_totals.csv: example summary output.
-
Methylation
analysis/methylation/methylation_analysis.ipynb: methylation analysis notebook.analysis/methylation/*/: per-sample directories with supporting files.
-
Tandem repeats (TR)
analysis/tr/adaptive_sampling_tr_analysis.ipynb: TR analysis on adaptive sampling data.analysis/tr/tr_regions/: TR region catalogs used by the analysis, including:adotto_catalog.hg38.lite.*.bedstrchive/STRchive-disease-loci.hg38.bed
-
Variant counts
analysis/variant_counts/count_variants_by_barcode.shanalysis/variant_counts/count_variants_by_barcode_parallel.shanalysis/variant_counts/variant_counts.tsv
- Folder:
benchmarking/adaptive_methylation_benchmark.ipynb: methylation benchmarking notebook.benchmarking/hg002_variant_calls/: example HG002 variant call files and indices for reference.
Benchmarking data DOI: https://doi.org/10.5281/zenodo.17398577
If you use these materials, please reference the Zenodo record:
- TBAS benchmarking data: https://doi.org/10.5281/zenodo.17398577
This project is distributed under the terms of the license in LICENSE.