SEPIA · data & pipeline

Living record · started 23 Jul 2026

The data, and what we do to it

What the raw archaic data actually is, the difference between reads (BAM) and genotype calls (VCF), what the pipeline transforms, and a running log we update as we rebuild.

Companion to the roadmap. Full audit of the original pipeline: plan/pipeline_workbook.md. Bug evidence: BUG_EVIDENCE.md. Rebuild plan: rebuild_from_raw.md.
01

BAM vs VCF — reads vs. conclusions

The single most important distinction for understanding this project's data. Every archaic individual can exist as either (or both), and they are not interchangeable.

BAM
Binary Alignment Map
The actual sequencing reads — every short DNA fragment, placed ("aligned") on the reference genome, carrying per-base quality, mapping quality, and the ancient-DNA damage still visible at read ends. Large (GBs). From a BAM you can re-derive coverage, assess damage, and (re-)call genotypes any way you like. The raw-ish evidence.
VCF
Variant Call Format
The genotype conclusions drawn from a BAM: at chosen positions, "this individual is A/G", plus depth/quality annotations. Small (MBs). You cannot recover the underlying reads or the damage signal from a VCF — the read-level information is gone. A derived summary.

The analogy

A BAM is all the raw crime-scene photographs from every angle — you can re-measure anything later. A VCF is the detective's written findings ("at spot X the allele is G"). Once you keep only the VCF, you can't go back and re-examine the photos. This is exactly why mapDamage, a max-depth filter, and any transversion/transition handling need BAMs — they read the photographs; a VCF has already thrown them away.

02

The raw public data

The archaic genomes are published — as BAMs aligned to hg19/GRCh37 — in two public archives: MPI-EVA (Max Planck, ftp.eva.mpg.de) and EBI-ENA (ftp.sra.ebi.ac.uk). Lily's pipeline started from these BAMs and called its own genotypes. Sources marked "confirm" are being recovered in Stage 0 of the rebuild.

BAMs only — no FASTQ (confirmed from thesis §2.3)

The archaic data was taken as BAM files "previously mapped to the GRCh37/hg19 reference" — i.e. the reads were already aligned by the original data producers; Lily did no alignment, adapter-trimming, or read-collapsing herself, and there was no FASTQ. The modern SGDP data came as VCFs (also hg19). Consequence for the rebuild: re-mapping to hg38 would require going back to FASTQ and re-running the whole aDNA read-processing chain (and the MPI-EVA genomes are published only as processed BAMs) — so rebuilding on hg19 is the practical choice, not just the cheap one.

SampleTypeCoverage tierArchiveAccession / pathNote
Vindija 33.19Neanderthalhigh (~30×)MPI-EVAPrüfer 2017, per-chromosome BAMsflagship high-coverage
Chagyrskaya 8Neanderthalhigh (~27×)ENA (confirm)confirm in Stage 0high-coverage
Denisova 5 (Altai)Neanderthalhigh (~30×)MPI-EVA (confirm)confirm in Stage 0"Altai Neanderthal" — despite the cave name
Denisova 3Denisovanhigh (~30×)MPI-EVA (confirm)confirm in Stage 0chr-named BAM → bug A1
Denisova 25Denisovanmedium (~16×)MPI-EVA (confirm)confirm in Stage 0
Denisova 11 (denny)F1 hybridlowENAERR2273828Neanderthal × Denisovan first-generation
Goyet Q56-1Neanderthallowconfirmconfirm in Stage 0
Les Cottés Z4-1415Neanderthallowconfirmconfirm in Stage 0
Mezmaiskaya 1NeanderthallowENAERR257722 (L4741)
Mezmaiskaya 2Neanderthallowconfirmconfirm in Stage 0
ScladinaNeanderthallowENAERR9741105 (G2160)
Spy 94aNeanderthallowMPI-EVAA9416
Hohlenstein-StadelNeanderthallowMPI-EVAL5386.bam
Vindija 87Neanderthallowconfirmconfirm in Stage 0
El Sidrón 1253Neanderthalexome onlyEVA exomes/Castellano 2014, PNASno shotgun genome — exome-capture only (~12.5× over coding) → excluded; 14 analyzed, not 15

Full verified provenance — every genome

