| name | bio-ecological-genomics-edna-metabarcoding |
| description | Processes environmental DNA metabarcoding data from raw amplicon reads to species occurrence tables using OBITools3, DADA2, and taxonomic assignment against BOLD, MIDORI2, or MitoFish databases. Handles COI, 12S, rbcL, and ITS barcode regions with primer removal, denoising, chimera detection, and contamination filtering via decontam. Includes occupancy modeling (occumb) for detection probability correction. Use when analyzing eDNA from water, soil, or bulk samples for biodiversity monitoring. Not for 16S human microbiome (see microbiome/amplicon-processing). |
| tool_type | mixed |
| primary_tool | obitools3 |
eDNA Metabarcoding
Processes environmental DNA amplicon reads into species occurrence tables with taxonomy assignment, contamination filtering, and occupancy modeling.
Primer Removal with Cutadapt
Linked adapter trimming removes primer pairs while discarding reads lacking primers:
cutadapt -g 'GGWACWGGWTGAACWGTWTAYCCYCC;min_overlap=20' \
-G 'TAIACYTCIGGRTGICCRAARAAYCA;min_overlap=20' \
--discard-untrimmed --pair-filter=any \
-o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \
raw_R1.fastq.gz raw_R2.fastq.gz
cutadapt -g 'GTCGGTAAAACTCGTGCCAGC;min_overlap=18' \
-G 'CATAGTGGGGTATCTAATCCCAGTTTG;min_overlap=18' \
--discard-untrimmed --pair-filter=any \
-o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \
raw_R1.fastq.gz raw_R2.fastq.gz
cutadapt -g 'CTTGGTCATTTAGAGGAAGTAA;min_overlap=18' \
-G 'GCTGCGTTCTTCATCGATGC;min_overlap=18' \
--discard-untrimmed --pair-filter=any \
-o trimmed_R1.fastq.gz -p trimmed_R2.fastq.gz \
raw_R1.fastq.gz raw_R2.fastq.gz
OBITools3 Pipeline
Full pipeline from paired-end reads to taxonomy table:
obi import --fastq-input raw_R1.fastq.gz EDNA/reads1
obi import --fastq-input raw_R2.fastq.gz EDNA/reads2
obi alignpairedend -R EDNA/reads2 EDNA/reads1 EDNA/aligned
obi grep -p 'sequence["score"] >= 50' EDNA/aligned EDNA/filtered
obi grep -p 'len(sequence) >= 100 and len(sequence) <= 500' \
EDNA/filtered EDNA/length_filtered
obi ngsfilter -t ngsfilter.txt -u EDNA/unassigned \
EDNA/length_filtered EDNA/demux
obi uniq EDNA/demux EDNA/derep
obi grep -p 'sequence["count"] >= 2' EDNA/derep EDNA/no_singletons
obi clean -s merged_sample -r 0.05 -H EDNA/no_singletons EDNA/denoised
obi ecotag -R EDNA/refdb --taxonomy EDNA/taxonomy EDNA/denoised EDNA/assigned
obi export --tab-output EDNA/assigned > species_table.tsv
DADA2 Pipeline for eDNA
DADA2 provides an alternative ASV-based approach:
library(dada2)
filt_fwd <- file.path('filtered', basename(fwd_reads))
filt_rev <- file.path('filtered', basename(rev_reads))
out <- filterAndTrim(fwd_reads, filt_fwd, rev_reads, filt_rev,
maxN = 0, maxEE = c(2, 2), truncQ = 2,
minLen = 100, rm.phix = TRUE, multithread = TRUE)
err_fwd <- learnErrors(filt_fwd, multithread
err_rev learnErrorsfilt_rev multithread
dada_fwd dadafilt_fwd err err_fwd multithread
dada_rev dadafilt_rev err err_rev multithread
merged mergePairsdada_fwd filt_fwd dada_rev filt_rev minOverlap
seqtab makeSequenceTablemerged
seqtab_nochim removeBimeraDenovoseqtab method multithread
taxa assignTaxonomyseqtab_nochim minBoot
Reference Databases
| Database | Markers | Format | Source |
|---|
| MIDORI2 | COI, 12S, 16S, 18S | DADA2, BLAST, OBITools | midori2.info |
| MitoFish | 12S (fish) | DADA2, BLAST | mitofish.aori.u-tokyo.ac.jp |
| BOLD | COI | FASTA, API | boldsystems.org |
| SILVA | 18S | DADA2, mothur | silva-project.net |
| UNITE | ITS (fungi) | DADA2, BLAST | unite.ut.ee |
Formatting a custom FASTA for DADA2 taxonomy assignment:
wget https://reference-midori.info/download/Databases/MIDORI2_DADA2/COI/MIDORI2_LONGEST_NUC_GB259_CO1_DADA2.fasta.gz
Contamination Filtering
decontam (frequency/prevalence method)
library(decontam)
contam_freq <- isContaminant(seqtab_nochim, conc = dna_concentration, method = 'frequency')
contam_prev <- isContaminant(seqtab_nochim, neg = is_negative_control, method = 'prevalence',
threshold = 0.5)
contam_both <- isContaminant(seqtab_nochim, conc = dna_concentration,
neg = is_negative_control, method = 'both')
seqtab_clean <- seqtab_nochim[, !contam_both$contaminant]
microDecon for tag-jumping artifacts
library(microDecon)
decon_result <- decon(otu_table, numb.blanks = 3, numb.ind = c(10, 10, 10))
cleaned_table <- decon_result$decon.table
Occupancy Modeling with occumb
Corrects for imperfect detection in metabarcoding replicates:
library(occumb)
data <- occumbData(y = count_array, spec_cov = species_covariates,
site_cov = site_covariates)
fit <- occumb(data = data, n.chains = 4, n.iter = 10000, n.thin = 5, n.burn = 2500)
summary(fit)
Key Thresholds
| Parameter | Value | Rationale |
|---|
| Min read depth per sample | 1,000 | Below this, rare species detection drops significantly |
| Singleton removal | count >= 2 | Singletons often represent sequencing errors |
| Chimera rate | <20% | Higher rates suggest library prep problems |
| COI species identity | >= 97% | Standard COI barcode gap threshold |
| COI genus identity | >= 95% | Conservative genus-level assignment |
| 12S species identity | >= 98% | 12S has less divergence than COI |
| decontam threshold | 0.5 | Balanced false positive/negative rate |
| DADA2 minBoot | 80 | Genus-level confidence; use 50 for family |
Related Skills
- biodiversity-metrics - Diversity analysis from species occurrence tables
- community-ecology - Environmental gradient analysis of communities
- microbiome/amplicon-processing - 16S clinical microbiome alternative
- read-qc/quality-reports - Upstream read quality assessment