Downloads · 30 days
0
victormaricato/glof-lof-gof-classifier
glof-lof-gof-classifier is a machine learning model from victormaricato. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for sklearn. The card lists the license as mit.
Supervised 3-class missense variant mechanism classifier: predicts whether a missense variant is loss-of-function (LOF), gain-of-function (GOF), or neutral. It is the supervised baseline from the JENNIE study and the…
Downloads · 30 days
0
Access
Public
Updated Jun 9, 2026
Repo size
12.8 MB
Likes
0
Public
Click a slice to open those files.
.pkl8.6 MB · 100%
From the Hugging Face model README
Supervised 3-class missense variant mechanism classifier: predicts whether a missense variant is loss-of-function (LOF), gain-of-function (GOF), or neutral. It is the supervised baseline from the JENNIE study and the model served by the JENNIE web tool.
Try it live: https://victormaricato-jennie.static.hf.space
facebook/esm2_t33_650M_UR50D) of the wild-type and mutant full-length
sequences, concatenated to a 2560-dim vector.HistGradientBoostingClassifier (max_iter 300, lr 0.05,
L2 0.1, seed 42). classes_ == [0, 1, 2] -> [NEUTRAL, LOF, GOF].The pickle is produced with numpy==1.26.4 and scikit-learn==1.6.1; load it
in a matching environment (numpy 2.x cannot unpickle the random-state object).
import joblib
import numpy as np
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, EsmModel
ESM_NAME = "facebook/esm2_t33_650M_UR50D"
LABELS = ["NEUTRAL", "LOF", "GOF"] # classifier class order (classes_ == [0, 1, 2])
clf = joblib.load(hf_hub_download("victormaricato/glof-lof-gof-classifier", "glof_clf.pkl"))
tokenizer = AutoTokenizer.from_pretrained(ESM_NAME)
esm = EsmModel.from_pretrained(ESM_NAME).eval()
def embed(sequence: str) -> np.ndarray:
"""Mean-pooled final-layer ESM-2 embedding (1280-dim)."""
tokens = tokenizer(sequence, return_tensors="pt", truncation=True, max_length=1022)
with torch.no_grad():
return esm(**tokens).last_hidden_state.mean(1).squeeze(0).numpy()
def classify(sequence: str, pos: int, alt: str) -> dict:
"""Probabilities over {NEUTRAL, LOF, GOF} for a 1-based missense substitution."""
mutant = sequence[:pos - 1] + alt + sequence[pos:]
features = np.concatenate([embed(sequence), embed(mutant)])
probs = clf.predict_proba([features])[0]
return dict(zip(LABELS, probs.round(4).tolist()))
# Example: KCNJ11 N-terminal fragment, V13A
seq = "MLSRKGIIPEEYVLTRLAEDPAEPRYRARQRRARFVSKKGNCNVAHKNIREQGRFLQDVFTTLVDLKWPHTLLIFTMSFLCSWLLFAMAW"
print(classify(seq, 13, "A"))
# {'NEUTRAL': 0.7947, 'LOF': 0.204, 'GOF': 0.0013}
Zero-shot foundation-model likelihoods predict pathogenicity but not the LOF-vs-GOF direction; supervised training on GLOF recovers direction only modestly (AUROC ~0.76 on held-out genes), so the direction call is a weak prior. Benchmark code: https://github.com/victormaricato/jennie-paper.
Class probability order is [NEUTRAL, LOF, GOF].