Downloads · 30 days
8
4% of all-time downloads
sihuapeng/TarPepSubLoc
TarPepSubLoc is a text classification model from sihuapeng. Use it when you need a label for a piece of text. The card lists the license as mit.
In biology, "targeting peptides" typically refer to "targeting signal peptides" or "targeting sequences," also known as "signal peptides" or "signal sequences." These are short amino acid sequences located at the N-te…
Downloads · 30 days
8
4% of all-time downloads
All-time downloads
228
Public
Parameters
2.8B
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
From the Hugging Face model README
In biology, "targeting peptides" typically refer to "targeting signal peptides" or "targeting sequences," also known as "signal peptides" or "signal sequences." These are short amino acid sequences located at the N-terminal or C-terminal of a protein that direct the protein to specific locations within the cell, such as the mitochondria, chloroplasts, plastids, endoplasmic reticulum, and more. Targeting peptides play a crucial signaling role during protein synthesis, ensuring that the protein is correctly localized to its intended cellular destination.
TarPepSubLoc-ESM2 (TarPepSubLoc, Targeting Peptide Subcellular Localization) is a protein language model fine-tuned from ESM2 pretrained model (facebook/esm2_t36_3B_UR50D) on a trageting peptides subcelluar localization dataset with five classes.
TarPepSubLoc-ESM2 achieved the following results:
Train Loss: 0.0385
Train Accuracy: 0.9881
Validation Loss: 0.0566
Validation Accuracy: 0.9812
Epoch: 20
The full dataset contains 13,005 protein sequences, including SP (2,697), MT (499), CH (227), TH (45), and Other (9,537). The highly imbalanced sample sizes across the six categories in this dataset pose a significant challenge for classification.
The dataset was downloaded from the website at TargetP - 2.0.
https://github.com/pengsihua2023/TarPepSubLoc-ESM2
Pytorch and transformers libraries should be installed in your system.
pip install torch torchvision torchaudio
pip install transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the fine-tuned model and tokenizer from Hugging Face
model_name = "sihuapeng/TarPepSubLoc-ESM2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Define the amino acid sequence
sequence = "MNSLLMITACLALVGTVWAKEGYLVNSYTGCKFECFKLGDNDYCLRECRQQYGKGSGGYCYAFGCWCTHLYEQAVVWPLPNKTCNGK"
# Tokenize the sequence
inputs = tokenizer(sequence, return_tensors="pt")
# Make the prediction
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_id = logits.argmax().item()
# Define the ID to Label mapping
id2label = {0: 'CH', 1: 'MT', 2: 'Other', 3: 'SP', 4: 'TH'}
# Get the predicted label
predicted_label = id2label[predicted_class_id]
print(f"The predicted class for the sequence is: {predicted_label}")
This project was funded by the CDC to Justin Bahl (BAA 75D301-21-R-71738).
Sihua Peng
