Pipeline Overview

This pipeline takes a TSV export from any of our extremophile databases (GlaciaBase, TardiBase, or ExtremoDex) and processes the sequencing runs through a fully automated workflow. The critical first step is classifying each run as WGS (whole-genome shotgun) or 16S amplicon, because these two data types require fundamentally different analysis approaches and produce different kinds of biological insight.

What the Pipeline Does

1. Data Download — Uses the SRA Toolkit (prefetch + fasterq-dump) to download raw FASTQ files from NCBI for each SRR accession in your input file.
2. Classification — Reads the ASSAY_TYPE column from your export to route each run to the correct branch. Runs labeled AMPLICON go to the 16S pipeline; runs labeled WGS go to the shotgun metagenome assembly pipeline.
3. Quality Control — Both branches start with fastp for adapter trimming, quality filtering, and per-base quality reporting.
4. Branch-specific analysis — WGS runs get assembled into contigs and binned into MAGs; amplicon runs get denoised into ASVs and classified taxonomically.

Software Requirements

SRA Toolkit
fastp
MEGAHIT
MetaBAT2
samtools + minimap2
CheckM2
GTDB-Tk
QIIME2 (conda)
SILVA classifier

Shared   WGS only   Amplicon only

Pipeline Flowchart

The pipeline splits at the classification step. Each branch uses purpose-built tools for its data type.

TSV Input File
SRR · BioProject · Assay · Organism
SRA Toolkit
prefetch + fasterq-dump
Classify Run Type
AMPLICON vs WGS
fastp QC
adapter trim · quality filter · report
routes to branch
WGS (Shotgun)
MEGAHIT
de novo metagenome assembly
minimap2 + samtools
coverage depth calculation
MetaBAT2
genome binning → MAGs
CheckM2
MAG quality (MIMAG standard)
GTDB-Tk
taxonomic classification
MAGs + Taxonomy
high-quality genome bins
16S Amplicon
QIIME2 Import
Casava 1.8 format
DADA2 Denoise
ASV table + rep sequences
SILVA Classifier
taxonomic assignment
Diversity Analysis
alpha + beta diversity
ASV Table + Taxonomy
community composition

16S Amplicon vs. Whole-Genome Shotgun (WGS)

This distinction is one of the most important decisions in metagenomics. The two approaches generate fundamentally different kinds of data, and using the wrong analysis on the wrong data type will produce misleading or meaningless results.

Why This Matters

16S rRNA amplicon sequencing targets a single conserved gene (~1,500 bp) to identify which organisms are present in a community. It tells you who is there and in what proportions, but it gives you almost no information about the functional gene content of those organisms. You cannot do ortholog analysis, functional pathway reconstruction, or genome assembly from 16S data — there simply isn't enough genomic information in a single marker gene.

Whole-genome shotgun (WGS) metagenomics sequences random fragments from all genomic DNA in the sample. This gives you both taxonomic composition AND functional information — you can assemble genomes (MAGs), identify genes, reconstruct metabolic pathways, and perform ortholog analysis across species. WGS is the only approach that supports genome-level analysis.

Comparison

Feature WGS Shotgun 16S Amplicon
Target All genomic DNA in sample 16S rRNA gene only (~1.5 kb)
Taxonomic resolution Species / strain level Genus level (sometimes species)
Genome assembly Yes — MAGs via binning No — not enough info
Ortholog analysis Yes No — insufficient data
Functional pathways Yes — gene prediction + annotation No — only taxonomy
Cost per sample Higher (deeper sequencing needed) Lower (targeted amplification)
PCR bias Minimal Yes — primer bias
Detects viruses Yes No — no 16S in viruses
Eukaryote detection Yes Limited — 18S/ITS needed
Best for Functional genomics, MAGs, comparative genomics Community surveys, biodiversity, rapid profiling

How the Pipeline Handles This

The pipeline reads the ASSAY_TYPE column from your database export. GlaciaBase, TardiBase, and ExtremoDex all annotate runs with their assay type (AMPLICON or WGS) based on NCBI SRA metadata. The pipeline uses this annotation to automatically route each run to the correct analysis branch — no manual sorting required.

Runs classified as WGS get assembled with MEGAHIT, binned with MetaBAT2, quality-checked against the MIMAG standard (>90% complete, <5% contamination = high quality), and taxonomically classified with GTDB-Tk. Amplicon runs go through QIIME2/DADA2 for denoising into ASVs, SILVA for taxonomy, and standard alpha/beta diversity calculations.

Connected Databases

Export data from any of these databases to generate the TSV input file for the pipeline. Each database's Extract Data tab lets you select runs and download a TSV with the required columns (SRR accession, BioProject, assay type, organism).

Download & Usage

Download Pipeline Script (.sh)

Quick Start

# 1. Make the script executable chmod +x glaciabase_metagenome_pipeline.sh # 2. Export your data from GlaciaBase (Extract Data tab → TSV) # Make sure columns include: SRR_ACCESSION, BIOPROJECT, ASSAY_TYPE, ORGANISM # 3. Run the pipeline ./glaciabase_metagenome_pipeline.sh my_runs.tsv ./results # 4. (Optional) Configure threads and database paths THREADS=16 CHECKM2_DB=/path/to/checkm2db \ GTDBTK_DB=/path/to/gtdbtk_data \ SILVA_CLASSIFIER=/path/to/silva-138-99-nb-classifier.qza \ ./glaciabase_metagenome_pipeline.sh my_runs.tsv ./results

Output Structure

results/ ├── run_annotation_report.tsv # Which runs are WGS vs AMPLICON ├── raw/ # Downloaded FASTQ files ├── qc/ # fastp-cleaned reads + reports ├── wgs/ │ ├── {SRR}/assembly/ # MEGAHIT contigs │ ├── {SRR}/bins/ # MetaBAT2 genome bins (MAGs) │ ├── {SRR}/checkm2/ # Quality scores per MAG │ └── {SRR}/gtdbtk/ # Taxonomic classification ├── amplicon/ │ ├── {SRR}/qiime2/ # QIIME2 artifacts │ ├── {SRR}/taxonomy/ # SILVA classification │ └── {SRR}/diversity/ # Alpha + beta diversity └── logs/ # Per-run log files

Input File Format

The input is a tab-separated file with four columns. You can export this directly from any database's Extract Data tab, or create it manually:

# SRR_ACCESSION BIOPROJECT ASSAY_TYPE ORGANISM SRR3454536 SRP074055 AMPLICON soil metagenome SRR3454537 SRP074055 WGS soil metagenome SRR7654321 PRJNA901488 WGS marine metagenome SRR1234567 PRJNA555555 AMPLICON glacier metagenome