Ahmed Doghri Logo Image
Ahmed Doghri

methyloadapt

Six target-species examples are not enough to learn methylation from scratch. Transfer the conserved motif first and accuracy moves from chance to 100%.

methyloadapt reproduced benchmark result

The Labels Run Out Before The Species Do

Methylation predictors have abundant data for a few organisms and scraps for many others. Training a fresh model per species throws away conserved sequence grammar.

methyloadapt creates two source domains and a low-label target domain with a shifted but related methylation motif. The baseline sees six target examples. The adapted model sees the shared domains first.

Transfer The Motif, Not The Answer Sheet

The model learns transparent k-mer evidence. Source species contribute conserved CpG structure; the small target set then reweights what is species-specific.

There is no claim that a two-mer score replaces hierarchical attention. The point is to make domain-adaptive pretraining's advantage visible under controlled label scarcity.

Update: that 50-point gain turned out to be a lucky seed, not a typical one — across 60 seeds the median gain sits near 1 point, and adaptation sometimes made things worse. Fixed with domain-weighted vote normalization. Full writeup below.

The Number

Target-only training stays at 50% accuracy. Domain-adaptive training reaches 100% on 160 held-out sequences, a 50-point gain.

The dataset is synthetic and non-diagnostic. One deterministic unit test enforces the published benchmark floor in CI.

The Published Gain Was A Lucky Seed

The adapted model trains on raw vote counts — source's 360 examples numerically swamp the oversampled target's 24. Worse, the two source species share one positive motif while the target species uses a different one, so source's dominant signal doesn't reliably point at the right answer for target at all.

Across 60 seeds, the median gain sits at 1.2 points, nowhere near the published 50. Five of those 60 seeds show the adapted model doing measurably worse than the target-only baseline it's supposed to beat (worst case -16.9 points). A disjoint 30-seed holdout, evaluated once, confirms it: median 3.75 points, one seed worse.

The fix trains source and target as separately normalized vote profiles, then combines them with an explicit domain weight instead of raw counts, so target's signal can no longer be numerically drowned out. Across both the same tuning seeds and the frozen holdout, it never regresses below the target-only baseline and holds a median gain of 46.6–49.1 points. The original module is untouched and the published 50.0-point number still reproduces exactly.

Research Basis

Inspired by the 2025 iDNA-DAPHA methylation study. The portfolio number above comes from this repository's own controlled benchmark, not from the paper.

Tools Used

Python
DNA Methylation
Transfer Learning
K-mer Models
Domain Adaptation
Statistical Robustness
unittest