This repository contains the raw data and analysis code underlying:
Characterizing mitochondrial copy number variation and PCR amplification bias as sources of quantitative constraints in DNA metabarcoding
The script supporting information/supporting information 10.py reproduces the entire quantitative analysis of the paper end to end — from the raw qPCR, ddPCR and metabarcoding read data to every figure, table, and supporting information file reported in the manuscript.
├── figures/ Figures 2–4 (.pdf/.png)
├── tables/ Table 1 and Table 2 (.xlsx)
├── supporting information/ Input data, the analysis script, and all SI outputs
└── pcr_simulator/ Standalone PCR/metabarcoding simulator (HTML)
The interactive simulator in pcr_simulator/ is hosted via GitHub Pages and can be used directly in the browser, no download required:
- Python ≥ 3.11
- Packages listed in
requirements.txt(exact versions used to generate the results reported in the paper)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtThe script locates its input files and writes its outputs relative to its own location, so it can be run from any working directory:
python "supporting information/supporting information 10.py"Figures are written to figures/, tables to tables/, and all other outputs to supporting information/, regardless of where the command is run from.
Runtime is a few minutes on a standard laptop. Console output includes read-filtering statistics and Wilcoxon signed-rank test results for the aliquot/replicate reproducibility checks reported in the text.
Located in supporting information/:
| File | Content |
|---|---|
supporting information 1.xlsx |
Expected community composition and biomass per sample |
supporting information 3.xlsx |
qPCR primer validation results |
supporting information 5.xlsx |
ddPCR raw mtDNA copy number measurements |
supporting information 6.parquet.snappy |
Raw metabarcoding read counts |
supporting information 2.xlsx (ddPCR primer/probe sequences) is included for reference but is not read by the script.
Running the script (re-)generates the following files:
- Figures (in
figures/):figure 2.pdf,figure 3.pdf/.png,figure 4.pdf/.png - Tables (in
tables/):table 1.xlsx,table 2.xlsx - Supporting information (in
supporting information/):supporting information 4.pdf,7.pdf,8.pdf,9.xlsx,11.xlsx,12.pdf,13.pdf,14.pdf,15.xlsx,18.pdf/.png,19.xlsx,20.pdf/.png,21.xlsx,22.pdf/.png
All other supporting information files (e.g. SI 16, 17) were prepared independently of this script and are provided as-is.
supporting information 10.py is organized as a sequence of functions called from main(), each documented with a docstring explaining its purpose:
- qPCR validation — heatmap of primer specificity per insect order (SI 4)
- Metabarcoding processing — read aggregation, relative-abundance conversion, aliquot reproducibility (SI 7)
- ddPCR processing — relative copy numbers, replicate reproducibility (SI 8)
- Data merge — combines reads, copy numbers, and biomass into one master table (SI 9)
- Fold-change / rank concordance — agreement between the three measurement types (Figure 2, Table 1, SI 11–14)
- Bias model comparison — no correction vs. cycle calibration (Shelton et al. 2023) vs. cycle-dependent vs. constant bias correction (Figures 3–4, Table 2, SI 15, 18–22)
See the docstrings in the script itself for full methodological detail on each step.
This code is released under the MIT License.