QIIME 2 Amplicon Pipeline

QIIME 2 Amplicon Pipeline

by:

@OpenSourceBuffGuy

📚 Education & Research

Processes paired-end 16S amplicon reads into ASVs and taxonomy with QIIME 2, checking manifests, primers, overlap and read retention while keeping provenance.

Skill files3 files

references/

scripts/

SKILL.md133 lines
1
---
2
name: qiime2-amplicon
3
description: Processes paired-end 16S amplicon reads into QIIME 2 ASVs and taxonomy with retained artifact provenance. Checks paired FASTQ manifests, primer orientation diagnostics, predicted post-trimming overlap, sample IDs, runtime versions and read retention, and guides selection of compatible taxonomic classifiers.
4
license: MIT
5
compatibility: Python 3.10+ for the standard-library validation helper; QIIME 2 2026.7 distribution with cutadapt, dada2, demux, feature-table, feature-classifier, taxa and types plugins for execution. Install through the official conda/container distribution, not PyPI. Requires a compatible trusted classifier and network for installation/reference downloads.
6
metadata:
7
version: "1.1"
8
skill-author: K-Dense Inc.
9
upstream-version: "2026.7"
10
last-reviewed: "2026-10-01"
11
---
12
13
# QIIME 2 paired-end 16S amplicons
14
15
Use for a demultiplexed, paired-end 16S assay with known primers, quality encoding, expected insert
16
length, and sample metadata. This bounded workflow imports reads, removes 5′ primers, denoises with
17
DADA2, classifies ASVs using an explicitly supplied classifier, and retains `.qza`/`.qzv` provenance.
18
Do not treat read counts as absolute cell counts or taxonomy assignments as strain identification.
19
20
## Establish the assay before running
21
22
- Confirm Phred+33, read orientation, primer sequences **as sequenced** in forward/reverse reads,
23
and whether primers have already been removed. The bundled runner requires primers still
24
present at the 5′ ends; it anchors Cutadapt matching and discards untrimmed pairs. Already
25
trimmed reads need a direct import → DADA2 workflow with that omission recorded in provenance.
26
- Choose truncation positions from actual per-base quality and error profiles. `trunc-f/r` are
27
positions **after primer removal**. The expected maximum insert length also excludes primers.
28
Require `trunc_f + trunc_r - maximum_insert_length >= 12`; use a margin for length variation.
29
The check predicts geometrical overlap, not successful biological merging.
30
- Choose a classifier whose reference database, taxonomic coverage, orientation and training
31
approach fit the assay. Full-length classifiers are supported; primer-region-specific training
32
is not mandatory. Match its scikit-learn version exactly to the installed environment
33
(the official 2026.7 distribution pins 1.7.1). Record source URL, database version and checksum.
34
QIIME's current data-resources page links externally hosted classifiers for 2026.4 and later;
35
its older downloads are not automatically compatible. Do not automatically fetch
36
an arbitrary “latest” classifier or reuse an incompatible serialized sklearn model. Load sklearn
37
classifier artifacts only from trusted sources: QZA format validation does not make an
38
untrusted serialized model safe.
39
- Include extraction blanks, PCR negatives, and a mock community where available. The runner
40
rejects empty FASTQs; preserve empty-control IDs separately and report them rather than silently
41
deleting control evidence. Assess contamination before ecological interpretation.
42
43
## Input files
44
45
Manifest is a **tab-separated** `PairedEndFastqManifestPhred33V2` file with exactly these headers:
46
47
```text
48
sample-id forward-absolute-filepath reverse-absolute-filepath
49
sample1 /data/sample1_R1.fastq.gz /data/sample1_R2.fastq.gz
50
```
51
52
This is the helper's deliberately narrow manifest profile. Use actual tab characters, literal
53
absolute paths visible to the runtime (expand environment variables before calling this helper),
54
and one row per sample; no comment/directive rows or additional columns in this manifest.
55
Do not reverse-complement R2 files. Sample metadata is a tab-separated file with first column
56
`sample-id`, unique IDs matching the manifest, and optional `#q2:types` annotation. Include
57
covariates and biological replicate IDs needed downstream.
58
The helper checks metadata IDs and row structure; QIIME performs full metadata typing/directive
59
validation during execution. Metadata used by actions persists in artifact provenance, so use
60
de-identified biological replicate IDs.
61
62
## Execute
63
64
The helper lives at [scripts/amplicon_workflow.py](scripts/amplicon_workflow.py). Commands below
65
assume the skill directory is the working directory. First validate
66
without QIIME. These example primers and lengths are **illustrative**, not universal assay settings:
67
68
```bash
69
python scripts/amplicon_workflow.py validate \
70
--manifest manifest.tsv --metadata sample-metadata.tsv \
71
--primer-f GTGYCAGCMGCCGCGGTAA --primer-r GGACTACNVGGGTWTCTAAT \
72
--trunc-f 220 --trunc-r 200 --amplicon-max 300
73
```
74
75
Then run in the QIIME 2 2026.7 environment with a compatible classifier. This study-specific
76
invocation is illustrative; choose lengths using a preceding quality inspection or pilot:
77
78
```bash
79
python scripts/amplicon_workflow.py run \
80
--manifest manifest.tsv --metadata sample-metadata.tsv \
81
--primer-f GTGYCAGCMGCCGCGGTAA --primer-r GGACTACNVGGGTWTCTAAT \
82
--trunc-f 220 --trunc-r 200 --amplicon-max 300 \
83
--classifier compatible-classifier.qza --threads 4 --output run01
84
```
85
86
`run` executes immediately, writes only to a fresh output directory, and stops on a failing QIIME
87
command. It streams through every paired FASTQ record to catch mismatched IDs/order/counts,
88
checks sequence/quality consistency and sample alignment, and profiles the first 1,000 read pairs
89
for exact IUPAC primer matches. Low exact-match rates are warnings: Cutadapt allows mismatches,
90
but a low rate can also indicate incorrect orientation, adapters, or already-trimmed data.
91
At least one complete pair per sample must meet nominal post-primer truncation lengths.
92
These length estimates subtract the stated primer lengths; they do not simulate Cutadapt indels
93
or quality filtering, and do not establish that any pair will actually merge.
94
95
The runner uses `--output-dir` for plugin methods with evolving output sets, preserving Cutadapt
96
statistics and DADA2 base-transition artifacts when supplied by the release. The 2026.7 table
97
summary also produces `feature-frequencies.qza` and `sample-frequencies.qza` beside `table.qzv`.
98
It records
99
`qiime-info.txt`, `commands.json`, `workflow.log`, input QC, classifier checksum and output artifact
100
checksums. It runs maximum-level QIIME artifact validation before reporting completion.
101
See [references/runtime-and-interpretation.md](references/runtime-and-interpretation.md) for the
102
release-pinned runtime, actual validation scope, restart handling and scientific interpretation.
103
104
## Inspect results before analysis
105
106
Open `trimmed.qzv`, `table.qzv`, and `taxa.qzv` in a local QIIME visualization environment or
107
[QIIME 2 View](https://view.qiime2.org/) as appropriate for the data. Examine quality/length profiles,
108
per-sample depth and dominant taxa. Retain original artifacts rather than replacing them with
109
CSV/BIOM exports: exports do not retain the original provenance graph.
110
111
`retention-qc.json` compares raw pairs with DADA2 input and non-chimeric reads, so trimming losses
112
remain visible. A <50% retained fraction is a review heuristic, not a universal rejection rule.
113
Inspect the individual stages in `stats/stats.tsv`: filtering loss suggests quality/expected-error
114
settings; loss after forward denoising includes reverse-denoising and merging failures; chimera loss warrants reviewing library
115
quality and parameters. Investigate missing/zero samples and control behavior before rarefaction,
116
diversity, or differential abundance. Those downstream analyses need a separate design decision;
117
this skill does not choose a rarefaction depth automatically.
118
The standalone `retention stats.tsv` subcommand knows only DADA2 input counts: it reports
119
`raw_pairs: null` and names that denominator explicitly. It supports merged-only paired DADA2
120
statistics, as produced by this runner; it rejects retained-unmerged/concatenated-read statistics.
121
122
## Primary references
123
124
- [Current installation entry point](https://library.qiime2.org/quickstart/qiime2) and
125
[amplicon documentation](https://amplicon-docs.qiime2.org/en/latest/).
126
- [Import formats](https://amplicon-docs.qiime2.org/en/latest/how-to-guides/how-to-import/).
127
- [Cutadapt actions](https://amplicon-docs.qiime2.org/en/latest/references/plugins/cutadapt/) and
128
[DADA2 actions](https://amplicon-docs.qiime2.org/en/latest/references/plugins/dada2/).
129
- [Classifier data resources](https://library.qiime2.org/data-resources).
130
131
The rolling documentation may describe a development release. Inspect `qiime info` and action
132
`--help` in the exact installed environment before adapting the pinned runner to a later release.
133

© K-Dense Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…