Robust tRNA modification discovery from Nanopore direct tRNA sequencing
If you use QutRNA2, please cite: https://doi.org/10.1093/nargab/lqag065
QutRNA2 compares two conditions, position by position:
- Reads are mapped with gpu-tRNA-mapper, up to 25x faster than the previously used mapper parasail.
- Adapter-overlapping and multimapping alignments are removed, as are alignments that score no better than alignments to a reversed reference.
- Mismatches, deletions, and insertions are scored with JACUSA2.
- Each site's JACUSA2 score is corrected with a permutation test to report a normalized score, plus a Benjamini-Hochberg False Discovery Rate (FDR) from the p-value.
The container image is the recommended way to run QutRNA2. Every tool and version is fixed in it.
- Get the code and build the image.
Building needs root or
git clone https://github.com/dieterich-lab/QutRNA2 cd QutRNA2 singularity build --fakeroot qutrna2.sif singularity/qutrna2.def
--fakeroot. Some HPC clusters do not allow--fakeroot; build on another machine and copy the image over. - Copy the examples. Edit them as described under Configuration.
cp examples/analysis/map_with_gpu.yaml my_analysis.yaml cp examples/data/data_auto.yaml my_data.yaml cp examples/sample_table_fastq.tsv my_samples.tsv
- Do a dry run. It checks the configs and lists the jobs.
--bindmust cover your data.singularity run --nv --bind <DATA_DIR> qutrna2.sif snakemake -n -c 1 --snakefile workflow/Snakefile --configfiles my_analysis.yaml --config pepfile=my_data.yaml --directory my_run - Run it. Drop
-n, and set-cto your number of cores. - Open
my_run/results/report/report.html.
- Singularity or Apptainer, or conda (see Run QutRNA2).
- An NVIDIA GPU, Volta or newer. See the hardware requirements.
- Without a GPU, use
examples/analysis/map_with_parasail.yaml. Reads are then mapped on the CPU, much more slowly.
A run needs three files.
| file | content | template |
|---|---|---|
| sample table | one row per FASTQ or BAM file | examples/sample_table_fastq.tsv |
| data YAML | reference, linkers, contrasts, Sprinzl setup | examples/data/*.yaml |
| analysis YAML | mapper, filters, JACUSA2, extra heatmaps | examples/analysis/*.yaml |
Sample table:
- The columns are
condition,sample_name,subsample_name,base_callingandfastq(orbam). fastqis a gzipped FASTQ file.- Set
base_callingtopass. It is a legacy column. - Rows with the same
sample_nameare pooled into one sample, e.g. FASTQ parts of one run. - Samples with the same
conditionare its replicates in JACUSA2 and the permutation test. - For mapped reads, use
bam(templateexamples/sample_table_bam.tsv) with the analysis templateexamples/analysis/existing_mapping.yaml.
Data YAML:
ref_fasta.fileis the tRNA reference, linkers included. For example, from GtRNAdb.- Set
linker5andlinker3to the adapter lengths in your reference. - Wrong linker lengths shift every coordinate.
contrastslists the condition pairs to compare.
Analysis YAML:
alignment.methodisgpuorparasail.- Commands to run before mapping go in
gpu.pre, e.g. loading a CUDA module. gpu.binandjacusa2.jarare the tool paths, if they are not on your PATH.- The filters are switched on under
filter: random alignments, adapter overlap (5' and 3' linkers), multimappers. - Random alignments: reads are also aligned to a reversed reference. The cutoff is the lowest score at which at least
alignment.precision(default 0.999) of the kept alignments are to the forward reference.
- Read-count, read-length and heatmap plots are added under
plots.
Each plots.heatmap entry is one normalized heatmap per contrast. Its options are commented in examples/analysis/map_with_gpu.yaml.
All options and their defaults are in workflow/schemas/config.yaml and workflow/schemas/pep.yaml.
| approach | data YAML key | template |
|---|---|---|
| automatic, with sprinx (recommended) | sprinzl.scheme |
data_auto.yaml |
| your own covariance model | sprinzl.cm, sprinzl.labels |
data_cm.yaml |
| an aligned FASTA | sprinzl.afasta |
data_afasta.yaml |
| a sequence-to-Sprinzl table | sprinzl.seq_to_sprinzl |
data_seq_to_sprinzl.yaml |
schemeiseuk,arch,bactormito.mitoallows for tRNAs that lost an arm.- Default models come with sprinx. Override them with
sprinzl.mito.canonical_cmandsprinzl.mito.armless_cm_dir(formito), orsprinzl.cyto.cyto_cm_db. - The amino acid and anticodon are read by sprinx from each tRNA ID. The ID is the header up to the first space.
- The ID must have the form
id|aa|anticodon|taxon, or a GtRNAdb-style name liketRNA-Ala-TGC. - Rename mitochondrial gene symbols. For example,
mt-Tabecomesmt-tRNA-Ala-TGC. - Every ID is checked before the run starts.
ignore_trnasis a regex of tRNAs to leave out of Sprinzl labelling. They then drop out of the plots. Use^mt-for a nuclear run.- The plotted labels and their order are set in
sprinzl.labels. A-drops a position.
Bundled files:
data/TRNAinf-euk.cm(from tRAX) withdata/nuclear-euk-masked.txt, for eukaryotic nuclear tRNAs, as in the paper.data/human_mt_seq_to_sprinzl.tsv, for human mt-tRNAs (Suzuki et al. 2020). Its plotted labels are indata/human_mt_sprinzl_labels.txt.- More covariance models are in tRNAscan-SE.
Container (recommended). Download the image from Zenodo (if using v2.0.0 as in our manuscript), or build it (later versions):
singularity build --fakeroot qutrna2.sif singularity/qutrna2.def singularity run --nv --bind <DATA_DIR> qutrna2.sif snakemake --cores <N> --snakefile workflow/Snakefile --configfiles my_analysis.yaml --config pepfile=my_data.yaml --directory my_run
--nvmakes the GPU available in the container.--bindmust cover every path in your configs.
Conda. Create the environment, then run the same Snakemake command with --use-conda:
conda env create -f conda.yaml -n qutrna2 conda activate qutrna2 snakemake --cores <N> --use-conda --snakefile workflow/Snakefile --configfiles my_analysis.yaml --config pepfile=my_data.yaml --directory my_run
Cluster. There are two options:
- Submit the command above as one job. Add
--executor local: the job already has its resources, and Snakemake runs the rules inside it. Set--coresto the job's CPUs (e.g.$SLURM_CPUS_ON_NODE). - Or let Snakemake submit each rule, with a profile.
workflow/profile/slurm-cluster/is a SLURM example. Partitions, accounts and threads go in the profile.
All paths are inside the run directory (--directory). Each contrast gets its own folders. For example, for wt against KO:
results/jacusa2/cond1~wt/cond2~KO/bam~final/ JACUSA2.out, score tables, permutation.tsv
results/plots/normalized/cond1~wt/cond2~KO/bam~final/ normalized_heatmap.pdf, all tRNAs
results/plots/normalized/cond1~wt/cond2~KO/<id>/bam~final/ normalized_heatmap.pdf, one per plots.heatmap entry
results/plots/scores/cond1~wt/cond2~KO/<id>/bam~final/ one folder per entry with subsampled: true
| path | content |
|---|---|
results/report/report.html |
heatmaps, read counts, configs, versions and file paths |
results/bam/{mapped,filtered-*,final}/ |
alignments per filter step, by sample and subsample |
results/stats/ |
read counts, lengths and alignment scores per filter step |
results/ss/seq_to_sprinzl_filtered.tsv |
the Sprinzl mapping used |
results/cmalign/align.stk |
the structure alignment, with a covariance model |
results/data/ |
the processed reference |
data/ |
the inputs, as the run read them |
logs/, info/ |
job logs, configs and versions |
The report has five tabs:
- Overview: run directory, configs, filters, sample table, tool versions and commits.
- Preprocessing: read counts and lengths after each filter.
- Results: one sub-tab per contrast. First the normalized heatmap of all tRNAs, then one per
plots.heatmapentry. - Files: paths to BAMs, score tables, permutation tables and all plots, including those the report does not show.
- Configuration: the YAML files of the run.
Images are embedded. The file is self-contained and can reach tens of MB.
- At each position, the reads of all replicates are pooled.
- They are dealt back at random. Each replicate keeps its depth.
- Each permutation is scored like the data.
- A tile's colour is the observed score minus the highest permuted score. It is summed over mismatches, deletions and insertions.
- The p value is the share of permutations that score at or above the data.
- One Benjamini-Hochberg correction is applied over all three error types. Three FDRs are given per position: mismatch, deletion and insertion.
- A position is called when any of its three FDRs is below
jacusa2.fdr(default 0.05). Called positions are drawn as large tiles. - The number of permutations is set in
jacusa2.permutation.

