Lesson 12 of 13 · 12 min
Applications: Variant Effect, Protein Function, Expression
Three flagship problems
Each application reuses the same scaffolding from earlier lessons: choose a task type, engineer or learn features, pick a split that respects biological structure, and report a metric that matches the task. What changes across variant effect, function annotation, and expression prediction is which biological unit leaks between train and test when you are careless.
Variant effect prediction
Variant effect prediction asks whether a substitution is deleterious. Framed as zero-shot scoring, a protein language model such as ESM-1v ranks mutations by the log-likelihood ratio log P(mutant) minus log P(wild type) at the mutated position with no labels required; framed as supervised learning, you regress those scores or mean-pooled embeddings against deep mutational scanning fitness and report Spearman correlation, or classify ClinVar pathogenic versus benign and report AUROC and AUPRC. Alignment-based methods like EVE and GEMME remain strong MSA baselines.
import torch, esm
model, alphabet = esm.pretrained.esm1v_t33_650M_UR90S_1()
batch_converter = alphabet.get_batch_converter()
model.eval()
wt = "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ" # wild-type protein
_, _, tokens = batch_converter([("wt", wt)])
# Masked-marginal score for A7G (1-based residue index)
pos, wt_aa, mt_aa = 7, "A", "G"
assert wt[pos - 1] == wt_aa
idx = pos # +1 shift for the BOS token
masked = tokens.clone()
masked[0, idx] = alphabet.mask_idx
with torch.no_grad():
logits = model(masked)["logits"]
lp = torch.log_softmax(logits[0, idx], dim=-1)
llr = (lp[alphabet.get_idx(mt_aa)] - lp[alphabet.get_idx(wt_aa)]).item()
print(f"ESM-1v masked-marginal LLR ({wt_aa}{pos}{mt_aa}): {llr:.3f}")ESM-1v masked-marginal LLR (A7G): -4.271
Warning: ClinVar benchmarks are prone to label circularity. Many pathogenic and benign labels were themselves assigned with conservation or in-silico tools, so a model can score well by rediscovering that signal rather than biology. Worse, splitting variants at random lets the same gene appear in train and test, so cluster proteins by sequence identity (for example MMseqs2 at 30 percent) and keep whole clusters on one side so homologs never leak.
Protein function annotation
Function annotation is multi-label classification over the Gene Ontology, a DAG of thousands of interdependent terms, so each protein carries many labels and predictions must respect the hierarchy; DeepFRI feeds language features and a residue contact map into a graph convolutional network, while a strong sequence-only baseline mean-pools ESM embeddings into a per-term linear classifier. The CAFA benchmark scores protein-centric Fmax and Smin under a temporal holdout, where proteins whose experimental annotations appear only after a cutoff date form the test set. The specific leak is annotation transfer: many labels carry the IEA evidence code and were propagated by homology, so a homology-based model is graded against its own bias unless you filter to experimental evidence codes and split by sequence identity.
Expression prediction
Expression prediction maps DNA sequence to regulatory readouts: DeepSEA frames it as multitask binary classification, predicting hundreds of chromatin features such as transcription-factor binding, DNase hypersensitivity, and histone marks from a 1000 bp window and reporting per-task AUROC and AUPRC, whereas Basenji and Enformer regress continuous CAGE and RNA-seq coverage across binned intervals and report Pearson correlation across genes and tracks. The input is the one-hot encoded four-channel sequence, consumed by convolutions and, in Enformer, attention over long context. The dominant leak is genomic, since random window splits place overlapping or adjacent regions in both sets and paralogous or repetitive elements recur, so hold out whole chromosomes (a common choice reserves several such as chr8 and chr9 for test) instead of shuffling windows.
Try it yourself: Download several deep mutational scanning assays from ProteinGym, score every single substitution in each with ESM-1v masked marginals, and compute the per-assay Spearman correlation between your log-likelihood ratios and the measured fitness. Then cluster the assayed proteins by MMseqs2 at 30 percent identity, refit any supervised head cluster-out, and compare the held-out correlation against a naive random split to quantify how much homology leakage inflated the score.