Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2f57c13
refactor: move bam_flags, cpp_rng and preseq into src/common/
BenjaminDEMAILLE Aug 28, 2026
f4721a2
refactor: move bam_stat and the samtools writers into src/common/
BenjaminDEMAILLE Aug 28, 2026
6d57f5f
refactor: lift BamStatAccum into src/common/bam_stat_accum.rs
BenjaminDEMAILLE Aug 28, 2026
c3f8c64
docs: describe the src/common module split
BenjaminDEMAILLE Aug 28, 2026
701ea6d
test: guard the rna re-export shims against silent breakage
BenjaminDEMAILLE Aug 28, 2026
8a9ab64
test: add the DNA test dataset and its reference outputs
BenjaminDEMAILLE Aug 28, 2026
d72dcf2
feat(cli): add the dna subcommand surface
BenjaminDEMAILLE Aug 28, 2026
9db53ea
feat(config): add the dna configuration section
BenjaminDEMAILLE Aug 28, 2026
7143c6d
feat(dna): add the per-contig depth accumulator
BenjaminDEMAILLE Aug 28, 2026
e64cfd9
feat(dna): correct mate overlaps in the depth engine
BenjaminDEMAILLE Aug 28, 2026
726bfbf
feat(dna): add the mosdepth-compatible output writers
BenjaminDEMAILLE Aug 28, 2026
11190bb
feat(dna): wire up the run_dna pipeline
BenjaminDEMAILLE Aug 28, 2026
4198359
feat(dna): add the DNA JSON summary block and citations
BenjaminDEMAILLE Aug 28, 2026
10e711a
docs: describe the dna subcommand in AGENTS.md and the changelog
BenjaminDEMAILLE Aug 28, 2026
38abe05
feat(dna): write the .csi companion indexes, cite the samtools versio…
BenjaminDEMAILLE Aug 28, 2026
d4a0cc2
feat(dna): reimplement Picard CollectInsertSizeMetrics
BenjaminDEMAILLE Aug 28, 2026
42263a0
feat(dna): reimplement Picard CollectWgsMetrics
BenjaminDEMAILLE Aug 28, 2026
9cf0784
feat(dna): reimplement Picard CollectGcBiasMetrics
BenjaminDEMAILLE Aug 28, 2026
d5d4d89
feat(dna): add targeted mode and Picard CollectHsMetrics
BenjaminDEMAILLE Aug 28, 2026
a96e30c
docs: add the DNA pages and the dna CLI reference
BenjaminDEMAILLE Aug 28, 2026
fc1a045
feat(dna): reimplement Qualimap bamqc
BenjaminDEMAILLE Aug 28, 2026
907b328
feat(protein): add the protein subcommand and its sequence mode
BenjaminDEMAILLE Aug 28, 2026
a5a19c6
fix(protein): N50_num counts distinct lengths, not sequences
BenjaminDEMAILLE Aug 29, 2026
347c8ee
feat(protein): add the spectra mode for mass spectrometry QC
BenjaminDEMAILLE Aug 28, 2026
5773060
feat(reads): add raw FASTQ quality control
BenjaminDEMAILLE Aug 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 58 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,51 @@ src/
config.rs — YAML configuration loading (serde), nested tool configs
io.rs — Shared I/O utilities (gzip-transparent file reading)
gtf.rs — GTF annotation file parser (with configurable attribute extraction)
common/
mod.rs — Re-exports the shared modules
bam_flags.rs — BAM flag constants and aux-tag helpers
bam_stat.rs — bam_stat.py reimplementation, result types
bam_stat_accum.rs — Read-level counter accumulator feeding bam_stat and samtools
cpp_rng.rs — C++ RNG FFI shim for preseq bootstrap reproducibility
preseq.rs — preseq lc_extrap library complexity extrapolation
samtools/
mod.rs — Re-exports the samtools writers
stats.rs — samtools stats full output (SN + all histogram sections)
flagstat.rs — samtools flagstat-compatible output
idxstats.rs — samtools idxstats-compatible output
dna/
mod.rs — Re-exports the DNA submodules
depth.rs — Per-contig depth accumulator (delta array, CIGAR walk,
mate-overlap correction, prefix sum)
gc_bias.rs — Picard CollectGcBiasMetrics reimplementation
hs_metrics.rs — Picard CollectHsMetrics reimplementation (targeted mode)
insert_size.rs — Picard CollectInsertSizeMetrics reimplementation
intervals.rs — BED interval parsing and merging for targeted mode
qualimap.rs — Qualimap bamqc accumulation (windows, coverage, composition)
qualimap_output.rs — genome_results.txt, the raw data tables and the HTML report
wgs_metrics.rs — Picard CollectWgsMetrics reimplementation
mosdepth/
mod.rs — Per-contig summarisation feeding the mosdepth outputs
output.rs — The six mosdepth-compatible writers (bgzf for the BED outputs)
reads/
mod.rs
fastq.rs — Streaming FASTQ reader
metrics.rs — Read-level metrics (seqkit and FastQC conventions)
output.rs — seqkit stats table and fastqc_data.txt
protein/
mod.rs
sequence/
mod.rs — FASTA parsing into per-sequence records
stats.rs — Length statistics reproducing seqkit stats -a
defects.rs — Internal stops, non-standard residues, duplicates
output.rs — The seqkit-compatible table and the RustQC report
spectra/ — behind the `proteomics` cargo feature
mod.rs — mzML reading via mzdata
metrics.rs — Per-run and per-level spectrum metrics
output.rs — The run report
rna/
mod.rs — Re-exports all submodules (dupradar, featurecounts, rseqc, bam_flags, cpp_rng, preseq, qualimap)
bam_flags.rs — BAM flag constants
cpp_rng.rs — C++ RNG FFI shim for preseq bootstrap reproducibility
mod.rs — Re-exports the RNA submodules (dupradar, featurecounts, rseqc, qualimap)
and re-exports the shared ones from `common` for compatibility
dupradar/
mod.rs — Re-exports counting, dupmatrix, fitting, plots
counting.rs — BAM read counting engine (largest module)
Expand All @@ -75,7 +116,6 @@ src/
featurecounts/
mod.rs — Re-exports output
output.rs — featureCounts-format output & biotype counting
preseq.rs — preseq lc_extrap library complexity extrapolation
qualimap/
mod.rs — Re-exports all Qualimap modules
accumulator.rs — Gene body coverage accumulation logic
Expand All @@ -88,17 +128,13 @@ src/
mod.rs — Re-exports all RSeQC modules + common helpers
accumulators.rs — Shared RSeQC accumulator infrastructure (read dispatch)
common.rs — Shared junction/intron extraction, from_genes builders
bam_stat.rs — bam_stat.py reimplementation
flagstat.rs — samtools flagstat-compatible output
idxstats.rs — samtools idxstats-compatible output
infer_experiment.rs — infer_experiment.py reimplementation
inner_distance.rs — inner_distance.py reimplementation
junction_annotation.rs — junction_annotation.py reimplementation
junction_saturation.rs — junction_saturation.py reimplementation
plots.rs — RSeQC plot generation (duplication, junctions, etc.)
read_distribution.rs — read_distribution.py reimplementation
read_duplication.rs — read_duplication.py reimplementation
stats.rs — samtools stats full output (SN + all histogram sections)
tin.rs — TIN (Transcript Integrity Number) analysis
tests/
integration_test.rs — 12 integration tests vs R dupRadar reference output
Expand All @@ -107,13 +143,23 @@ tests/
create_test_data.R — R script to regenerate test data + references
```

Nested module structure — top-level modules (`cli`, `config`, `io`, `gtf`, `rna`) declared
in `main.rs`, no `lib.rs`. The `rna` module contains sub-modules for each tool group.
Inter-module access uses `crate::` paths (e.g., `use crate::rna::dupradar::counting::GeneCounts;`).
Nested module structure. The library crate root is `src/lib.rs`, which declares
`common`, `config`, `cpu`, `gtf`, `io`, `rna` and `summary`; the binary
(`src/main.rs`) additionally declares `cli`, `citations` and `ui`.
Inter-module access uses `crate::` paths (e.g., `use crate::common::bam_stat_accum::BamStatAccum;`).
Assay-agnostic analyses belong in `common`; put new code under `rna` only if it
needs a gene annotation or a library strand protocol.

The CLI uses a single subcommand:
The CLI has two subcommands:

- `rustqc rna <BAM>... --gtf <GTF> [OPTIONS]`
- `rustqc dna <BAM>... [OPTIONS]`

The `dna` subcommand needs no annotation. It runs depth of coverage
(mosdepth-compatible), the samtools-compatible outputs and preseq in one pass,
with one worker per contig. Shared flags keep their `rna` names, short forms
and `RUSTQC_*` environment variables, with one deliberate exception:
`-Q/--mapq` defaults to 0 for `dna`, matching mosdepth, rather than 30.

A GTF gene annotation file (`--gtf`) is required. This runs all analyses:
dupRadar duplicate rate analysis, featureCounts-compatible gene counting,
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# RustQC Changelog

## Unreleased

### Features

- New `rustqc dna` subcommand for DNA (WGS) quality control: depth of coverage
with mosdepth-compatible outputs, samtools-compatible stats, flagstat and
idxstats, and preseq library complexity, all in a single pass over the
alignment with one worker per contig, plus Picard-compatible
CollectWgsMetrics, CollectInsertSizeMetrics and CollectGcBiasMetrics.
Passing `--targets` switches on targeted mode and Picard-compatible
CollectHsMetrics. Qualimap-compatible `bamqc` output rounds it out, with
`genome_results.txt`, the raw data tables and an HTML summary. Validated
against mosdepth 0.3.14, samtools 1.24, Picard 3.4.0 and Qualimap 2.3.

- New `rustqc reads` subcommand: raw FASTQ quality control before alignment,
reproducing `seqkit stats -a` exactly and four of FastQC's modules (per base
sequence quality, per sequence quality scores, per base sequence content and
per base N content).
- New `rustqc protein sequence` mode: protein FASTA quality control, with
length statistics reproducing `seqkit stats -a` exactly, plus amino acid
composition and defect detection (internal stop codons, non-standard
residues, duplicate sequences and identifiers) that seqkit does not report.
- New `rustqc protein spectra` mode: mass spectrometry run QC from mzML, with
per-level spectrum and peak counts, total ion current, retention time range
and precursor charge distribution. Behind the `proteomics` cargo feature,
which is on by default; `--no-default-features` drops it along with mzdata.

### Changed

- Internal: assay-agnostic analyses (BAM flag helpers, read-level statistics,
the samtools stats/flagstat/idxstats writers, preseq) moved from `rna` to a
new `common` module. The old `rustqc::rna::...` paths still resolve through
re-exports, so this is not a breaking change for library users.

## [Version 0.2.1](https://github.com/seqeralabs/RustQC/releases/tag/v0.2.1) - 2026-04-09

### Bug fixes
Expand Down
Loading