nf-core ampliseq
Amplicon sequencing analysis, from reads to ASVs, taxonomy and diversity: a native port of nf-core/ampliseq 3.1.0.
by Temple Compute
W-55 · nf-core/ampliseq (native port)
Amplicon sequencing analysis, from reads to ASVs, taxonomy and diversity: a native port of nf-core/ampliseq 3.1.0.
Domain: nf-core ports
Overview
Runs the route nextflow run nf-core/ampliseq -r 3.1.0 -profile test,docker takes, as Horus tasks with the same containers, rendered command lines and per-process cpus/memory: Cutadapt primer trimming, DADA2 quality profiles, automatic truncation, filtering, error models, denoising and chimera removal, VSEARCH clustering, decontam, Barrnap SSU and length filters, DADA2 (GTDB R07-RS207) and QIIME2 (Greengenes 85%) classification, QIIME2 filtering, barplots, abundance tables, alpha and beta diversity, ANCOM-BC and ANCOM-BC2, phyloseq and TreeSummarizedExperiment objects, MultiQC and the summary report. The workflow has 86 tasks, 23 of them maps.
workflow.yaml is generated by scripts/gen_workflow.py from the harvested Nextflow run (spec.json, tc-os scripts/bench/nfcore/ampliseq/). Each task links its inputs under the names Nextflow staged them as, runs the process's rendered .command.sh verbatim with the pipeline's process.shell (bash -C -e -u -o pipefail) or Rscript, and removes the links again. Per-sample, per-run, per-read-direction and per-metadata-column steps are horus_map stages; the values that differ per slot (sample id, run, direction, column, formula) are @NAME@ placeholders filled in from the slot's meta file. The Groovy channel logic runs as two small tasks: stage_inputs (samplesheet checks, runs, the decontam metadata) and decide (the diversity and ANCOM fan-outs from METADATA_ALL and METADATA_PAIRWISE).
Variants
workflow.chained.yaml(scripts/gen_workflow.py --chained): maps over the same items in sequence (per sample, per run, per ANCOM column) setchain: true, so an item moves to its next step without waiting for the others, with the same commands and outputs. Needs horus-runtime 0.9.0 or later.
Pipeline
stage_inputs samplesheet, metadata, GTDB and Greengenes files ──► work/reads/, samples/, runs/, directions/, reference/
fastqc[*], cutadapt[*] per sample ──► results/fastqc/, results/cutadapt/
dada2_quality1[*], trunclen[*] per direction (FW, RV) ──► truncation lengths
dada2_filtntrim[*] per sample; dada2_quality2[*] per direction
dada2_err[*], dada2_denoising[*], dada2_rmchimera[*], dada2_stats[*] per run
dada2_merge ──► ASV table and sequences
vsearch_cluster, filter_clusters, decontam, barrnap, filter_ssu, filter_len_asv (+ merge_stats after each)
format_taxonomy, cutadapt_taxonomy, dada2_taxonomy, dada2_addspecies GTDB R07-RS207
format_taxonomy_qiime, qiime2_extract, qiime2_train, qiime2_classify Greengenes 85%
filter_samples, qiime2_inasv/intax/inseq, tablefiltertaxa, seqfiltertable, exports, barplots
metadata_all, metadata_pairwise, decide ──► work/lists/<fan-out>/
qiime2_tree, alpha_rarefaction, diversity_core, diversity_{alpha,beta,betaord,adonis}[*]
filtersamples_ancom[*], ancombc_{asv,tax}[*], ancombc2_{asv,tax}[*], ancombc(2)_formula_{asv,tax}[*]
summary tables, parquet, phyloseq, TreeSummarizedExperiment, multiqc, summary_report
Inputs / Outputs
- Input:
examples/Samplesheet_v3.tsv, the test profile samplesheet (sample,fastq_1,fastq_2,quant_reading; 4 paired-end samples, reads downloaded from nf-core/test-datasets). Optionalrunandcontrolcolumns as in nf-core/ampliseq. Decontam always runs (--decontam decontaminate), so at least one row needsquant_readingorcontrol; without themstage_inputsstops with nf-core's error. - Input: the metadata file and the GTDB R07-RS207 and Greengenes 85% reference files, as URLs. Set
input_mirrorto a folder with local copies to skip the downloads. results/dada2_merge/:ASV_table.tsv,ASV_seqs.fasta,DADA2_table.tsv,DADA2_stats.tsv.results/dada2_addspecies/,results/qiime2_classify/: DADA2 and QIIME2 taxonomy tables.results/merge_stats_filtertaxa/overall_summary.tsv: read and ASV counts through every filter step.results/export_*,results/diversity_*,results/ancombc*: QIIME2 abundance tables, diversity and differential abundance.results/summary_table_*,results/duckdb_*,results/phyloseq_*,results/tse_*: summary tables (tsv.gz and parquet) and R objects.results/multiqc/,results/summary_report/: the MultiQC report and the pipeline's summary report.
The DADA2 ASV tables and statistics, VSEARCH, decontam, Barrnap and length filters, the read counts through every step, the QIIME2 classification and abundance tables, the FastQC data and the MultiQC general statistics match the Nextflow run, locally byte for byte and on a cloud node up to the last digits of some floats (QIIME2 and decontam on another CPU). The DADA2 assignTaxonomy bootstrap varies between runs of the same command (4 threads, also when Nextflow's own script is rerun), so 1 to 5 of 241 rank calls near the 50% cutoff differ; the rarefied diversity metrics are random in every run (no seed). ANCOM-BC's (Intercept) depends on the host (Nextflow itself on the production node gives this port's value there); its group effects, ANCOM-BC2 and the average barplots match. QIIME2 exports tables in no fixed row order. The MultiQC report has no software versions, workflow summary or methods sections, which nf-core builds from Nextflow run metadata. Taxonomy is assigned in one chunk (up to 10000 ASVs); the task stops on larger inputs.
Parameters
| id | Default | Meaning |
|---|---|---|
| samplesheet | examples/Samplesheet_v3.tsv | Samples and their reads (--input) |
| metadata_url | test profile Metadata.tsv | Sample metadata (--metadata) |
| dada_ref_urls | GTDB R07-RS207 SSU files | --dada_ref_taxonomy gtdb=R07-RS207 |
| qiime_ref_urls | Greengenes 85% files | --qiime_ref_taxonomy greengenes85 |
| input_mirror | empty | Folder searched by file name before downloading |
The other test profile parameters (primers, --max_len_asv 255, --filter_ssu bac, --min_frequency 10, --min_samples 2, the ANCOM-BC formulas and --qiime_adonis_formula) are in the rendered commands and in decide's arguments.
References
- nf-core/ampliseq: https://nf-co.re/ampliseq/3.1.0 and https://github.com/nf-core/ampliseq (MIT; bin/ scripts and report assets in
nfcore/) - Straub et al. (2020), Front Microbiol 11:550420, https://doi.org/10.3389/fmicb.2020.550420
- DADA2: Callahan et al. (2016), Nat Methods 13:581, https://doi.org/10.1038/nmeth.3869
- QIIME 2: Bolyen et al. (2019), Nat Biotechnol 37:852, https://doi.org/10.1038/s41587-019-0209-9
- Cutadapt: Martin (2011), EMBnet.journal 17(1):10, https://doi.org/10.14806/ej.17.1.200
- MultiQC: Ewels et al. (2016), Bioinformatics 32(19):3047, https://doi.org/10.1093/bioinformatics/btw354
- nf-core: Ewels et al. (2020), Nat Biotechnol 38:276, https://doi.org/10.1038/s41587-020-0439-x