← Back to ToolsScientific software · 16S rRNA
ASVFlow logo

Amplicon sequencing pipeline

ASVFlow:Amplicon Sequencing Pipeline

A modular Nextflow workflow for paired-end 16S reads, from quality control and DADA2 ASV inference to optional taxonomy, community analysis, and phylogeny.

Paired-end 16SNextflow DSL2DADA2Interactive results

The current implementation and fixtures target bacterial 16S rRNA; ITS support is not established.

ASVFlow Live · Run overviewResults view
ASVFlow dashboard overview with selected run status and quick access to analysis pages

Module 01 · Installation

Setup & Installation

Get ASVFlow installed and ready: prepare the Linux environment, clone the workflow, fetch its containers and references, then confirm the configured defaults.

01

Installation step 01

System prerequisites

The workflow targets paired-end bacterial 16S rRNA data and documents Linux execution with Apptainer or Singularity. Keep network access available while downloading images and SILVA references.

RequirementPurpose
x86_64 LinuxThe provided container images are x86_64 builds.
Java 11 or newerRuns Nextflow.
Current Nextflow with DSL2Coordinates the pipeline. Install from the official Nextflow instructions and verify with nextflow -version.
Apptainer or SingularityRequired container runtime; nextflow.config enables Singularity and automatic mounts.
curlUsed by bin/download_tools.sh to fetch SILVA files.
Linux host utilitiesThe workflow uses containers for scientific packages. The optional dashboard launcher additionally uses Bash, Python 3, setsid, GNU stat and curl; ss or lsof helps check ports.
Install Nextflow and Java +

ASVFlow does not install Java or Nextflow. Follow the official install steps for your Linux environment, then confirm both are available in the shell used for the run.

Official Nextflow installation guide ↗
02

Installation step 02

Clone the repository

Terminal
git clone https://github.com/Kpmurshid/ASVFlow.git
cd ASVFlow

The project root contains main.nf and nextflow.config. DSL2 processes live under modules/, helper scripts under bin/, container definitions under containers/, and the results viewer under dashboard/. Setup creates tools/ and databases/silva/.

Repository map +
  • main.nf: workflow wiring
  • nextflow.config: defaults, runtime and resources
  • modules/: QC through optional analyses
  • bin/: setup and validation scripts
  • containers/: selected project image definitions
  • dashboard/: Streamlit results viewer
03

Installation step 03

Configure the runtime and fetch containers

Nextflow assigns container images to individual processes. The configuration enables Singularity execution and automatic mounts; Apptainer is compatible with this setup. The supported setup script pulls pinned images into tools/.

Terminal
./bin/download_tools.sh

The script needs Apptainer or Singularity, curl, network access and disk space. It pulls DADA2, Cutadapt, FastQC, MultiQC, statistics, dashboard, MAFFT and FastTree images, plus auxiliary report and SeqKit images. MAFFT and FastTree serve the optional phylogeny workflow. Existing non-empty images are skipped.

04

Installation step 04

Install SILVA references

The same ./bin/download_tools.sh command downloads the default SILVA v144 files to databases/silva/144/ and validates checksums and gzip integrity. Taxonomy is optional; the genus reference is only required when taxonomy runs. The species assignment reference is additionally required only when species addition is enabled.

v144 referenceUse
silva_nr99_v144_toGenus_trainset.fa.gzRequired for genus classification when taxonomy is enabled.
silva_v144_assignSpecies.fa.gzRequired only for optional species assignment.
silva_nr99_v144_toSpecies_trainset.fa.gzDownloaded by setup but not consumed by the current workflow parameter path.

Automatic filename resolution is implemented for v144 and v138.1. The setup script downloads v144 only. For v138.1, the expected files are silva_nr99_v138.1_train_set.fa.gz and (for species) silva_species_assignment_v138.1.fa.gz under databases/silva/138.1/. Other versions need explicit reference paths when configuring a run.

05

Installation step 05

Confirm the initial configuration

Defaults live in nextflow.config. The workflow uses tools/ and databases/ under the project by default. DADA2 is enabled; taxonomy, community analysis, phylogenetic analysis and the dashboard are disabled. Paired primer removal is the default, so a run must supply both primer sequences unless you set --primer_mode none.

Terminal
./bin/validate_environment.sh

This validates the installed runtime, downloaded images and bundled example FASTQs; it does not install missing software. Set per-analysis options on the Nextflow command line as described in the Usage Guide.

Module 02 · Running analyses

Usage Guide

Learn how to prepare paired FASTQ inputs, choose analysis options, run ASVFlow, monitor execution and interpret the results from a completed workflow.

01

Usage step 01

Prepare FASTQ inputs and a samplesheet

