deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Open-source CLI pairs ESM-2 protein embeddings with XGBoost to predict mutation pathogenicity

A developer has open-sourced a local Python CLI that uses Meta's ESM-2 protein language model and an XGBoost classifier to label missense mutations pathogenic or benign, with no cloud dependency.

Open-source CLI pairs ESM-2 protein embeddings with XGBoost to predict mutation pathogenicity

A developer has released an open-source command-line tool that predicts whether a missense mutation is likely to be disease-causing, combining Meta's ESM-2 protein language model with an XGBoost classifier. Writing on dev.to, the author says the pipeline runs fully on a local machine — no cloud service, no subscription — and that the code is published under the MIT licence.

How the pipeline works

The tool accepts a protein symbol plus a mutation, for example BRCA1 A1708E. It retrieves the matching sequence from UniProt, applies the amino-acid substitution, and passes the mutated sequence through ESM-2 — specifically the facebook/esm2_t30_150M_UR50D checkpoint, a model with 150 million parameters. The model returns a 640-dimensional embedding that, in the author's description, summarizes a protein's evolutionary and structural context.

From there the embeddings go to a gradient-boosted tree classifier built on XGBoost, which emits one of two labels — PATHOGENIC or BENIGN — together with a confidence score and a per-protein feature graph. scikit-learn's SelectKBest and StandardScaler handle feature selection and scaling ahead of the trees.

A detail worth noting: no neural network runs at inference time. The ESM-2 embeddings are computed once per query, and the classification itself is carried out by the lightweight tree ensemble.

Training data and reported results

According to the post, the classifier was trained on 2,792 classified missense mutations taken from ClinVar, the NIH's public archive of variant interpretations, and reached 82.5% accuracy on that dataset. These figures are self-reported and come with no independent benchmark, so anyone considering the tool for serious work should treat them as a starting point rather than a validated performance claim.

Running it locally

Setup follows the standard shape of a small Python project: clone the repository (NOOBHEKER/dna-mutation-predictor on GitHub), install dependencies with pip, then start the interface via python -m src.cli. Windows users get a predict.bat script that performs the setup automatically. Inference on CPU takes roughly 30 seconds per prediction, a trade-off the author frames as tolerable for research purposes.

Lessons from the build

The post closes with observations that travel beyond this particular project. ESM-2 embeddings carried enough signal to classify pathogenicity without any hand-engineered features. Trimming the embedding from 640 dimensions down to 40 selected features actually outperformed using the full vector, which the author credits to feature selection filtering out noise. And the most laborious part of the build turned out to be cleaning the ClinVar data rather than training the model — a familiar experience for anyone who has shipped machine learning on a curated dataset.

Why it matters

The project is a compact demonstration of a now-common applied-AI pattern: a large pretrained model serving as a frozen feature extractor, paired with a classical, inspectable algorithm for the final decision. That split keeps running costs near zero, makes behaviour easier to reason about, and lets everything run on a laptop — useful in bioinformatics, where cloud APIs and per-query pricing often exclude students and independent researchers.

It is just as important to state what the tool is not. Accuracy of 82.5% on roughly 2,800 samples sits well below what clinical variant interpretation demands, and nothing in the project claims diagnostic use. As an open, hackable base for exploring how protein language models transfer to classification tasks, however, it lowers the barrier to entry considerably: the code carries an MIT licence and the author explicitly invites people to fork and extend it.

  • #open-source
  • #machine-learning
  • #bioinformatics
  • #xgboost
  • #esm-2
  • #python

Related posts