Research demo · Project A · non-clinical
From sequencer reads to mutations
FASTQ · BAM/SAM · VCF/BCF
FASTQBAM/SAMVCF/BCF 1000 GenomesNA12878

How DNA data travels from the sequencer to a list of mutations

We open three tiny public files that stand for the whole pipeline: raw reads (FASTQ), aligned reads (BAM), and called variants (VCF) — and show the QC checks scientists actually run.

A research-grade tour of FASTQ, BAM/SAM, and VCF using 1000 Genomes micro-samples — theory, QC metrics, and interactive figures.

For everyone: sequencing produces text files of DNA letters, then maps them to a reference genome, then lists places that differ. This page opens tiny public examples of each step and shows the health checks labs run.

For specialists: end-to-end re-parse of FASTQ/BAM/VCF micro-samples with Phred surfaces, MAPQ/CIGAR/insert QC, Ti/Tv + AF + genotypes, and format packaging (sites / multi-sample / bgzip+tabix). Hover or tap i for dual-register definitions.

Key findings

What this sample shows — written twice: first for everyone, then for specialists.

  1. The second read of each pair is noisier. R1 average quality is 27.0 vs R2 22.2 (drop of 4.7 Phred). That is common in older Illumina chemistry and is why QC plots show a 3′ slide. See chart →
    mean Phred R1=26.98, R2=22.23; fixed read length 36 bp; GC≈39.4%.
  2. Almost every read found a place on the reference genome. 100% of reads mapped (mean MAPQ 55). About 97% of pairs look like well-behaved DNA fragments. See chart →
    mapped=79/79; mean MAPQ=55.03; insert mean±sd=376.4±29.7; CIGAR soft-clip bases=967.
  3. Variants are mostly single-letter DNA changes. The multi-sample file has 25 variants across 1233 people; Ti/Tv=1.27 (whole-genome SNPs often sit near ~2.0–2.1 — this tiny slice is illustrative only). See chart →
    multisample: n_var=25, snps=25, ti=14, tv=11, mean AF=0.005976484841667116; site-only basic.vcf n_var=48.
  4. The same variant sites appear in three packaging formats. One file is plain text sites, one adds genotypes for 1,000+ people, one is compressed+indexed for fast region queries — same science, different engineering contracts. See chart →
    basic.vcf (sites) vs basic_multisample.vcf (GT matrix) vs indexed_tbi.vcf.gz + .tbi (bgzip/tabix).
Raw DNA reads
n_reads
200
Avg base quality
mean Phred
24.6
GC content
mean GC
39.4%
Aligned reads
n_mapped
79
Mapping confidence
mean MAPQ
55
People in VCF
n_samples
1233
Variants listed
n_variants
25
Ti/Tv ratio
Ti/Tv
1.27

0. Why care about FASTQ/BAM/VCF — can’t Grok just “do the genomics”?

The “why” is interoperability and trust: sequencers, aligners, and callers only meet if everyone speaks FASTQ → BAM → VCF.

For everyone

DNA machines do not output a paragraph. They output standardized files that different software must open years later, on different clouds, with bit-exact coordinates. FASTQ, BAM, and VCF are those standards — like PDF for documents, but for letters of DNA, where they matched the genome, and how people differ.

A model like Grok 4.5 is excellent at teaching you what MAPQ means, writing a samtools one-liner, or reviewing whether Ti/Tv looks suspicious. It should not be the system of record for 100 million reads. Production genomics is still dominated by specialized engines (BWA, GATK, DeepVariant, bcftools) that stream these formats.

For specialists

Benchmarks that matter for this stack are not MMLU. They are: alignment accuracy / mapping rate, coverage uniformity, variant F1 on Genome in a Bottle (GIAB), Mendelian consistency, and runtime/cost on WGS. File-level QC (Phred decay, insert-size modes, FILTER distributions) is how you know a run is usable before any ML.

LLMs help with orchestration and explanation; they do not define reference-compressed CIGAR semantics or tabix random access. Multimodal chat cannot replace a .bai over a 100× CRAM.

Capability map

