Notes
AI & computational biology, with code
Working notes on applying LLMs, agents, and foundation models to bioinformatics workflows. Every post links to a runnable GitHub repo.
TenK10K at ETS2: a blood chromatin atlas recovers an IBD mechanism
The TenK10K chromatin atlas finds the ETS2 enhancer, the right cells and, at the top of its fine-mapping, the right SNP, with the risk allele opening the enhancer, as Stankey et al.'s functional genomics work found.
Spatial transcriptomics of Crohn's disease: cell segmentation errors in Xenium data
Cells in a 10x Xenium Crohn's disease atlas are packed close together, so segmentation counts some RNA molecules for the wrong cell. Measure the packing in Python, find each cell type's marker genes in the cells next to it, and see what this does to a differential expression analysis.
Spatial transcriptomics of Crohn's disease: a first look
Load a 10x Xenium Crohn's disease atlas of 2.1 million cells in Python, then zoom from whole tissue sections into an ulcer and its inflammatory fibroblasts.
Single-molecule affinity proteomics has the same counting problem as RNA-seq
Reading one protein molecule at a time gives you evidence that fits several proteoforms at once. Shared peptides do the same in mass spectrometry, and multi-mapping reads do it in RNA-seq. The estimation step is the same in all three, and EM handles it.
TYK2 in Crohn's disease: what actually failed
Two TYK2 inhibitors missed their primary endpoint in Crohn's and both programs were shut down. Reading the trials endpoint by endpoint, with a two-proportion test and a small Bayesian posterior, recovers the objective signal the pass/fail label threw away.
A Bayesian go/no-go for a drug candidate, in PyTorch
A go/no-go clinical decision built as Bayesian logistic regression in PyTorch. With 250 trials the Bayesian and frequentist estimates agree; the credible interval is the payoff, and the prior earns its keep when trials are few.
VIDRA: genetics as a dose, not a yes/no
A quick take on VIDRA from the Open Targets team, which estimates the genetic dose-response curve between gene activity and disease.
Geneformer from scratch, part 4: does it capture disease?
The hard test for a from-scratch Geneformer: read IBD disease state off the frozen embedding, see why it loses to PCA, and test what narrows the gap. Scale, weight tying, value-aware tokens.
Geneformer from scratch, part 3: does it capture cell types?
Test a from-scratch Geneformer: freeze the model, read cell type off its embedding on held-out patients, and race it against a plain PCA baseline.
Geneformer from scratch, part 2: a tiny BERT for cells
Build and train a tiny BERT for single cells from scratch: the transformer architecture, self-attention, and masked-gene prediction, with real code and results.
Geneformer from scratch, part 1: a cell is a sentence
Build Geneformer from scratch: turn scRNA-seq expression into a ranked sentence of gene tokens. Tissue-aware QC, the median trick, the gene vocabulary, and the patient split.
Three ways an LLM in the loop breaks reproducibility
A bioinformatician's view: the decision trail, the opaque code trail, and layered non-determinism, the three reproducibility problems that are new when an LLM writes (or runs) your analysis.
How to install a Claude Code Skill — Methods drafter walkthrough
How to install a Claude Code Skill at ~/.claude/skills/<name>/SKILL.md so every future Claude Code session loads it automatically — no re-pasting. Methods drafter walkthrough.
How to add a reusable Python tool to Claude — PubMed search example
How to add a reusable Python tool Claude can call from any notebook or claude CLI session. PubMed search walkthrough with the install pattern.
How to write your first Claude Code Skill — Methods drafter example
How to write your first Claude Code Skill — a persistent rule Claude loads automatically. Methods section drafter walkthrough, with the full SKILL.md.
Set up the Claude API on macOS or Linux — venv, API key, .env
Set up the Claude API on macOS or Linux: Python venv with the Anthropic SDK, an API key from console.anthropic.com, and a .env file. Cost notes and troubleshooting included.