Provide one row for each sample, with matching forward (R1) and reverse (R2) FASTQ files. The exact CSV header and order are sample_id,fastq_1,fastq_2. Paths are resolved relative to the directory where Nextflow is launched; both files must exist and gzip-compressed files must pass integrity checks.

ColumnMeaning
sample_idUnique sample name; used to match optional metadata.
fastq_1Forward R1 FASTQ path.
fastq_2Matching reverse R2 FASTQ path.
Terminal
sample_id,fastq_1,fastq_2
SAMPLE01,data/SAMPLE01_R1.fastq.gz,data/SAMPLE01_R2.fastq.gz
SAMPLE02,data/SAMPLE02_R1.fastq.gz,data/SAMPLE02_R2.fastq.gz
Terminal
python3 bin/validate_samplesheet.py samplesheet.csv

Optional metadata can be CSV or TSV, with a sample_id or sampleid column matching the samplesheet. Other columns describe sample variables and can support PERMANOVA.

Terminal
sample_id,group
SAMPLE01,control
SAMPLE02,treated
02

Usage step 02

Choose parameters for this run

Pass overrides as --parameter value on the Nextflow command. These are the important defaults from nextflow.config:

SettingDefault / behavior
Primersprimer_mode=paired; paired mode requires --primer_fwd and --primer_rev. --primer_mode none skips Cutadapt. Cutadapt defaults: error rate 0.1, overlap 3, min length 50, discard untrimmed pairs.
DADA2run_dada2=true. trunc_len_f/r=0; max_ee_f/r=2; trunc_q=2; max_n=0; min_len=50; rm_phix=true; low-complexity filter off; pooling false.
Taxonomyrun_taxonomy=false; silva_version=144; genus classifier reference resolves automatically for v144/v138.1. Species addition is off and needs its assignment reference.
Communityrun_community_analysis=false; requires DADA2. PERMANOVA needs metadata; composition needs a taxonomy table.
Phylogenyrun_phylogenetic_analysis=false; requires DADA2. Faith’s PD and weighted/unweighted UniFrac require community analysis too.
Outputs--outdir defaults to results. --taxonomy_table may provide an existing taxonomy TSV for community analysis.
Dashboardenable_dashboard=false; dashboard_port=8501; dashboard_bind_address defaults to 127.0.0.1 and accepts --dashboard_bind_address or DASHBOARD_BIND_ADDRESS.
Use a non-default SILVA reference +

Known versions 144 and 138.1 resolve filenames automatically. For another version, set --silva_genus_ref; if species addition is requested, also set --silva_species_ref.

03

Usage step 03

Run a basic analysis

This runs raw and post-primer quality checks, paired Cutadapt trimming and the default DADA2 ASV workflow. Replace the example primer sequences with those used by your assay.

Terminal
nextflow run main.nf \
  --sample_sheet samplesheet.csv \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --outdir results/basic_run
04

Usage step 04

Add optional taxonomy

Taxonomy is off by default. Enable the DADA2 genus classifier using the downloaded SILVA v144 reference. For species-level addition, also enable the species option; it requires the species assignment reference and exact matches, so few or no ASVs may receive a species label.

Terminal
nextflow run main.nf \
  --sample_sheet samplesheet.csv \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --run_taxonomy true \
  --silva_version 144 \
  --outdir results/taxonomy_run
Optional species-level classification +

Add --taxonomy_add_species true alongside taxonomy and ensure the species assignment reference is present. Exact matching can be reduced when primer bases remain in reads with --primer_mode none.

05

Usage step 05

Run community analysis

Community analysis includes alpha and Bray–Curtis/Jaccard beta diversity and sequencing-depth summaries. Metadata is optional, but is needed for PERMANOVA. Taxonomic composition is available when taxonomy data is provided.

Terminal
nextflow run main.nf \
  --sample_sheet samplesheet.csv \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --run_community_analysis true \
  --sample_metadata metadata.tsv \
  --outdir results/community_run
06

Usage step 06

Run phylogenetic analysis

Phylogenetic analysis extracts non-chimeric representative sequences, aligns them with MAFFT and infers a Newick tree with FastTree when multiple sequences are available. Enable community analysis as well to calculate Faith’s PD and weighted/unweighted UniFrac.

Terminal
nextflow run main.nf \
  --sample_sheet samplesheet.csv \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --run_community_analysis true \
  --run_phylogenetic_analysis true \
  --sample_metadata metadata.tsv \
  --outdir results/phylo_run
07

Usage step 07

Open the dashboard and monitor execution

Nextflow reports process progress and workflow status in the terminal. Each invocation writes an execution trace, HTML report and timeline under OUTDIR/.asvflow_dashboard/artifacts/<invocation-id>/. The directory is used for run artifacts even when the live dashboard is disabled.

