Skip to content

CLI Reference

RustQC provides a single rna subcommand that runs all RNA-Seq QC analyses in one pass over the BAM file.

RustQC CLI output

RNA-seq quality control: duplicate rate analysis (dupRadar equivalent), featureCounts-compatible read counting with biotype summaries, 8 RSeQC-equivalent tools (bam_stat, infer_experiment, read_duplication, read_distribution, junction_annotation, junction_saturation, inner_distance, TIN), Qualimap RNA-seq QC, preseq library complexity, and samtools-compatible outputs.

rustqc rna <INPUT>... --gtf <GTF> [OPTIONS]

One or more paths to coordinate-sorted, duplicate-marked alignment files. Accepted formats are SAM, BAM, and CRAM. A BAM/CRAM index (.bai / .csi) enables multi-threaded processing; without one, RustQC falls back to a single counting thread.

Multiple files can be passed and will be processed in parallel, with each file producing its own set of output files. Threads are divided evenly among concurrent jobs.

# Single file
rustqc rna sample.bam --gtf genes.gtf
# Multiple files
rustqc rna sample1.bam sample2.bam sample3.bam --gtf genes.gtf

Path to a GTF gene annotation file (plain or gzip-compressed). Required. The GTF must contain exon features with a gene_id attribute. Transcript-level structure (exon blocks, CDS features) is extracted automatically and used by all analyses: dupRadar, featureCounts, the RSeQC tools (including TIN), Qualimap, preseq, and samtools.

Gzip compression is detected automatically by inspecting the file header (magic bytes), so the .gz extension is not required.

Individual tools can be disabled via the configuration file.

Output directory for all result files. Created if it does not exist.

Default: . (current working directory)

-s, --stranded <unstranded|forward|reverse>

Section titled “-s, --stranded <unstranded|forward|reverse>”

Library strandedness for strand-aware read counting:

Value Meaning
unstranded Count reads on either strand
forward Forward stranded (read 1 maps to the transcript strand)
reverse Reverse stranded (read 2 maps to the transcript strand)

Default: unstranded

Enable paired-end mode. When set, read pairs are counted as a single fragment. Both mates must overlap the gene for the pair to be assigned.

Default: single-end mode

Number of threads for parallel processing. Parallelism is applied across chromosomes within each BAM file, so the effective speedup depends on the number of chromosomes with mapped reads.

Default: 1

Minimum mapping quality (MAPQ) threshold used by all RSeQC tools. Reads below this threshold are excluded from the “uniquely mapped” counts.

Default: 30

Path to a reference FASTA file. Required when using CRAM input files, as CRAM files store sequences relative to a reference.

Whether to regenerate the NM and MD tags on CRAM input. CRAM does not normally store them; htslib (and so samtools) rebuilds them from the reference while decoding, and RustQC does the same. Ignored for SAM and BAM input.

Mode Behaviour
auto Regenerate only what an enabled tool uses: NM for samtools stats (its mismatch count), NM and MD for the --split-bam-write-bams output BAMs. Nothing is computed when neither runs.
always Regenerate NM and MD on every mapped CRAM record that lacks them.
never Never regenerate them. samtools stats reports 0 mismatches and the split_bam BAMs carry no NM/MD.

Tags already present on a record are never changed. Unmapped records, records with no sequence, and records with no reference are left alone. Also settable as cram.decode_md in the config file.

Default: auto

Skip the validation that checks for duplicate-flagged reads in the BAM file. By default, RustQC verifies that reads have the duplicate flag (SAM flag 0x400) set during parsing and exits with an error if none are found.

Use this flag if you want to run on a file without duplicate marking for testing purposes.

Count multi-mapping reads (NH > 1) in the featureCounts gene and biotype outputs, like featureCounts -M: every reported alignment is counted instead of being reported as Unassigned_MultiMapping. dupRadar is not affected. Also settable as featurecounts.count_multi_mapping in the config file.

Assign reads that overlap several genes (or biotypes) to all of them, like featureCounts -O, instead of reporting them as Unassigned_Ambiguity. Also settable as featurecounts.count_multi_overlapping in the config file. See Multi-mapping and multi-overlapping reads.

