Genomics Demos
Interactive demos for DS 5080 Genomics Foundations for Data Science.
Vibe-coded with ❤️ by Stephen Turner.
Transmission and linkage
Recombination and gamete mosaics
Crossing over drawn against megabases and centimorgans at once. See why recombination fraction is not additive, and how ancestry blocks shrink generation by generation.
Linkage disequilibrium
Two loci, four haplotypes, and three measures of LD. D prime can be 1 while r squared is 0.05, and only r squared tells you whether a tag SNP will work.
Genetic drift simulator
Wright-Fisher drift in a diploid population, with selection as an option. Seeded, so a run can be linked from a slide.
Relatedness and IBD
Siblings share 50% on average and almost never exactly. Simulated meioses on all 22 autosomes, the shared segments drawn, and the distribution of sharing across hundreds of pairs.
Populations and ancestry
Hardy-Weinberg
The De Finetti diagram, the chi-square and exact tests, a sampling panel that shows what significance means, and the Wahlund effect: two populations in perfect equilibrium whose pooled sample fails.
PCA and ancestry
Principal component analysis on simulated genotypes. See what Fst, admixture, a cline and array ascertainment do to the plot, and how little variance the top axis explains.
Site frequency spectrum
Why most variants are rare, from a simulated coalescent. Place mutations on a genealogy, change the spectrum with a bottleneck or an expansion, and read Tajima's D off the picture.
Working with genomic data
Genome coordinates and interval arithmetic
The same interval written both ways on the same picture. BED counts the gaps between bases from zero; VCF, GFF and GRanges count the bases from one. Plus every interval operation, with the R output beside it.
Variant consequence
Click a base, read the protein. Synonymous, missense, nonsense, frameshift and the GT-AG splice rule from the reading frame, with HGVS names, exon skipping and the 50-nucleotide NMD rule, on the real minus-strand TP53.
Read pileup
Depth is sampling. Look at the reads over one site, see the genotype likelihoods and the VCF record computed from them, then lower the coverage and lose a heterozygote.
Assembly graph
A de Bruijn graph tangles when a repeat is longer than the reads that cover it. Build a small genome, sample reads, and change read length and k-mer size to see when the repeat resolves.
RNA-seq normalization
Counts to CPM, RPKM and TPM in an editable table. The gene with the most reads is not the most expressed gene, TPM sums to a million, and DESeq2 size factors ignore the gene that dominates the library.
Association studies
GWAS bench
Simulate a study from its parameters and read the results. Manhattan, QQ with a concentration band, lambda, power, and the winner's curse. Add population structure and see what the correction costs.
Risk and polygenic scores
An odds ratio of 1.2 moves fewer than two people in a hundred. Icon arrays for absolute risk, the FTO effect in kilograms, a polygenic score under the liability model, and what a score keeps when it changes populations.
Screening and PPV
A 99% test for a one-in-a-thousand condition is wrong nine times in ten when it says yes. Count the people, then apply the same arithmetic to a forensic database search.