[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECYMS43BYNN00M0EBMCM0S":3,"skill-same:01M7ECYMS43BYNN00M0EBMCM0S":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7ECYMS43BYNN00M0EBMCM0S","bio-ecological-genomics-edna-metabarcoding",null,"Processes eDNA metabarcoding from raw paired-end reads to species tables, navigating ASV (DADA2, UNOISE3) vs OTU (swarm v2) decision (Callahan 2017 vs Schloss multi-copy-16S critique), marker\u002Fprimer choice (Leray COI, MiFish 12S, 515F\u002F806R 16S, ITS2) with primer-specific bias, OBITools3 v3 command-name break (obi stats plural; .tar.gz taxonomy), tag-jumping with dual-indexing (Schnell 2015; NovaSeq 10x MiSeq), decontam as screening-not-classifier (Davis 2018), read-counts-not-abundance critique (Lamb 2019), site-occupancy modeling (Ficetola 2015), Naive-Bayes calibration limits (Bokulich 2018), and eDNA decay (Strickler 2015). Use when going from raw eDNA FASTQ to species tables, picking marker + denoising pipeline, deciding whether read counts represent abundance, applying occupancy modeling, configuring OBITools3 v3, or interpreting decontam output. Not for clinical 16S microbiome (see microbiome\u002Famplicon-processing).","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-ecological-genomics-edna-metabarcoding\ndescription: Processes eDNA metabarcoding from raw paired-end reads to species tables, navigating ASV (DADA2, UNOISE3) vs OTU (swarm v2) decision (Callahan 2017 vs Schloss multi-copy-16S critique), marker\u002Fprimer choice (Leray COI, MiFish 12S, 515F\u002F806R 16S, ITS2) with primer-specific bias, OBITools3 v3 command-name break (obi stats plural; .tar.gz taxonomy), tag-jumping with dual-indexing (Schnell 2015; NovaSeq 10x MiSeq), decontam as screening-not-classifier (Davis 2018), read-counts-not-abundance critique (Lamb 2019), site-occupancy modeling (Ficetola 2015), Naive-Bayes calibration limits (Bokulich 2018), and eDNA decay (Strickler 2015). Use when going from raw eDNA FASTQ to species tables, picking marker + denoising pipeline, deciding whether read counts represent abundance, applying occupancy modeling, configuring OBITools3 v3, or interpreting decontam output. Not for clinical 16S microbiome (see microbiome\u002Famplicon-processing).\ntool_type: mixed\nprimary_tool: dada2\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"ecological-genomics\u002Fedna-metabarcoding\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: DADA2 1.30+, cutadapt 4.7+, OBITools3 (Python 3), decontam 1.20+, microDecon 1.0+, occumb 1.0+, vsearch 2.27+, swarm 3.1+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# eDNA Metabarcoding\n\n**\"Process eDNA samples to identify species present\"** -> Trim primers, denoise to ASVs (or cluster to OTUs), detect chimeras, assign taxonomy, filter contamination with negative controls AND DNA concentration, decompose tag-jumping artifacts, and quantify detection uncertainty via site-occupancy modeling. For the foundational eDNA-for-wildlife review, see Bohmann et al. 2014 *Trends Ecol Evol* 29:358-367.\n- CLI: `cutadapt` for primer removal (linked-adapter mode)\n- R: `dada2::filterAndTrim()` -> `dada()` -> `assignTaxonomy()` for ASV pipeline\n- CLI: `obi stats` \u002F `obi clean` \u002F `obi ecotag` for OBITools3 (NOTE: v3 plural commands)\n- R: `decontam::isContaminant()` for contamination screening\n- R: `occumb::occumb()` for detection-corrected occurrence\n\n## The Single Most Important Modern Insight -- Read Counts Are NOT Abundance\n\nElbrecht & Leese 2015 *PLoS One* 10:e0130324 and Lamb et al. 2019 *Mol Ecol* 28:420-430 (meta-analysis) established that metabarcoding read counts have weak-to-moderate, taxon-specific, NONLINEAR correlation with biomass or DNA input. Primer-binding bias dominates; PCR replicates introduce stochasticity. **Reporting read counts as abundance without mock-community calibration is malpractice.** Modern practice: report PRESENCE\u002FABSENCE or relative abundance with explicit calibration; use multiple PCR replicates; apply site-occupancy models for detection correction.\n\nA second cornerstone: the ASV-vs-OTU debate is taxon-specific, not universal. Callahan, McMurdie, Holmes 2017 *ISME J* 11:2639-2643 argued ASVs replace OTUs because modern denoising resolves single-nucleotide differences. Schloss 2021 *mSphere* 6:e00191-21 showed that for bacterial 16S with 1-15 intra-genomic rRNA copies, a single E. coli strain produces ~7 distinct ASVs, splitting bacterial genomes across artificial clusters. **For COI metazoan metabarcoding, ASVs (DADA2\u002FUNOISE3) are recommended; for bacterial 16S, ASVs inflate alpha-diversity and OTUs may be appropriate.**\n\nA third: **decontam (Davis 2018) is a SCREENING tool, not a deterministic classifier.** It flags candidates; biological plausibility check is required before deletion. The default `threshold=0.1` over-flags in low-biomass data.\n\n## Algorithmic Taxonomy\n\n| Method | Output | Strength | Fails when |\n|--------|--------|----------|------------|\n| DADA2 | Single-nucleotide ASVs | High resolution; learned error model; standard for COI\u002F12S\u002F18S\u002Ffungal-ITS | Small datasets (\u003C 100 samples) for error learning; multi-copy bacterial rRNA |\n| UNOISE3 (USEARCH\u002FVSEARCH; Edgar 2016) | zOTUs (essentially ASVs) | Fast; algorithmic simplicity | Limited Linux\u002FMac binary distribution under license |\n| Swarm v2 `-d 1 --fastidious` (Mahé 2015) | Abundance-weighted single-linkage OTUs | Modern OTU pipeline; better than legacy 97% UCLUST | OTUs by design (not single-nt resolution) |\n| 97% UCLUST | Classical OTUs | Legacy familiarity | Biologically arbitrary threshold; supersedes by DADA2\u002Fswarm |\n| VSEARCH global pairwise | Taxonomic assignment via best-hit | Fast, transparent, no training | Conservative; mis-assigns sister species when ref incomplete |\n| Naive Bayes (q2-feature-classifier, RDP) | Probabilistic taxonomic assignment | Probabilistic confidence; standard for 16S | Confidence values are scikit-learn calibrated, not true probabilities (Bokulich 2018) |\n| SINTAX (Edgar) | Bootstrap-supported taxonomy | Fast; no training | Less accurate than Naive Bayes for divergent sequences |\n| LCA (BASTA, MEGAN-LCA) | Lowest common ancestor of multiple hits | Conservative; never over-confident | Can over-merge to high taxonomic ranks |\n| Phylogenetic placement (EPA-ng + gappa) | Position on reference tree | Most rigorous; phylogenetically explicit | 10-100x slower; emerging not yet standard |\n| decontam | Flagged contaminant candidates | Statistical screening of negative controls and DNA concentration patterns | Output is screening, not classification; needs biological-plausibility check |\n| UCHIME3 (in DADA2\u002FVSEARCH) | Chimera detection | Standard for de novo chimera removal | Some divergent chimeras escape |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|---------------------|-----|\n| Metazoan COI metabarcoding (water, gut content) | mlCOIintF\u002FjgHCO2198 (Leray 2013) primers; DADA2 ASVs | Standard primer set; ASVs preserve single-nt resolution |\n| Fish eDNA from water | MiFish-U\u002FE (Miya 2015) 12S primers; DADA2 ASVs | Dominant eDNA fish marker globally |\n| Freshwater macroinvertebrate bioassessment | BF1\u002FBR1 freshwater-optimized COI primers | Higher primer-binding inclusivity for aquatic insects |\n| Bacterial community 16S | 515F\u002F806R (V4) Parada modified; ASVs OR Swarm v2 | Schloss 2021 caveat applies; ASVs may oversplit multi-copy rRNA |\n| Fungal community ITS | ITS2 primers; DADA2 or UNITE pipeline | UNITE is curated for fungal ITS |\n| Plant community DNA | trnL P6 loop (Taberlet 2007) for degraded DNA | Robust to degradation |\n| Deciding ASV vs OTU | ASVs for COI\u002F12S\u002F18S\u002Ffungi; OTU consideration for 16S with multi-copy concern | Taxon-specific |\n| NovaSeq library (patterned flow cell) | Heavier tag-jumping correction; expect 10x higher rates than MiSeq | Patterned-cell index hopping |\n| Low-biomass eDNA (deep ocean, ancient) | decontam frequency + prevalence methods; explicit reagent-contamination check | Reagent contamination dominates |\n| Quantitative comparison across samples | Mock-community calibration BEFORE reporting read counts | Without mock, read counts are biased estimators of biomass |\n| Detection probability with replication | Site-occupancy models (occumb, eDNAoccupancy; Ficetola 2015) | Read counts alone underestimate occurrence; replicates correct |\n| Taxonomic assignment for marker > 80% covered | Naive Bayes (q2-feature-classifier) | Probabilistic; well-supported |\n| Taxonomic assignment for sparse reference | Phylogenetic placement (EPA-ng) | Robust to incomplete references |\n| OBITools3 pipeline | `obi stats` (NOTE: plural), DMS-based, `.tar.gz` taxonomy | v3 syntax differs from v1 |\n\n## Primer Trimming with cutadapt\n\n**Goal:** Remove primer sequences while discarding reads that lack primers, before quality filtering.\n\n**Approach:** Use cutadapt linked-adapter mode with marker-specific 5' and 3' primer pairs. `--discard-untrimmed` removes reads lacking expected primers; `min_overlap` prevents false primer detection in random sequence regions.\n\n```bash\n# COI metazoan (Leray mlCOIintF \u002F jgHCO2198 -> 313 bp)\ncutadapt -g 'GGWACWGGWTGAACWGTWTAYCCYCC;min_overlap=20' \\\n         -G 'TAIACYTCIGGRTGICCRAARAAYCA;min_overlap=20' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n\n# Fish 12S (MiFish-U -> 163-185 bp)\ncutadapt -g 'GTCGGTAAAACTCGTGCCAGC;min_overlap=18' \\\n         -G 'CATAGTGGGGTATCTAATCCCAGTTTG;min_overlap=18' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n\n# Fungal ITS2\ncutadapt -g 'GTGAATCATCGAATCTTTGAAC;min_overlap=18' \\\n         -G 'TCCTCCGCTTATTGATATGC;min_overlap=18' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n```\n\n## DADA2 ASV Pipeline\n\n**Goal:** Denoise paired-end amplicon reads into exact amplicon sequence variants (ASVs) with chimera removal and reference-based taxonomy assignment, per Callahan et al. 2016 *Nat Methods* 13:581-583.\n\n**Approach:** Filter to length\u002Fquality thresholds, learn error rates per dataset, run dada() to denoise, merge pairs, build sequence table, remove chimeras with UCHIME3-equivalent in DADA2, then assign taxonomy against the marker-appropriate reference DB. CRITICAL: primers must be removed (cutadapt) BEFORE filterAndTrim, OR the error model is corrupted.\n\n```r\nlibrary(dada2)\n\n# CRITICAL: primer removal MUST precede filterAndTrim\n# DADA2's error model assumes primer-free reads\nfwd_reads \u003C- sort(list.files('primer_trimmed\u002F', pattern = '_R1', full.names = TRUE))\nrev_reads \u003C- sort(list.files('primer_trimmed\u002F', pattern = '_R2', full.names = TRUE))\nfilt_fwd \u003C- file.path('filtered', basename(fwd_reads))\nfilt_rev \u003C- file.path('filtered', basename(rev_reads))\n\n# Filter and trim\n# maxEE=c(2,2): expected errors per read; tradeoff sensitivity\u002Fspecificity\n# truncLen: set from quality profile inspection; do not guess\nout \u003C- filterAndTrim(fwd_reads, filt_fwd, rev_reads, filt_rev,\n                     maxN = 0, maxEE = c(2, 2), truncQ = 2,\n                     truncLen = c(220, 180),     # data-dependent; inspect plotQualityProfile()\n                     minLen = 100, rm.phix = TRUE, multithread = TRUE)\n\n# Learn error rates\n# For small datasets (\u003C 100 samples), pool aggressively or use pre-learned model\nerr_fwd \u003C- learnErrors(filt_fwd, multithread = TRUE)\nerr_rev \u003C- learnErrors(filt_rev, multithread = TRUE)\n\n# Denoise\ndada_fwd \u003C- dada(filt_fwd, err = err_fwd, multithread = TRUE)\ndada_rev \u003C- dada(filt_rev, err = err_rev, multithread = TRUE)\n\n# Merge pairs with minimum overlap\nmerged \u003C- mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev, minOverlap = 12)\n\n# Build sequence table\nseqtab \u003C- makeSequenceTable(merged)\n\n# Remove chimeras\n# method='consensus': per-sample then consensus; conservative (default)\n# method='pooled': pooled across samples; aggressive; can over-merge real diversity\n# Chimera rate >30% typically indicates library prep problems\nseqtab_nochim \u003C- removeBimeraDenovo(seqtab, method = 'consensus',\n                                     multithread = TRUE)\ncat('Chimera rate:', round(1 - sum(seqtab_nochim) \u002F sum(seqtab), 3), '\\n')\n\n# Taxonomy assignment\n# minBoot=80: standard genus-level confidence; 50 for family-level\n# IMPORTANT: pair the marker with the appropriate reference DB\n# COI -> MIDORI2 LONGEST_NUC_GB259_CO1 (or BOLD with curation)\n# 12S -> MitoFish (Miya lab)\n# 16S V4 -> SILVA 138.1+\n# 18S V4\u002FV9 -> SILVA 138.1+ or PR2\n# Fungal ITS -> UNITE 9.0+\ntaxa \u003C- assignTaxonomy(seqtab_nochim,\n                       'MIDORI2_LONGEST_NUC_GB259_CO1_DADA2.fasta.gz',\n                       minBoot = 80, multithread = TRUE)\n```\n\n## OBITools3 Pipeline — The v1 -> v3 Command Break\n\n**Goal:** Process eDNA reads through the Unix-style OBITools v3 pipeline (Boyer et al. 2016 *Mol Ecol Resour* 16:176-182 introduced OBITools v1; v3 is the post-2018 Python 3 rewrite) with DMS-based sequence management.\n\n**Approach:** v3 introduces a Database Management System (DMS) abstraction; sequences are imported into a DMS rather than read directly from FASTQ. Commands use spaces (e.g., `obi stats` plural, not `obistat`). Taxonomy import expects `.tar.gz` archive, not a directory.\n\n```bash\n# v1 -> v3 command-name changes (critical):\n# v1: obistat       -> v3: obi stats\n# v1: obigrep       -> v3: obi grep\n# v1: obiuniq       -> v3: obi uniq\n# v1: obitab        -> v3: obi annotate \u002F obi export --tab-output (different semantics)\n# v1: ngsfilter     -> v3: obi ngsfilter\n# v1: taxdump dir   -> v3: .tar.gz archive\n\n# Import paired FASTQ into DMS\nobi import --fastq-input raw_R1.fastq.gz EDNA\u002Freads1\nobi import --fastq-input raw_R2.fastq.gz EDNA\u002Freads2\n\n# Paired-end alignment\nobi alignpairedend -R EDNA\u002Freads2 EDNA\u002Freads1 EDNA\u002Faligned\n\n# Filter by alignment score and length\nobi grep -p 'sequence[\"score\"] >= 50' EDNA\u002Faligned EDNA\u002Ffiltered\nobi grep -p 'len(sequence) >= 100 and len(sequence) \u003C= 500' \\\n    EDNA\u002Ffiltered EDNA\u002Flength_filtered\n\n# Demultiplex (NGS filter file maps barcodes -> samples)\nobi ngsfilter -t ngsfilter.txt -u EDNA\u002Funassigned \\\n    EDNA\u002Flength_filtered EDNA\u002Fdemux\n\n# Dereplicate (obi uniq creates merged_sample attribute automatically)\nobi uniq EDNA\u002Fdemux EDNA\u002Fderep\n\n# Remove suspected error singletons\nobi grep -p 'sequence[\"count\"] >= 2' EDNA\u002Fderep EDNA\u002Fno_singletons\n\n# Denoise via obi clean\nobi clean -s merged_sample -r 0.05 -H EDNA\u002Fno_singletons EDNA\u002Fdenoised\n\n# Taxonomy assignment against reference database\nobi ecotag -R EDNA\u002Frefdb --taxonomy EDNA\u002Ftaxonomy EDNA\u002Fdenoised EDNA\u002Fassigned\n\n# Export tab-separated species table\nobi export --tab-output EDNA\u002Fassigned > species_table.tsv\n```\n\nAcross most metabarcoding studies, 50-85% of ASVs cannot be assigned to species level due to incomplete references (Wangensteen et al. 2018 *PeerJ* 6:e4705 documented this for marine COI + 18S). Report this gap honestly; do not infer ecology from \"unassigned\" reads.\n\n## Tag-Jumping Mitigation — Schnell 2015 + NovaSeq Caveat\n\n**Goal:** Detect and remove sequence-to-sample misassignments arising from chimeric library molecules with mismatched indices.\n\n**Approach:** Use dual-indexing (different indices at both ends; cross-jumped pairs are discarded). Quantify residual tag-jumping rate from per-ASV cross-sample appearance and apply per-ASV abundance threshold filtering with `metabaR::tagjumpslayer`. For NovaSeq libraries, expect ~10x higher tag-jumping than MiSeq due to patterned flow cells.\n\n```r\nlibrary(metabaR)\n\n# metabaR expects an metabarlist object (asv table + sample info + ngsfilter)\n# tagjumpslayer applies per-ASV abundance-threshold filter\n# threshold: 0.01 (1% of ASV total) is conservative; 0.001 for aggressive removal\n# Adjust threshold higher for NovaSeq (~0.005-0.01) than MiSeq (~0.001-0.005)\n\n# Quantify residual tag-jumping rate before filtering:\n# Count reads in sample x ASV combinations that should be 0 by experimental design\n# (e.g., samples explicitly excluded from a particular condition)\n# That rate \u002F total reads = empirical tag-jumping rate\n# Report this rate in methods section\n```\n\n## Contamination Screening with decontam\n\n**Goal:** Identify candidate contaminant ASVs from negative controls and DNA-concentration patterns.\n\n**Approach:** Use `decontam::isContaminant` with `method='combined'` when both DNA concentration AND negative controls are available. Treat flagged ASVs as SCREENING CANDIDATES; verify biological plausibility before deletion. The default `threshold=0.1` is over-aggressive in low-biomass data.\n\n```r\nlibrary(decontam)\n\n# Frequency method: contaminants more frequent at LOW DNA concentration\n# Prevalence method: contaminants more frequent in negative controls\n# Combined: uses both signals (most robust)\n\ncontam \u003C- isContaminant(seqtab_nochim,\n                        conc = dna_concentration,        # qPCR or Qubit per sample\n                        neg = is_negative_control,       # logical: which samples are controls\n                        method = 'combined',\n                        threshold = 0.1)                 # default; lower for high-confidence calls\n\n# CRITICAL: decontam output is SCREENING, not classification\n# Manually inspect each flagged ASV: is the taxonomic assignment plausibly a reagent contaminant?\n# Common reagent contaminants: Delftia, Sphingomonas, Burkholderia, Propionibacterium\nflagged \u003C- which(contam$contaminant)\ncat('Decontam flagged', length(flagged), 'ASVs as candidates\\n')\n\n# After manual review, remove confirmed contaminants\nconfirmed_contam \u003C- intersect(flagged, biological_plausibility_check_result)\nseqtab_clean \u003C- seqtab_nochim[, !(colnames(seqtab_nochim) %in% confirmed_contam)]\n```\n\n## Site-Occupancy Modeling — Correcting for Imperfect Detection\n\n**Goal:** Estimate true species occurrence probabilities from replicated eDNA samples, accounting for false negatives in any single PCR replicate.\n\n**Approach:** Fit a multi-species occupancy model via MCMC (Ficetola 2015 *Mol Ecol Resour* 15:543-556) on a 3D array of replicated read counts. Output: per-site, per-species occupancy probabilities corrected for detection.\n\n```r\nlibrary(occumb)\n\n# y: 3D array [species, sites, replicates] of read counts\n# spec_cov: species covariates (traits)\n# site_cov: site covariates (env)\ndata_obj \u003C- occumbData(y = count_array, spec_cov = species_covariates,\n                       site_cov = site_covariates)\n\n# Fit hierarchical occupancy model\n# Requires JAGS installation\n# n.iter >= 10000, n.burn >= 2500 for publication-quality posteriors\nfit \u003C- occumb(data = data_obj, n.chains = 4, n.iter = 10000,\n              n.thin = 5, n.burn = 2500)\n\n# Extract detection-corrected occupancy\nsummary(fit)\n```\n\n## Per-Method Failure Modes\n\n### Reporting read counts as biomass without mock-community calibration\n\n**Trigger:** Comparing read counts of two ASVs and reporting the ratio as a biomass \u002F abundance estimate.\n\n**Mechanism:** Primer-template binding affinity varies systematically across taxa; PCR amplification is non-linear (saturates); read counts have weak-to-moderate, NONLINEAR correlation with biomass (Elbrecht 2015; Lamb 2019).\n\n**Symptom:** Reviewer asks \"how is it known that reads = biomass?\"; cross-study quantitative comparisons fail to replicate.\n\n**Fix:** Either (a) restrict reporting to presence\u002Fabsence; (b) report read counts as relative abundances with explicit caveat; or (c) include mock-community of known composition for primer-specific calibration. Do not silently equate reads with biomass.\n\n### NovaSeq tag-jumping with MiSeq-tuned filtering\n\n**Trigger:** Applying tag-jumping filters calibrated on MiSeq libraries to NovaSeq data.\n\n**Mechanism:** NovaSeq patterned flow cells have ~10x higher index hopping than MiSeq. MiSeq-calibrated thresholds (often ~0.001 fraction) are too permissive on NovaSeq data.\n\n**Symptom:** Apparent rare-species detections in NovaSeq libraries do not replicate; per-ASV cross-sample appearance is unusually broad.\n\n**Fix:** Use NovaSeq-appropriate tag-jumping thresholds (~0.005-0.01) and report the empirical tag-jumping rate from explicit-zero combinations.\n\n### decontam threshold over-aggressive in low-biomass data\n\n**Trigger:** Applying default `threshold = 0.1` to ASVs from open-ocean water, ancient sediments, or other dilute samples.\n\n**Mechanism:** In low-biomass samples, the contaminant signal\u002Fbackground ratio approaches 1; decontam over-flags real but dilute biology as \"contaminant\" because the statistical pattern looks similar.\n\n**Symptom:** Many ASVs flagged from low-biomass samples; taxonomic profile of \"flagged contaminants\" looks biologically realistic.\n\n**Fix:** Lower threshold (0.05 or 0.01); always manually review flagged ASVs for biological plausibility; cite Salter 2014 *BMC Biol* 12:87 for the low-biomass reagent-contamination caveat.\n\n### Skipping primer removal before DADA2 filterAndTrim\n\n**Trigger:** Running DADA2's `filterAndTrim()` on FASTQ files that still contain primer sequences.\n\n**Mechanism:** DADA2 learns sequencing error from the empirical data; if primer sequences are present, they look like \"perfect agreement\" and corrupt the error model. ASVs are inferred with primer artifacts attached.\n\n**Symptom:** DADA2 reports \"phix-like contamination\" (false; it's primers); ASVs start with the primer sequence; chimera rate elevated.\n\n**Fix:** Always run cutadapt (or similar) BEFORE filterAndTrim. Verify with `head` of trimmed FASTQ that primer sequences are gone.\n\n### OBITools v3 commands with v1 syntax\n\n**Trigger:** Running `obistat` or `obigrep` on a v3 install.\n\n**Mechanism:** v1 used concatenated command names (`obistat`); v3 uses subcommand syntax with a space (`obi stats` — note plural).\n\n**Symptom:** Bash error `obistat: command not found`; tutorial documentation does not match installed version.\n\n**Fix:** Use `obi \u003Csubcommand>` syntax; consult `obi --help` for current command list. Taxonomy import requires `.tar.gz` archive, not unpacked directory.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F rationale |\n|-----------|-------|-------------------|\n| DADA2 maxEE per read | 2 | Standard sensitivity\u002Fspecificity balance |\n| DADA2 chimera rate alarm | > 30% suggests library issues | Empirical convention |\n| DADA2 minBoot for taxonomy | 80 for genus; 50 for family | Standard confidence cutoffs |\n| Tag-jumping filter MiSeq | 0.001-0.005 fraction of ASV total | Schnell 2015 |\n| Tag-jumping filter NovaSeq | 0.005-0.01 fraction of ASV total | Patterned-cell index hopping ~10x higher |\n| decontam threshold | 0.1 default; 0.05 for low-biomass | Davis 2018; reduce for dilute samples |\n| Per-sample minimum reads | 1000 (after filtering) | Below this rare-species detection unreliable |\n| Singleton removal | count >= 2 | Singletons often error-driven |\n| Bootstrap nperm for tests | 999 | Standard permutation count |\n| Occupancy model iterations | n.iter >= 10000, n.burn >= 2500 | occumb default for stable posteriors |\n| eDNA decay (20 deg C surface water) | half-life ~4-15 hours | Strickler 2015 Biol Conserv 183:85-92 |\n\n## Common errors\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `obistat: command not found` | OBITools v3 uses `obi stats` (plural) | Use v3 syntax |\n| DADA2 error rate plot looks pathological | Primer sequences still in reads | Re-run cutadapt before filterAndTrim |\n| Chimera rate > 30% | Library-prep issue or primer dimers | Inspect raw FASTQ; check PCR conditions |\n| decontam flags many real species | Default threshold too aggressive for low-biomass | Lower threshold; manual review |\n| Naive Bayes confidence 0.95 but species is wrong | scikit-learn-calibrated \"confidence\" not true probability | Use phylogenetic placement for borderline assignments |\n| occumb JAGS not found error | JAGS not installed system-wide | Install JAGS (CRAN page has platform instructions) |\n| eDNA detections do not replicate | Read counts treated as abundance | Switch to presence\u002Fabsence; use mock-community calibration |\n| MIDORI2 download path expired | Database updated; old URL gone | Check current MIDORI2 \u002F MitoFish download page |\n\n## References\n\n- Callahan BJ, McMurdie PJ, Rosen MJ, Han AW, Johnson AJA, Holmes SP (2016) DADA2. *Nat Methods* 13(7):581-583. doi:10.1038\u002Fnmeth.3869\n- Callahan BJ, McMurdie PJ, Holmes SP (2017) Exact sequence variants should replace OTUs. *ISME J* 11(12):2639-2643. doi:10.1038\u002Fismej.2017.119\n- Edgar RC (2016) UNOISE2 \u002F UNOISE3. *bioRxiv* preprint. doi:10.1101\u002F081257\n- Mahe F, Rognes T, Quince C, de Vargas C, Dunthorn M (2015) Swarm v2. *PeerJ* 3:e1420. doi:10.7717\u002Fpeerj.1420\n- Leray M, Yang JY, Meyer CP et al. (2013) mlCOIintF\u002FjgHCO2198 metazoan COI primer. *Front Zool* 10:34. doi:10.1186\u002F1742-9994-10-34\n- Miya M, Sato Y, Fukunaga T et al. (2015) MiFish 12S fish eDNA primer. *R Soc Open Sci* 2(7):150088. doi:10.1098\u002Frsos.150088\n- Schnell IB, Bohmann K, Gilbert MTP (2015) Tag jumps illuminated. *Mol Ecol Resour* 15(6):1289-1303. doi:10.1111\u002F1755-0998.12402\n- Davis NM, Proctor DM, Holmes SP, Relman DA, Callahan BJ (2018) decontam. *Microbiome* 6:226. doi:10.1186\u002Fs40168-018-0605-2\n- Boyer F, Mercier C, Bonin A, Le Bras Y, Taberlet P, Coissac E (2016) OBITools. *Mol Ecol Resour* 16(1):176-182. doi:10.1111\u002F1755-0998.12428\n- Elbrecht V, Leese F (2015) DNA-based ecosystem quantification critique. *PLoS One* 10(7):e0130324. doi:10.1371\u002Fjournal.pone.0130324\n- Lamb PD, Hunter E, Pinnegar JK, Creer S, Davies RG, Taylor MI (2019) How quantitative is metabarcoding: meta-analysis. *Mol Ecol* 28(2):420-430. doi:10.1111\u002Fmec.14920\n- Ficetola GF, Pansu J, Bonin A et al. (2015) Replication levels and false presences in eDNA. *Mol Ecol Resour* 15(3):543-556. doi:10.1111\u002F1755-0998.12338\n- Wangensteen OS, Palacin C, Guardiola M, Turon X (2018) COI + 18S marine metabarcoding. *PeerJ* 6:e4705. doi:10.7717\u002Fpeerj.4705\n- Strickler KM, Fremier AK, Goldberg CS (2015) eDNA degradation kinetics. *Biol Conserv* 183:85-92. doi:10.1016\u002Fj.biocon.2014.11.038\n- Bokulich NA, Kaehler BD, Rideout JR et al. (2018) Optimizing taxonomic classification with q2-feature-classifier. *Microbiome* 6:90. doi:10.1186\u002Fs40168-018-0470-z\n- Bohmann K, Evans A, Gilbert MTP et al. (2014) eDNA for wildlife and biodiversity. *Trends Ecol Evol* 29(6):358-367. doi:10.1016\u002Fj.tree.2014.04.003\n- Schloss PD (2021) Amplicon sequence variants artificially split bacterial genomes into separate clusters. *mSphere* 6(4):e00191-21. doi:10.1128\u002FmSphere.00191-21\n- Salter SJ, Cox MJ, Turek EM et al. (2014) Reagent and laboratory contamination can critically impact sequence-based microbiome analyses. *BMC Biol* 12:87. doi:10.1186\u002Fs12915-014-0087-z\n- Taberlet P, Coissac E, Pompanon F et al. (2007) Power and limitations of the chloroplast trnL (UAA) intron for plant DNA barcoding. *Nucleic Acids Res* 35(3):e14. doi:10.1093\u002Fnar\u002Fgkl938\n\n## Related Skills\n\n- ecological-genomics\u002Fbiodiversity-metrics - Diversity analysis from species occurrence tables (Hill numbers, beta partition)\n- ecological-genomics\u002Fcommunity-ecology - Environmental gradient analysis of community composition (PERMANOVA + PERMDISP, ordination)\n- microbiome\u002Famplicon-processing - 16S clinical microbiome alternative pipeline\n- read-qc\u002Fquality-reports - Upstream read-quality assessment before primer trimming\n- database-access\u002Fentrez-fetch - Retrieve reference sequences for custom taxonomy databases\n","## Version Compatibility\n\nReference examples tested with: DADA2 1.30+, cutadapt 4.7+, OBITools3 (Python 3), decontam 1.20+, microDecon 1.0+, occumb 1.0+, vsearch 2.27+, swarm 3.1+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# eDNA Metabarcoding\n\n**\"Process eDNA samples to identify species present\"** -> Trim primers, denoise to ASVs (or cluster to OTUs), detect chimeras, assign taxonomy, filter contamination with negative controls AND DNA concentration, decompose tag-jumping artifacts, and quantify detection uncertainty via site-occupancy modeling. For the foundational eDNA-for-wildlife review, see Bohmann et al. 2014 *Trends Ecol Evol* 29:358-367.\n- CLI: `cutadapt` for primer removal (linked-adapter mode)\n- R: `dada2::filterAndTrim()` -> `dada()` -> `assignTaxonomy()` for ASV pipeline\n- CLI: `obi stats` \u002F `obi clean` \u002F `obi ecotag` for OBITools3 (NOTE: v3 plural commands)\n- R: `decontam::isContaminant()` for contamination screening\n- R: `occumb::occumb()` for detection-corrected occurrence\n\n## The Single Most Important Modern Insight -- Read Counts Are NOT Abundance\n\nElbrecht & Leese 2015 *PLoS One* 10:e0130324 and Lamb et al. 2019 *Mol Ecol* 28:420-430 (meta-analysis) established that metabarcoding read counts have weak-to-moderate, taxon-specific, NONLINEAR correlation with biomass or DNA input. Primer-binding bias dominates; PCR replicates introduce stochasticity. **Reporting read counts as abundance without mock-community calibration is malpractice.** Modern practice: report PRESENCE\u002FABSENCE or relative abundance with explicit calibration; use multiple PCR replicates; apply site-occupancy models for detection correction.\n\nA second cornerstone: the ASV-vs-OTU debate is taxon-specific, not universal. Callahan, McMurdie, Holmes 2017 *ISME J* 11:2639-2643 argued ASVs replace OTUs because modern denoising resolves single-nucleotide differences. Schloss 2021 *mSphere* 6:e00191-21 showed that for bacterial 16S with 1-15 intra-genomic rRNA copies, a single E. coli strain produces ~7 distinct ASVs, splitting bacterial genomes across artificial clusters. **For COI metazoan metabarcoding, ASVs (DADA2\u002FUNOISE3) are recommended; for bacterial 16S, ASVs inflate alpha-diversity and OTUs may be appropriate.**\n\nA third: **decontam (Davis 2018) is a SCREENING tool, not a deterministic classifier.** It flags candidates; biological plausibility check is required before deletion. The default `threshold=0.1` over-flags in low-biomass data.\n\n## Algorithmic Taxonomy\n\n| Method | Output | Strength | Fails when |\n|--------|--------|----------|------------|\n| DADA2 | Single-nucleotide ASVs | High resolution; learned error model; standard for COI\u002F12S\u002F18S\u002Ffungal-ITS | Small datasets (\u003C 100 samples) for error learning; multi-copy bacterial rRNA |\n| UNOISE3 (USEARCH\u002FVSEARCH; Edgar 2016) | zOTUs (essentially ASVs) | Fast; algorithmic simplicity | Limited Linux\u002FMac binary distribution under license |\n| Swarm v2 `-d 1 --fastidious` (Mahé 2015) | Abundance-weighted single-linkage OTUs | Modern OTU pipeline; better than legacy 97% UCLUST | OTUs by design (not single-nt resolution) |\n| 97% UCLUST | Classical OTUs | Legacy familiarity | Biologically arbitrary threshold; supersedes by DADA2\u002Fswarm |\n| VSEARCH global pairwise | Taxonomic assignment via best-hit | Fast, transparent, no training | Conservative; mis-assigns sister species when ref incomplete |\n| Naive Bayes (q2-feature-classifier, RDP) | Probabilistic taxonomic assignment | Probabilistic confidence; standard for 16S | Confidence values are scikit-learn calibrated, not true probabilities (Bokulich 2018) |\n| SINTAX (Edgar) | Bootstrap-supported taxonomy | Fast; no training | Less accurate than Naive Bayes for divergent sequences |\n| LCA (BASTA, MEGAN-LCA) | Lowest common ancestor of multiple hits | Conservative; never over-confident | Can over-merge to high taxonomic ranks |\n| Phylogenetic placement (EPA-ng + gappa) | Position on reference tree | Most rigorous; phylogenetically explicit | 10-100x slower; emerging not yet standard |\n| decontam | Flagged contaminant candidates | Statistical screening of negative controls and DNA concentration patterns | Output is screening, not classification; needs biological-plausibility check |\n| UCHIME3 (in DADA2\u002FVSEARCH) | Chimera detection | Standard for de novo chimera removal | Some divergent chimeras escape |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|---------------------|-----|\n| Metazoan COI metabarcoding (water, gut content) | mlCOIintF\u002FjgHCO2198 (Leray 2013) primers; DADA2 ASVs | Standard primer set; ASVs preserve single-nt resolution |\n| Fish eDNA from water | MiFish-U\u002FE (Miya 2015) 12S primers; DADA2 ASVs | Dominant eDNA fish marker globally |\n| Freshwater macroinvertebrate bioassessment | BF1\u002FBR1 freshwater-optimized COI primers | Higher primer-binding inclusivity for aquatic insects |\n| Bacterial community 16S | 515F\u002F806R (V4) Parada modified; ASVs OR Swarm v2 | Schloss 2021 caveat applies; ASVs may oversplit multi-copy rRNA |\n| Fungal community ITS | ITS2 primers; DADA2 or UNITE pipeline | UNITE is curated for fungal ITS |\n| Plant community DNA | trnL P6 loop (Taberlet 2007) for degraded DNA | Robust to degradation |\n| Deciding ASV vs OTU | ASVs for COI\u002F12S\u002F18S\u002Ffungi; OTU consideration for 16S with multi-copy concern | Taxon-specific |\n| NovaSeq library (patterned flow cell) | Heavier tag-jumping correction; expect 10x higher rates than MiSeq | Patterned-cell index hopping |\n| Low-biomass eDNA (deep ocean, ancient) | decontam frequency + prevalence methods; explicit reagent-contamination check | Reagent contamination dominates |\n| Quantitative comparison across samples | Mock-community calibration BEFORE reporting read counts | Without mock, read counts are biased estimators of biomass |\n| Detection probability with replication | Site-occupancy models (occumb, eDNAoccupancy; Ficetola 2015) | Read counts alone underestimate occurrence; replicates correct |\n| Taxonomic assignment for marker > 80% covered | Naive Bayes (q2-feature-classifier) | Probabilistic; well-supported |\n| Taxonomic assignment for sparse reference | Phylogenetic placement (EPA-ng) | Robust to incomplete references |\n| OBITools3 pipeline | `obi stats` (NOTE: plural), DMS-based, `.tar.gz` taxonomy | v3 syntax differs from v1 |\n\n## Primer Trimming with cutadapt\n\n**Goal:** Remove primer sequences while discarding reads that lack primers, before quality filtering.\n\n**Approach:** Use cutadapt linked-adapter mode with marker-specific 5' and 3' primer pairs. `--discard-untrimmed` removes reads lacking expected primers; `min_overlap` prevents false primer detection in random sequence regions.\n\n```bash\n# COI metazoan (Leray mlCOIintF \u002F jgHCO2198 -> 313 bp)\ncutadapt -g 'GGWACWGGWTGAACWGTWTAYCCYCC;min_overlap=20' \\\n         -G 'TAIACYTCIGGRTGICCRAARAAYCA;min_overlap=20' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n\n# Fish 12S (MiFish-U -> 163-185 bp)\ncutadapt -g 'GTCGGTAAAACTCGTGCCAGC;min_overlap=18' \\\n         -G 'CATAGTGGGGTATCTAATCCCAGTTTG;min_overlap=18' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n\n# Fungal ITS2\ncutadapt -g 'GTGAATCATCGAATCTTTGAAC;min_overlap=18' \\\n         -G 'TCCTCCGCTTATTGATATGC;min_overlap=18' \\\n         --discard-untrimmed --pair-filter=any \\\n         -o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \\\n         raw_R1.fastq.gz raw_R2.fastq.gz\n```\n\n## DADA2 ASV Pipeline\n\n**Goal:** Denoise paired-end amplicon reads into exact amplicon sequence variants (ASVs) with chimera removal and reference-based taxonomy assignment, per Callahan et al. 2016 *Nat Methods* 13:581-583.\n\n**Approach:** Filter to length\u002Fquality thresholds, learn error rates per dataset, run dada() to denoise, merge pairs, build sequence table, remove chimeras with UCHIME3-equivalent in DADA2, then assign taxonomy against the marker-appropriate reference DB. CRITICAL: primers must be removed (cutadapt) BEFORE filterAndTrim, OR the error model is corrupted.\n\n```r\nlibrary(dada2)\n\n# CRITICAL: primer removal MUST precede filterAndTrim\n# DADA2's error model assumes primer-free reads\nfwd_reads \u003C- sort(list.files('primer_trimmed\u002F', pattern = '_R1', full.names = TRUE))\nrev_reads \u003C- sort(list.files('primer_trimmed\u002F', pattern = '_R2', full.names = TRUE))\nfilt_fwd \u003C- file.path('filtered', basename(fwd_reads))\nfilt_rev \u003C- file.path('filtered', basename(rev_reads))\n\n# Filter and trim\n# maxEE=c(2,2): expected errors per read; tradeoff sensitivity\u002Fspecificity\n# truncLen: set from quality profile inspection; do not guess\nout \u003C- filterAndTrim(fwd_reads, filt_fwd, rev_reads, filt_rev,\n                     maxN = 0, maxEE = c(2, 2), truncQ = 2,\n                     truncLen = c(220, 180),     # data-dependent; inspect plotQualityProfile()\n                     minLen = 100, rm.phix = TRUE, multithread = TRUE)\n\n# Learn error rates\n# For small datasets (\u003C 100 samples), pool aggressively or use pre-learned model\nerr_fwd \u003C- learnErrors(filt_fwd, multithread = TRUE)\nerr_rev \u003C- learnErrors(filt_rev, multithread = TRUE)\n\n# Denoise\ndada_fwd \u003C- dada(filt_fwd, err = err_fwd, multithread = TRUE)\ndada_rev \u003C- dada(filt_rev, err = err_rev, multithread = TRUE)\n\n# Merge pairs with minimum overlap\nmerged \u003C- mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev, minOverlap = 12)\n\n# Build sequence table\nseqtab \u003C- makeSequenceTable(merged)\n\n# Remove chimeras\n# method='consensus': per-sample then consensus; conservative (default)\n# method='pooled': pooled across samples; aggressive; can over-merge real diversity\n# Chimera rate >30% typically indicates library prep problems\nseqtab_nochim \u003C- removeBimeraDenovo(seqtab, method = 'consensus',\n                                     multithread = TRUE)\ncat('Chimera rate:', round(1 - sum(seqtab_nochim) \u002F sum(seqtab), 3), '\\n')\n\n# Taxonomy assignment\n# minBoot=80: standard genus-level confidence; 50 for family-level\n# IMPORTANT: pair the marker with the appropriate reference DB\n# COI -> MIDORI2 LONGEST_NUC_GB259_CO1 (or BOLD with curation)\n# 12S -> MitoFish (Miya lab)\n# 16S V4 -> SILVA 138.1+\n# 18S V4\u002FV9 -> SILVA 138.1+ or PR2\n# Fungal ITS -> UNITE 9.0+\ntaxa \u003C- assignTaxonomy(seqtab_nochim,\n                       'MIDORI2_LONGEST_NUC_GB259_CO1_DADA2.fasta.gz',\n                       minBoot = 80, multithread = TRUE)\n```\n\n## OBITools3 Pipeline — The v1 -> v3 Command Break\n\n**Goal:** Process eDNA reads through the Unix-style OBITools v3 pipeline (Boyer et al. 2016 *Mol Ecol Resour* 16:176-182 introduced OBITools v1; v3 is the post-2018 Python 3 rewrite) with DMS-based sequence management.\n\n**Approach:** v3 introduces a Database Management System (DMS) abstraction; sequences are imported into a DMS rather than read directly from FASTQ. Commands use spaces (e.g., `obi stats` plural, not `obistat`). Taxonomy import expects `.tar.gz` archive, not a directory.\n\n```bash\n# v1 -> v3 command-name changes (critical):\n# v1: obistat       -> v3: obi stats\n# v1: obigrep       -> v3: obi grep\n# v1: obiuniq       -> v3: obi uniq\n# v1: obitab        -> v3: obi annotate \u002F obi export --tab-output (different semantics)\n# v1: ngsfilter     -> v3: obi ngsfilter\n# v1: taxdump dir   -> v3: .tar.gz archive\n\n# Import paired FASTQ into DMS\nobi import --fastq-input raw_R1.fastq.gz EDNA\u002Freads1\nobi import --fastq-input raw_R2.fastq.gz EDNA\u002Freads2\n\n# Paired-end alignment\nobi alignpairedend -R EDNA\u002Freads2 EDNA\u002Freads1 EDNA\u002Faligned\n\n# Filter by alignment score and length\nobi grep -p 'sequence[\"score\"] >= 50' EDNA\u002Faligned EDNA\u002Ffiltered\nobi grep -p 'len(sequence) >= 100 and len(sequence) \u003C= 500' \\\n    EDNA\u002Ffiltered EDNA\u002Flength_filtered\n\n# Demultiplex (NGS filter file maps barcodes -> samples)\nobi ngsfilter -t ngsfilter.txt -u EDNA\u002Funassigned \\\n    EDNA\u002Flength_filtered EDNA\u002Fdemux\n\n# Dereplicate (obi uniq creates merged_sample attribute automatically)\nobi uniq EDNA\u002Fdemux EDNA\u002Fderep\n\n# Remove suspected error singletons\nobi grep -p 'sequence[\"count\"] >= 2' EDNA\u002Fderep EDNA\u002Fno_singletons\n\n# Denoise via obi clean\nobi clean -s merged_sample -r 0.05 -H EDNA\u002Fno_singletons EDNA\u002Fdenoised\n\n# Taxonomy assignment against reference database\nobi ecotag -R EDNA\u002Frefdb --taxonomy EDNA\u002Ftaxonomy EDNA\u002Fdenoised EDNA\u002Fassigned\n\n# Export tab-separated species table\nobi export --tab-output EDNA\u002Fassigned > species_table.tsv\n```\n\nAcross most metabarcoding studies, 50-85% of ASVs cannot be assigned to species level due to incomplete references (Wangensteen et al. 2018 *PeerJ* 6:e4705 documented this for marine COI + 18S). Report this gap honestly; do not infer ecology from \"unassigned\" reads.\n\n## Tag-Jumping Mitigation — Schnell 2015 + NovaSeq Caveat\n\n**Goal:** Detect and remove sequence-to-sample misassignments arising from chimeric library molecules with mismatched indices.\n\n**Approach:** Use dual-indexing (different indices at both ends; cross-jumped pairs are discarded). Quantify residual tag-jumping rate from per-ASV cross-sample appearance and apply per-ASV abundance threshold filtering with `metabaR::tagjumpslayer`. For NovaSeq libraries, expect ~10x higher tag-jumping than MiSeq due to patterned flow cells.\n\n```r\nlibrary(metabaR)\n\n# metabaR expects an metabarlist object (asv table + sample info + ngsfilter)\n# tagjumpslayer applies per-ASV abundance-threshold filter\n# threshold: 0.01 (1% of ASV total) is conservative; 0.001 for aggressive removal\n# Adjust threshold higher for NovaSeq (~0.005-0.01) than MiSeq (~0.001-0.005)\n\n# Quantify residual tag-jumping rate before filtering:\n# Count reads in sample x ASV combinations that should be 0 by experimental design\n# (e.g., samples explicitly excluded from a particular condition)\n# That rate \u002F total reads = empirical tag-jumping rate\n# Report this rate in methods section\n```\n\n## Contamination Screening with decontam\n\n**Goal:** Identify candidate contaminant ASVs from negative controls and DNA-concentration patterns.\n\n**Approach:** Use `decontam::isContaminant` with `method='combined'` when both DNA concentration AND negative controls are available. Treat flagged ASVs as SCREENING CANDIDATES; verify biological plausibility before deletion. The default `threshold=0.1` is over-aggressive in low-biomass data.\n\n```r\nlibrary(decontam)\n\n# Frequency method: contaminants more frequent at LOW DNA concentration\n# Prevalence method: contaminants more frequent in negative controls\n# Combined: uses both signals (most robust)\n\ncontam \u003C- isContaminant(seqtab_nochim,\n                        conc = dna_concentration,        # qPCR or Qubit per sample\n                        neg = is_negative_control,       # logical: which samples are controls\n                        method = 'combined',\n                        threshold = 0.1)                 # default; lower for high-confidence calls\n\n# CRITICAL: decontam output is SCREENING, not classification\n# Manually inspect each flagged ASV: is the taxonomic assignment plausibly a reagent contaminant?\n# Common reagent contaminants: Delftia, Sphingomonas, Burkholderia, Propionibacterium\nflagged \u003C- which(contam$contaminant)\ncat('Decontam flagged', length(flagged), 'ASVs as candidates\\n')\n\n# After manual review, remove confirmed contaminants\nconfirmed_contam \u003C- intersect(flagged, biological_plausibility_check_result)\nseqtab_clean \u003C- seqtab_nochim[, !(colnames(seqtab_nochim) %in% confirmed_contam)]\n```\n\n## Site-Occupancy Modeling — Correcting for Imperfect Detection\n\n**Goal:** Estimate true species occurrence probabilities from replicated eDNA samples, accounting for false negatives in any single PCR replicate.\n\n**Approach:** Fit a multi-species occupancy model via MCMC (Ficetola 2015 *Mol Ecol Resour* 15:543-556) on a 3D array of replicated read counts. Output: per-site, per-species occupancy probabilities corrected for detection.\n\n```r\nlibrary(occumb)\n\n# y: 3D array [species, sites, replicates] of read counts\n# spec_cov: species covariates (traits)\n# site_cov: site covariates (env)\ndata_obj \u003C- occumbData(y = count_array, spec_cov = species_covariates,\n                       site_cov = site_covariates)\n\n# Fit hierarchical occupancy model\n# Requires JAGS installation\n# n.iter >= 10000, n.burn >= 2500 for publication-quality posteriors\nfit \u003C- occumb(data = data_obj, n.chains = 4, n.iter = 10000,\n              n.thin = 5, n.burn = 2500)\n\n# Extract detection-corrected occupancy\nsummary(fit)\n```\n\n## Per-Method Failure Modes\n\n### Reporting read counts as biomass without mock-community calibration\n\n**Trigger:** Comparing read counts of two ASVs and reporting the ratio as a biomass \u002F abundance estimate.\n\n**Mechanism:** Primer-template binding affinity varies systematically across taxa; PCR amplification is non-linear (saturates); read counts have weak-to-moderate, NONLINEAR correlation with biomass (Elbrecht 2015; Lamb 2019).\n\n**Symptom:** Reviewer asks \"how is it known that reads = biomass?\"; cross-study quantitative comparisons fail to replicate.\n\n**Fix:** Either (a) restrict reporting to presence\u002Fabsence; (b) report read counts as relative abundances with explicit caveat; or (c) include mock-community of known composition for primer-specific calibration. Do not silently equate reads with biomass.\n\n### NovaSeq tag-jumping with MiSeq-tuned filtering\n\n**Trigger:** Applying tag-jumping filters calibrated on MiSeq libraries to NovaSeq data.\n\n**Mechanism:** NovaSeq patterned flow cells have ~10x higher index hopping than MiSeq. MiSeq-calibrated thresholds (often ~0.001 fraction) are too permissive on NovaSeq data.\n\n**Symptom:** Apparent rare-species detections in NovaSeq libraries do not replicate; per-ASV cross-sample appearance is unusually broad.\n\n**Fix:** Use NovaSeq-appropriate tag-jumping thresholds (~0.005-0.01) and report the empirical tag-jumping rate from explicit-zero combinations.\n\n### decontam threshold over-aggressive in low-biomass data\n\n**Trigger:** Applying default `threshold = 0.1` to ASVs from open-ocean water, ancient sediments, or other dilute samples.\n\n**Mechanism:** In low-biomass samples, the contaminant signal\u002Fbackground ratio approaches 1; decontam over-flags real but dilute biology as \"contaminant\" because the statistical pattern looks similar.\n\n**Symptom:** Many ASVs flagged from low-biomass samples; taxonomic profile of \"flagged contaminants\" looks biologically realistic.\n\n**Fix:** Lower threshold (0.05 or 0.01); always manually review flagged ASVs for biological plausibility; cite Salter 2014 *BMC Biol* 12:87 for the low-biomass reagent-contamination caveat.\n\n### Skipping primer removal before DADA2 filterAndTrim\n\n**Trigger:** Running DADA2's `filterAndTrim()` on FASTQ files that still contain primer sequences.\n\n**Mechanism:** DADA2 learns sequencing error from the empirical data; if primer sequences are present, they look like \"perfect agreement\" and corrupt the error model. ASVs are inferred with primer artifacts attached.\n\n**Symptom:** DADA2 reports \"phix-like contamination\" (false; it's primers); ASVs start with the primer sequence; chimera rate elevated.\n\n**Fix:** Always run cutadapt (or similar) BEFORE filterAndTrim. Verify with `head` of trimmed FASTQ that primer sequences are gone.\n\n### OBITools v3 commands with v1 syntax\n\n**Trigger:** Running `obistat` or `obigrep` on a v3 install.\n\n**Mechanism:** v1 used concatenated command names (`obistat`); v3 uses subcommand syntax with a space (`obi stats` — note plural).\n\n**Symptom:** Bash error `obistat: command not found`; tutorial documentation does not match installed version.\n\n**Fix:** Use `obi \u003Csubcommand>` syntax; consult `obi --help` for current command list. Taxonomy import requires `.tar.gz` archive, not unpacked directory.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F rationale |\n|-----------|-------|-------------------|\n| DADA2 maxEE per read | 2 | Standard sensitivity\u002Fspecificity balance |\n| DADA2 chimera rate alarm | > 30% suggests library issues | Empirical convention |\n| DADA2 minBoot for taxonomy | 80 for genus; 50 for family | Standard confidence cutoffs |\n| Tag-jumping filter MiSeq | 0.001-0.005 fraction of ASV total | Schnell 2015 |\n| Tag-jumping filter NovaSeq | 0.005-0.01 fraction of ASV total | Patterned-cell index hopping ~10x higher |\n| decontam threshold | 0.1 default; 0.05 for low-biomass | Davis 2018; reduce for dilute samples |\n| Per-sample minimum reads | 1000 (after filtering) | Below this rare-species detection unreliable |\n| Singleton removal | count >= 2 | Singletons often error-driven |\n| Bootstrap nperm for tests | 999 | Standard permutation count |\n| Occupancy model iterations | n.iter >= 10000, n.burn >= 2500 | occumb default for stable posteriors |\n| eDNA decay (20 deg C surface water) | half-life ~4-15 hours | Strickler 2015 Biol Conserv 183:85-92 |\n\n## Common errors\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `obistat: command not found` | OBITools v3 uses `obi stats` (plural) | Use v3 syntax |\n| DADA2 error rate plot looks pathological | Primer sequences still in reads | Re-run cutadapt before filterAndTrim |\n| Chimera rate > 30% | Library-prep issue or primer dimers | Inspect raw FASTQ; check PCR conditions |\n| decontam flags many real species | Default threshold too aggressive for low-biomass | Lower threshold; manual review |\n| Naive Bayes confidence 0.95 but species is wrong | scikit-learn-calibrated \"confidence\" not true probability | Use phylogenetic placement for borderline assignments |\n| occumb JAGS not found error | JAGS not installed system-wide | Install JAGS (CRAN page has platform instructions) |\n| eDNA detections do not replicate | Read counts treated as abundance | Switch to presence\u002Fabsence; use mock-community calibration |\n| MIDORI2 download path expired | Database updated; old URL gone | Check current MIDORI2 \u002F MitoFish download page |\n\n## References\n\n- Callahan BJ, McMurdie PJ, Rosen MJ, Han AW, Johnson AJA, Holmes SP (2016) DADA2. *Nat Methods* 13(7):581-583. doi:10.1038\u002Fnmeth.3869\n- Callahan BJ, McMurdie PJ, Holmes SP (2017) Exact sequence variants should replace OTUs. *ISME J* 11(12):2639-2643. doi:10.1038\u002Fismej.2017.119\n- Edgar RC (2016) UNOISE2 \u002F UNOISE3. *bioRxiv* preprint. doi:10.1101\u002F081257\n- Mahe F, Rognes T, Quince C, de Vargas C, Dunthorn M (2015) Swarm v2. *PeerJ* 3:e1420. doi:10.7717\u002Fpeerj.1420\n- Leray M, Yang JY, Meyer CP et al. (2013) mlCOIintF\u002FjgHCO2198 metazoan COI primer. *Front Zool* 10:34. doi:10.1186\u002F1742-9994-10-34\n- Miya M, Sato Y, Fukunaga T et al. (2015) MiFish 12S fish eDNA primer. *R Soc Open Sci* 2(7):150088. doi:10.1098\u002Frsos.150088\n- Schnell IB, Bohmann K, Gilbert MTP (2015) Tag jumps illuminated. *Mol Ecol Resour* 15(6):1289-1303. doi:10.1111\u002F1755-0998.12402\n- Davis NM, Proctor DM, Holmes SP, Relman DA, Callahan BJ (2018) decontam. *Microbiome* 6:226. doi:10.1186\u002Fs40168-018-0605-2\n- Boyer F, Mercier C, Bonin A, Le Bras Y, Taberlet P, Coissac E (2016) OBITools. *Mol Ecol Resour* 16(1):176-182. doi:10.1111\u002F1755-0998.12428\n- Elbrecht V, Leese F (2015) DNA-based ecosystem quantification critique. *PLoS One* 10(7):e0130324. doi:10.1371\u002Fjournal.pone.0130324\n- Lamb PD, Hunter E, Pinnegar JK, Creer S, Davies RG, Taylor MI (2019) How quantitative is metabarcoding: meta-analysis. *Mol Ecol* 28(2):420-430. doi:10.1111\u002Fmec.14920\n- Ficetola GF, Pansu J, Bonin A et al. (2015) Replication levels and false presences in eDNA. *Mol Ecol Resour* 15(3):543-556. doi:10.1111\u002F1755-0998.12338\n- Wangensteen OS, Palacin C, Guardiola M, Turon X (2018) COI + 18S marine metabarcoding. *PeerJ* 6:e4705. doi:10.7717\u002Fpeerj.4705\n- Strickler KM, Fremier AK, Goldberg CS (2015) eDNA degradation kinetics. *Biol Conserv* 183:85-92. doi:10.1016\u002Fj.biocon.2014.11.038\n- Bokulich NA, Kaehler BD, Rideout JR et al. (2018) Optimizing taxonomic classification with q2-feature-classifier. *Microbiome* 6:90. doi:10.1186\u002Fs40168-018-0470-z\n- Bohmann K, Evans A, Gilbert MTP et al. (2014) eDNA for wildlife and biodiversity. *Trends Ecol Evol* 29(6):358-367. doi:10.1016\u002Fj.tree.2014.04.003\n- Schloss PD (2021) Amplicon sequence variants artificially split bacterial genomes into separate clusters. *mSphere* 6(4):e00191-21. doi:10.1128\u002FmSphere.00191-21\n- Salter SJ, Cox MJ, Turek EM et al. (2014) Reagent and laboratory contamination can critically impact sequence-based microbiome analyses. *BMC Biol* 12:87. doi:10.1186\u002Fs12915-014-0087-z\n- Taberlet P, Coissac E, Pompanon F et al. (2007) Power and limitations of the chloroplast trnL (UAA) intron for plant DNA barcoding. *Nucleic Acids Res* 35(3):e14. doi:10.1093\u002Fnar\u002Fgkl938\n\n## Related Skills\n\n- ecological-genomics\u002Fbiodiversity-metrics - Diversity analysis from species occurrence tables (Hill numbers, beta partition)\n- ecological-genomics\u002Fcommunity-ecology - Environmental gradient analysis of community composition (PERMANOVA + PERMDISP, ordination)\n- microbiome\u002Famplicon-processing - 16S clinical microbiome alternative pipeline\n- read-qc\u002Fquality-reports - Upstream read-quality assessment before primer trimming\n- database-access\u002Fentrez-fetch - Retrieve reference sequences for custom taxonomy databases\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","mixed","2026-09-20","ecological-genomics\u002Fedna-metabarcoding\u002FSKILL.md","dada2","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-ecological-genomics-edna-metabarcoding",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-ecological-genomics-edna-metabarcoding",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-ecological-genomics-edna-metabarcoding","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding\u002FSKILL.md",true,[50,56,62],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fdada2_edna_coi.R","OTHER","其他",6124,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding\u002Fexamples\u002Fdada2_edna_coi.R",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Fobitools3_edna_pipeline.sh","SCRIPT","脚本",3513,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding\u002Fexamples\u002Fobitools3_edna_pipeline.sh",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"usage-guide.md","REFERENCE","参考文档",9294,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-edna-metabarcoding\u002Fusage-guide.md",[69,77,84,91,98,105],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":76},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":76},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":76},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]