GTF attribute name to use for biotype grouping in the featureCounts biotype output files.

  • Ensembl GTFs typically use gene_biotype
  • GENCODE GTFs typically use gene_type

If not specified, RustQC defaults to gene_biotype and auto-detects the attribute. If the specified attribute is not found in the GTF, a warning is printed and biotype counting is skipped.

Override the sample name used for output filenames. By default, the sample name is derived from the BAM file stem (e.g., sample.markdup.sorted.bam produces output files named sample.markdup.sorted.*).

When this flag is set, the provided name is used instead, so output files are named <NAME>.*. This is useful when a pipeline already knows the clean sample ID and wants output filenames to match, without relying on BAM filename conventions.

rustqc rna sample.markdup.sorted.bam --gtf genes.gtf --sample-name sample

Write all output files directly into the output directory instead of organizing them into subdirectories. By default, RustQC creates dupradar/, featurecounts/, rseqc/<tool>/, qualimap/, preseq/, and samtools/ subdirectories under the output directory. With --flat-output, all files are written to the top-level output directory.

This can also be set in the configuration file under the rna: section as flat_output: true.

Default: false (nested subdirectories)

Write a JSON summary of all QC results to the specified path. If no path is given, the summary is written to stdout. Use "-" explicitly for stdout.

Path to a YAML configuration file for advanced settings such as chromosome name mapping, per-output-file toggles, and enabling/disabling individual tools. See the Configuration page for the full reference.

Suppress all output except warnings and errors.

Show additional detail during processing.

These flags control parameters for specific RSeQC-equivalent analyses. Each tool runs by default as part of rustqc rna and can be disabled via the configuration file.

Option Default Description
--skip-tin false Skip the TIN (Transcript Integrity Number) analysis
--tin-seed <N> random Random seed for reproducible TIN results
--skip-read-duplication false Skip the read duplication analysis
Option Default Description
--infer-experiment-sample-size <N> 200000 Maximum number of reads to sample
Option Default Description
--min-intron <N> 50 Minimum intron size to consider (shared by both tools)
Option Default Description
--junction-saturation-seed <N> 42 Seed for the sampling shuffle (see below)
--junction-saturation-min-coverage <N> 1 Minimum reads for a junction to count as detected
--junction-saturation-percentile-floor <N> 5 Sampling start percentage
--junction-saturation-percentile-ceiling <N> 100 Sampling end percentage
--junction-saturation-percentile-step <N> 5 Sampling step percentage

The intermediate sampling points come from RustQC’s own seeded RNG: they are reproducible for a given seed, but do not match RSeQC’s random draws. The x-axis values and the 100% point match RSeQC. See junction_saturation.

Option Default Description
--inner-distance-sample-size <N> 1000000 Maximum read pairs to sample
--inner-distance-lower-bound <N> -250 Histogram lower bound
--inner-distance-upper-bound <N> 250 Histogram upper bound
--inner-distance-step <N> 5 Histogram bin width

split_bam only runs when a BED file is given. See split_bam.

Option Default Description
--split-bam-bed <BED> none BED12 of regions (e.g. rRNA) to classify alignments against
--split-bam-write-bams false Also write .in.bam, .ex.bam and .junk.bam (one extra pass)

These flags control parameters for the preseq library complexity extrapolation. Preseq runs by default and can be skipped entirely with --skip-preseq.

Option Default Description
--skip-preseq false Skip the preseq library complexity analysis entirely
--preseq-max-extrap <N> 1e10 Maximum extrapolation depth in total reads
--preseq-step-size <N> 1e6 Step size between extrapolation points
--preseq-n-bootstraps <N> 100 Number of bootstrap replicates for confidence intervals
--preseq-seed <N> 408 Random seed for bootstrap reproducibility
--preseq-seg-len <N> 100000000 Maximum merged PE fragment length in bp

Code Meaning
0 Success
1 Error (missing input, invalid arguments, BAM processing failure, etc.)

Error messages are printed to stderr with context about the failure.