Source paper, DOI, published coverage, exact VCF/BAM/ENA URLs, and data tier for all 15 archaic genomes + SGDP: plan/papers/REFERENCES.md. What QC each published VCF already carries (snpAD, MQ25, 35-mer mappability, FilterBed masks): plan/papers/VCF_QC.md. Two findings from the search: Vindija 87 is the same individual as Vindija 33.19 (so a genotype VCF exists for it), and El Sidrón 1253 has only exome-capture data, which is exactly why the thesis found no usable genome-wide nuclear data. (PDFs live in the git-ignored plan/papers/pdf/ — paywalled ones aren't redistributed on this public repo.)

Modern comparison: the Simons Genome Diversity Project (SGDP), 15 individuals, downloaded as whole-genome VCFs on hg19 (thesis: a 34.4 M-SNP whole-genome panel; pca/modern/sgdp.wg on the cluster — verified hg19, contains the pigmentation SNPs by rsID).

Coverage — exact, current

Per-sample mean depth over the panel, computed exactly from the committed *_depth.txt (full record + caveats: coverage_current.tsv). Read these as caveated: they're measured at the panel's current (hg38) mis-located coordinates (bug A2), so they are realized depths at the wrong positions, not true per-locus coverage; Denisova 3's 0.5× is artifactual (bug A1 — its true coverage is ~30×); and a max far above the mean (Vindija 87, Scladina) is a pileup artifact that motivates the max-depth cap. True per-locus coverage comes after the rebuild (Q6). 10 of the 14 samples are under ~3.2× — which is why hard-calling is the wrong tool and we move to genotype likelihoods (ANGSD).

SampleMean depth (panel)MaxCovered / 222Tier
Vindija 33.1930.716106222/222high
Chagyrskaya 827.42385222/222high
Denisova 2516.68048183/222high
Denisova 516.05936222/222high
Vindija 873.185147122/222low · max-depth artifact
Les Cottés2.94151142/222low
Goyet2.46454163/222low
Mezmaiskaya 21.85653113/222low
Scladina1.8569164/222low · max-depth artifact
Denisova 11 (denny)1.25220121/222low · hybrid
Spy0.7432275/222very low
Denisova 30.495669/222artifact — true ~30× (A1)
Mezmaiskaya 10.180237/222very low
Hohlenstein-Stadel0.117224/222very low
El Sidrón (Sid1253)——0no data — excluded
03

Data-flow — reads → genotypes → coordinates → picture

The whole pipeline is one chain. Colour marks the level each step operates at — the BAM→VCF boundary (red→blue) is where "photographs" become "written findings" and damage/depth information is fixed in place.

read-level (BAM) operation genotype-level (VCF/PLINK) result
raw · hg19Public BAMsreads from MPI-EVA / ENA
→
samtoolsSort · index · rename contigsharmonize to bare 1..22,X,Y (fixes A1)
→
read-level QCCoverage · sex · contamination · mapDamageQ6 / Q7 / Q8 — needs reads
→
bcftoolsCall genotypes at verified paneldiploid, keep-all, max-depth cap, damage-rescale
→
derivedVCF (genotypes)the conclusions — reads now discarded
→
plink2Merge · freq · PCA · projectno-mean-imputation (fixes collapse)
→
outputCoverage & PCA figuresbefore / after

What "contig" means (it comes up a lot): a contig ("contiguous sequence") is one continuous stretch of the reference the reads align to — in a human reference, essentially each chromosome, plus small unplaced/decoy pieces. Every BAM and VCF opens with a header line per contig, @SQ SN:<name> LN:<length>, and the SN value is its label. "Contig naming" is whether that label is bare (1) or prefixed (chr1). Two files can describe the same genome yet be unusable together if one says 1 and the other chr1 — the software matches by name, finds nothing, and silently returns empty. That one-sample mismatch is bug A1 (Denisova 3's BAM was chr-named against a bare-named reference and panel), which is why the "rename contigs" step above harmonizes every sample to bare names up front.

04

What the pipeline does

Left: what Lily's original pipeline did (and where the bugs entered). Right: what the rebuild does differently, with a QC gate at each stage. Full rebuild plan: rebuild_from_raw.md (incl. the per-genome reuse-vs-rerun matrix — the 5 high-coverage genomes are reused from published VCFs; only 3 low-coverage genomes are targeted-re-acquired). The justified sample subset (maximize reliable pigmentation SNPs, not genome count) is in papers/SAMPLE_INCLUSION.md. What each published VCF's QC actually was: papers/PIPELINE_QC_BY_PAPER.md.

StepLily's originalRebuild (from raw)
Acquiredownload BAMs, sort, indexre-download + checksum (Q1); harmonize contig naming for all (fixes A1 globally)
Raw QC— (none)mapDamage, sex, contamination, coverage-vs-expectation, and heterozygosity-vs-depth (Q6/Q7/Q8)
Panel / buildpanel on hg38, data on hg19 → wrong coordinates (A2)panel put on hg19 by rsID; tracer-SNP lint (Q2); allele/palindrome check (Q4)
Call genotypeshard calls (bcftools) for all samples incl. <1× — forces a genotype from 1–2 reads; whole-genome was haploid --ploidy 1 (A3)genotype likelihoods (ANGSD) — no hard call for low-coverage samples; diploid model; max-depth cap; mapDamage-rescale; transitions kept for pigmentation, transversion-only for ancestry. Hard calls only for the 4–5 high-coverage genomes (reporting/cross-check)
Modern refSGDP subset → merge → PCAverify (or rebuild) sgdp.wg against the same lint
PCA + projecthard-genotype plink2 --score; thesis §2.6 states "no imputation" but the code lacked no-mean-imputation, so plink silently mean-imputed → collapse on the rank-1 (wrong-build) panelPCAngsd on the genotype likelihoods (low-coverage-appropriate); positive control (Q3); non-degeneracy (Q5); 3 panels × 2 designs
Reproducemanual scripts, competing/dead copies, no seedsSnakemake DAG, pinned env, seeds, CI (Q10)
05

Are the samples all the same? No.

They differ on nearly every axis that matters — which is why one uniform recipe never fit them.

Format / source
single BAMs (ENA accessions) vs per-chromosome BAMs (Vindija, MPI-EVA); different filenames and conventions.
Coverage
~4 high-coverage (~16–30×: Vindija 33.19, Chagyrskaya 8, Denisova 5, Denisova 25) vs the rest very low (0.1–3×). This drives the missingness story.
Lab treatment
some UDG-treated (damage largely removed), some not — changes how much read-end deamination there is, and how aggressively we must handle it.
Type
Neanderthal, Denisovan, and the Denisova 11 F1 hybrid. Note Denisova 5 is a Neanderthal despite the cave name.
Contig naming
Denisova 3's BAM was chr-prefixed while the others were bare — bug A1.
Data at all
El Sidrón (Sid1253) has none → 14 analyzed, not 15.
Current cluster state
the full sorted BAMs are gone (only wrong-region filtered_*.bam + already-called VCFs remain) — which is why the rebuild re-downloads the raw reads.
06

Run log — updated as we go

A dated record of what we've actually done to the data, so the pipeline's real state is always legible. Newest at the bottom.

DateStageActionStatusOutput / evidence
2026-07-22auditReproduced the build mismatch (A2), Denisova 3 naming (A1), --ploidy 1 (A3), dead scripts (A5)foundverify/BUG_EVIDENCE.md
2026-07-23auditTraced each bug to its downstream consequence; rendered before-figures from committed datafoundplan/figures/before_*.png
2026-07-230Probed the cluster: full BAMs absent; sgdp.wg confirmed hg19 with pigmentation SNPs by rsID; ancient_sgdp_wg.vcf.gz (1.6 G) present; 129 panel SNPs overlap the modern ref (92 transitions / 37 transversions)probedthis page §02, §05
2026-07-23—Decision: rebuild from raw rather than trust the derived datadecidedrebuild_from_raw.md
2026-07-232Documented exact per-sample panel coverage (10/14 under ~3.2×; max-depth artifacts in Vindija 87 / Scladina)donecoverage_current.tsv, §02
2026-07-231Confirmed from thesis §2.3: archaics are BAMs pre-mapped to hg19, no FASTQ → rebuild on hg19done§02, §04
2026-07-234/6Decision: use genotype likelihoods (ANGSD) + PCAngsd for low-coverage, not hard-calling; max-depth cap; transversion-only for ancestry onlydecidedrebuild_from_raw.md Stage 4/6
2026-07-230Provenance search complete for all 15 archaic genomes + SGDP (only 6 sources were on the cluster). High-cov have published snpAD genotype VCFs; low-cov are BAM-only → ANGSD. Found: Vindija 87 = Vi 33.19 individual; El Sidrón is exome-onlydonepapers/REFERENCES.md
2026-07-230Documented the QC baked into each published VCF (snpAD, MQ25, 35-mer mappability, per-release FilterBed masks); pulled the open-access PDFs (3) into git-ignored papers/pdf/donepapers/VCF_QC.md
2026-07-230Extracted each source paper's full QC + pipeline (Methods + supplementary, verbatim params, adversarially verified — 11 papers). Corrections: originals of Altai/Denisova 3 are GATK (prefer the 2017 snpAD reprocess); Mezmaiskaya 1 does have a snpAD VCF; low-cov genomes were pseudo-haploid random-read, not genotypeddonepapers/PIPELINE_QC_BY_PAPER.md
2026-07-230/1Decided the sample subset (maximize reliable pigmentation SNPs, not genome count): Tier 1 = 5 high-cov + SGDP; Tier 2 = Les Cottés, Denisova 11, Goyet, Mez1; excluded El Sidrón/Vi87/Mez2/Spy/HST/Scladina. Targeted re-acquisition for 3 genomes; SGDP verified not rebuiltdecidedpapers/SAMPLE_INCLUSION.md
2026-07-232Added: individual heterozygosity vs individual depth (ANGSD realSFS) as a diversity + contamination diagnosticplannedQ7; rebuild Stage 2
0Provenance manifest + pinned env + recover all 15 acquisition URLstodo
1Re-acquire raw reads (targeted or full) + harmonize namingtodo
2Raw QC: mapDamage, sex, contamination, coveragetodo
3Panel → hg19 (by rsID) + tracer lint + allele checktodo
4Re-call genotypes (diploid, keep-all, max-depth cap, damage-rescale)todo
6PCA + projection (positive control, no-mean-imputation) → after-figurestodo