Terminal
nextflow run main.nf -resume \
  --sample_sheet samplesheet.csv \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --outdir results/basic_run

Resume with the same parameters and retained Nextflow work directory. To launch the results viewer after a run:

Terminal
./bin/launch_dashboard.sh results/basic_run 8501

Open http://localhost:8501 on the same machine. The default bind address is loopback. You can instead start it as part of a workflow with --enable_dashboard true --dashboard_port 8501. Stop a launched dashboard with:

Terminal
./bin/stop_dashboard.sh results/basic_run
08

Usage step 08

Understand the output files

Stage directories are published below the selected output directory. Optional folders depend on enabled analysis stages.

results/my_run/
├── qc/raw/                    # FastQC + MultiQC on raw reads
├── qc/trimmed/                # QC after primer stage
├── trimmed/                   # Cutadapt FASTQs (paired mode)
├── trimming_reports/          # Cutadapt JSON/text reports
├── dada2/                     # QC, filtering, errors, ASV tables
├── taxonomy/                  # Taxonomy tables (when enabled)
├── community/                 # Diversity, PCoA, depth and eligible tests
├── phylogeny/                 # Sequences, alignment, status, Newick tree
└── .asvflow_dashboard/
    ├── artifacts/<invocation-id>/ # Trace, report and timeline
    └── runs/                       # Dashboard run records

DADA2 produces non-chimeric ASV abundance tables, sequences and read tracking. Community analysis reports Observed, Chao1, Shannon and Simpson alpha metrics plus Bray–Curtis/Jaccard PCoA. PERMANOVA requires metadata; composition needs a taxonomy table. With both community and phylogenetic analysis enabled, Faith’s PD and weighted/unweighted UniFrac outputs are added. The dashboard browses generated reports, tables and visualizations.

09

Usage step 09

Troubleshooting

No container runtime found+

Install/configure Apptainer or Singularity in PATH, then rerun bin/validate_environment.sh.

Container downloads fail+

Check curl, network access to registries and available disk space; rerun ./bin/download_tools.sh to retry incomplete downloads.

SILVA reference not found+

Check the version directory and expected filenames. Automatic resolution supports 144 and 138.1; other versions need explicit reference parameters.

Samplesheet validation fails+

Use the exact ordered header sample_id,fastq_1,fastq_2; confirm unique IDs, paired paths relative to the launch directory and valid gzip files.

DADA2 error rates could not be estimated / error matrix is NULL+

The README notes poly-G reads (no primer) in R2 as a possible cause. Try paired primer trimming with both primers, or --dada2_rm_lowcomplex 2.

Dashboard port is occupied+

The launcher reports a port conflict rather than selecting another. Choose a free --dashboard_port or pass another port to the launcher.

For full parameter and output details, consult the current ASVFlow README ↗.

01 · Purpose

From read files to reviewable results.

ASVFlow is a reproducible workflow for researchers and bioinformatics teams analyzing paired-end bacterial 16S amplicon data. It organizes quality checks, primer handling, DADA2 inference, and optional downstream analyses as explicit Nextflow stages.

Its purpose is to make each run’s processing steps and outputs easier to follow: a sample sheet connects paired FASTQ files to samples, modular processes publish stage-specific artifacts, and the Streamlit dashboard lets a user inspect the results of a selected run.

Taxonomy, community analysis, phylogenetic analysis, and the dashboard can be enabled as needed. DADA2 runs by default. This is a bacterial 16S-focused workflow; the repository does not establish ITS support.

02 · Workflow

A modular path through the data.

The pipeline uses DSL2 processes to connect read-level QC and the DADA2 core to optional analysis branches. The first two quality checks cover raw and post-primer-stage reads.

01

Paired FASTQ

R1 / R2 reads plus a CSV sample sheet; metadata is optional.

INPUT

02

Read QC

FastQC and MultiQC summarize raw reads.

FASTQC · MULTIQC

03

Primer stage

Cutadapt trims paired primers, or this stage can be skipped.

OPTIONAL MODE

04

Post-stage QC

FastQC and MultiQC run again on the resulting read set.

FASTQC · MULTIQC

05

DADA2 ASVs

Filter, learn errors, infer, merge, build the sequence table, remove chimeras.

DEFAULT ON

After non-chimeric ASVs

Optional analysis branches

Enable by run parameter

Taxonomy · optional

DADA2 classifier + SILVA

Genus-level assignment by default; species-level addition is a separate opt-in stage.

Community · optional

Diversity & composition

Alpha, Bray–Curtis and Jaccard beta diversity, and sequencing depth; composition and PERMANOVA have their own input needs.

Phylogeny · optional

