Downloads · 30 days
145
4% of all-time downloads
gitter-lab/METL
METL is a feature extraction model from gitter-lab. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
Mutational Effect Transfer Learning (METL) is a framework for pretraining and finetuning biophysics-informed protein language models.
Downloads · 30 days
145
4% of all-time downloads
All-time downloads
3.5K
Public
Parameters
2
784 KB on disk
Likes
0
Public
Click a slice to open those files.
.py199 KB · 98%
From the Hugging Face model README
Mutational Effect Transfer Learning (METL) is a framework for pretraining and finetuning biophysics-informed protein language models.
This repository contains a wrapper meant to facilitate the ease of use of METL models. Usage of this wrapper will be provided below. Models are hosted on Zenodo and will be downloaded by this wrapper when used.
METL is discussed in the paper in further detail. The GitHub repo contains more documentation and includes scripts for training and predicting with METL. Google Colab notebooks for finetuning and predicting on publicly available METL models are available as well here.
Use the code below to get started with the model.
Running METL requires the following packages:
transformers==5.17.0
huggingface-hub==1.13.0
torch==2.14.0
numpy>=1.23.2
networkx>=2.6.3
scipy>=1.9.1
biopandas>=0.2.7
In order to run the example, a PDB file for the GB1 protein structure must be installed. It is provided here and in raw format here.
After installing those packages and downloading the above file, you may run METL with the following code example (assuming the downloaded file is in the same place as the script):
from transformers import AutoModel
import torch
metl = AutoModel.from_pretrained('gitter-lab/METL', trust_remote_code=True)
model = "metl-l-2m-3d-gb1"
wt = "MQYKLILNGKTLKGETTTEAVDAATAEKVFKQYANDNGVDGEWTYDDATKTFTVTE"
variants = '["T17P,T54F", "V28L,F51A"]'
pdb_path = './2qmt_p.pdb'
metl.load_from_ident(model_id)
metl.eval()
encoded_variants = metl.encoder.encode_variants(sequence, variant)
with torch.no_grad():
predictions = metl(torch.tensor(encoded_variants), pdb_fn=pdb_path)
Biophysics-based protein language models for protein engineering.
Sam Gelman, Bryce Johnson, Chase R Freschlin, Arnav Sharma, Sameer D'Costa, John Peters, Anthony Gitter<sup>+</sup>, Philip A Romero<sup>+</sup>.
Nature Methods 22, 2025.
<sup>+</sup> denotes equal contribution.
For questions and comments about METL, the best way to reach out is through opening a GitHub issue in the METL repository.