Turn disease-causing protein mutations into sound — using ESM-2 embeddings to measure how "unusual" a mutation looks to a model trained only on evolution.
https://huggingface.co/spaces/H9kkk/protein-music
Search any human protein, pick a real documented disease variant, and take the blind listening test — can you tell which audio track is the mutant, just by ear?
- Pick any human protein (search via UniProt) and one of its real documented disease-causing variants
- The app fetches both the healthy and mutant sequence
- Both are run through ESM-2 (8M param, runs on CPU) to get per-residue embeddings
- The embedding distance between healthy and mutant is computed at each position — this spikes sharply at the mutation site (e.g. p53 R175H: ~12x the local average)
- That disruption signal is sonified — higher disruption = more dissonant — and rendered as a chart
- The detection signal (embedding distance) is genuine, unmanipulated output from ESM-2. No disease labels were used in training.
- The sonification rules (disruption → dissonance, pitch mapping, etc.) are hand-designed, not learned. This is "pretrained model as feature extractor + deterministic mapping," not novel ML.
- This is an exploratory/educational tool, not a diagnostic one.
The Python files in this repo implement the pipeline:
| File | Role |
|---|---|
fetcher.py |
UniProt REST API — sequences, variants, mutations |
embedder.py |
ESM-2 embeddings, distance computation, music parameter mapping |
composer.py |
Converts music parameters into note sequences |
synth.py |
Renders notes to .wav directly (sine waves + harmonics) |
server.py |
Flask app — routes, ties everything together |
templates/index.html |
Frontend — search, charts (Chart.js), audio players |
- Model: facebook/esm2_t6_8M_UR50D (Hugging Face transformers)
- Backend: Flask
- Data: UniProt REST API
- Audio: numpy + scipy (direct waveform synthesis, no soundfont)
- Charts: Chart.js
- Hosting: Hugging Face Spaces (Docker)
- Train a classifier on ESM-2 deltas + ClinVar labels to predict pathogenicity (would make this a genuine ML contribution beyond feature extraction)
- 3D structure visualization (AlphaFold) showing mutation site in context
- Crowd-sourced blind test results — track aggregate "% correctly identified"