MAFFT → FastTree

Aligns representative sequences with MAFFT and uses FastTree when there are multiple sequences; one sequence gets a valid single-leaf Newick result. With community analysis enabled too, the tree supports Faith’s PD and weighted/unweighted UniFrac.

03 · Analysis

What the workflow can produce.

Outputs depend on enabled stages and available inputs. The dashboard presents generated tables, plots, reports, and explicit unavailable states rather than implying every analysis ran.

A

ASV inference & abundance

DADA2 processes paired reads through error learning, sequence inference, merging, table construction, and chimera removal. Outputs include a non-chimeric ASV table, sequences, and read-tracking statistics.

B

SILVA taxonomy

The DADA2 classifier assigns taxonomy from a SILVA reference when enabled. Genus-level classification is the standard assignment; species addition is a separate opt-in step that requires exact reference matches.

C

Alpha diversity

Community analysis reports Observed richness, Chao1, Shannon, and Simpson metrics. Faith’s Phylogenetic Diversity is added when community and phylogenetic analyses are both enabled.

D

Beta diversity

Bray–Curtis and Jaccard distances produce PCoA outputs. With both optional analysis stages enabled, weighted and unweighted UniFrac distances and PCoA results are also available.

E

Group testing & composition

PERMANOVA runs when sample metadata is supplied. Taxonomic composition is produced when a taxonomy table is available; sequencing-depth summaries are part of community analysis.

F

Phylogenetic tree

When requested, representative non-chimeric ASVs are aligned with MAFFT. FastTree infers a tree when multiple sequences are available; one sequence gets a valid single-leaf Newick result. The dashboard reports unavailable states explicitly when a usable tree cannot be produced.

Faith’s PD depends on the workflow’s explicit computational rooting convention. Weighted and unweighted UniFrac are root-invariant. Zero-read samples and unavailable ordinations are reported according to the workflow’s status outputs.

04 · Dashboard

Results, one run at a time.

The Streamlit results explorer selects from recorded runs and surfaces the outputs that exist for the selected run. Open a screenshot to inspect it at full width; the complete tree capture scrolls vertically in the viewer.

05 · Technology

Built from familiar workflow tools.

Nextflow coordinates the stages; scientific tools run in Singularity-compatible containers configured for the pipeline.

Nextflow DSL2DADA2RPythonStreamlitApptainer / SingularitySILVAFastQCMultiQCCutadaptMAFFTFastTree

MAFFT and FastTree are used for optional phylogenetic analysis. MultiQC aggregates the FastQC reports; Cutadapt handles optional paired-primer removal.

06 · Reproducibility

Explicit stages. Configurable runs.

DSL2 modules keep each operation distinct. Nextflow configuration assigns process containers and resource limits, while parameters control optional branches and analysis settings.

Example · paired 16S runNextflow DSL2
nextflow run main.nf \
  --sample_sheet samplesheet.csv \
  --primer_mode paired \
  --primer_fwd GTGCCAGCMGCCGCGGTAA \
  --primer_rev GGACTACHVGGGTWTCTAAT \
  --run_dada2 true \
  --run_taxonomy true \
  --run_community_analysis true \
  --run_phylogenetic_analysis true \
  --sample_metadata metadata.tsv \
  --outdir results/my_run

Container execution

Apptainer or Singularity with automatic mounts and per-process resource settings.

Run recovery

Nextflow can resume a run with -resume when its work directories remain available.

Run records

Trace, execution report, timeline, and invocation metadata are organized per run.

Configurable scope

DADA2 is on by default; taxonomy, community, phylogeny, and dashboard are optional.

07 · Deliverables

Artifacts organized by stage.

Files are published below the chosen output directory. Optional folders and individual plots depend on run settings and whether the underlying data support the analysis.

qc/

Raw and post-primer-stage FastQC reports with MultiQC summaries.

QC stages
trimmed/ · trimming_reports/

Cutadapt FASTQ outputs plus JSON and text summaries.

Paired primer mode
dada2/

Quality profiles, read tracking, error artifacts, ASV tables, sequences, and chimera statistics.

DADA2 enabled
taxonomy/

Taxonomy table and assignment statistics; species outputs when requested.

Taxonomy enabled
community/

Diversity, PCoA, sequencing-depth, composition, and eligible PERMANOVA outputs.

Community enabled
phylogeny/

Representative FASTA, sequence ID map, alignment, status, and Newick tree when available.

Phylogeny enabled

Nextflow trace, report, and timeline files are also recorded per invocation under .asvflow_dashboard/artifacts/.

Explore the implementation

Read the pipeline. Follow each stage.

Source, parameters, setup instructions, and output details are available in the ASVFlow repository documentation.