JobFormat-native toolsFrontier LLM (e.g. Grok 4.5)
Parse 10⁸ readsPrimary (htslib/pysam)Wrong abstraction
QC a lane / libraryPrimary (FastQC, Picard, mosdepth)Interpret reports
Call variants vs GIABPrimary (GATK, DV, happy)Discuss discordant sites
Explain Ti/Tv to a PIPlots + statsPrimary
Write a pipelinenf-core / WDL / SnakemakeStrong pair-programmer

Pathology Project B is the vision-FM analogue: specialist models for tiles; LLMs for the scientific narrative.

1. The three stops on the DNA data journey

Where FASTQ, BAM, and VCF sit in a standard short-read workflow.

FASTQ
Raw reads

Base calls + qualities. Adapter trim, contamination, and Phred decay live here.

BAM
Alignments

Reference coordinates, CIGAR, MAPQ, duplicate marking, insert size.

VCF
Variants

Alleles, genotypes, INFO annotations, population AF, FILTER decisions.

Indexing is not optional at scale: .bai/.csi enable region queries on BAM; .tbi does the same for bgzip VCF. The included indexed_tbi.vcf.gz demonstrates the compressed+indexed form used in production object stores.

2. Raw reads: how sure are we about each DNA letter?

Phred quality, GC content, and base mix — the first QC gate after sequencing.

Phred quick reference

Encoding here: Sanger Phred+33 (Illumina 1.8+). Older Illumina Phred+64 is rare but still appears in archives.

Files

What to look for in real data: 3′ quality drop (polymerase fatigue), cycle-specific dips (fluidics), GC bias, and adapter-driven polyG/polyA tails. This micro-subset is fixed-length 36-mer historical Illumina — modern NovaSeq reads are longer (2×150) with different quality profiles.

3. Alignments: did reads land in the right place?

Mapping quality, pair geometry, and CIGAR surgery on a tiny BAM.

Total
79
Mapped
79
Proper pairs
76
Mean insert
376
Mean read len
101
Soft-clip bases
967

MAPQ interpretation

CIGAR & flags in practice

  • M/EQ/X — alignment match (not necessarily sequence match for M)
  • I/D — insertions/deletions relative to reference
  • S/H — soft/hard clips (adapters, structural variant breakpoints)
  • Flag 0x2 proper pair — both ends oriented and insert size within aligner expectations
  • Duplicate flag — optical/PCR duplicates; mark before variant calling

This toy BAM is chr11-local and tiny; treat rates as illustrative, not cohort benchmarks.

4. Variants: which DNA letters differ?

SNP spectrum, frequencies, and genotypes across three VCF packagings.

Ti/Tv for whole-genome SNPs is typically ~2.0–2.1; exomes differ. Extreme deviations can flag systematic calling artifacts. Allele frequency spectra (many rare variants) are expected under population genetics; the multi-sample file exposes genotype matrices across 1,000+ individuals even when the variant count in this demo slice is small.

The three VCF panels compare: site-only basic.vcf, multi-sample genotypes, and the same sites as bgzip + tabix (indexed_tbi.vcf.gz) — the form used for cloud-region queries.

5. See quality in 3D

Interactive surfaces and clouds — drag to rotate.

Quality surface: X = cycle, Y = read index, Z = Phred — 3′ decay appears as a sloping face. Read cloud: mean Q vs GC vs end-of-read Q separates chemistry issues from composition. BAM cloud: genomic position × MAPQ × insert size highlights soft regions and improper pairs.

6. Pocket reference

Fields, indexes, and common tools for FASTQ / BAM / VCF.

7. What this demo cannot claim (and good next steps)

These micro-files are intentionally tiny so the project stays git-friendly and CI-testable, but the metrics and failure modes scale unchanged to WGS/WES cohorts. In production you would add:

Bridge to Project B: the same discipline of format literacy + quantitative QC applies when pathology foundation-model embeddings are joined to spatial transcriptomics (h5ad) and WSI pyramids.

Generated by scripts/build_dashboard.py · analytics at outputs/phd_genomics_analytics.json · sample data from 1000 Genomes public resources · research use.