PepSeqPred predicts residue-level epitope locations for protein sequences.
Use bundled models with
load_pretrained_predictor(...).Use your own
.ptor.jsonartifacts withload_predictor(...).Get residue-aligned binary epitope masks via
result.binary_mask.Use
device="auto"to select CUDA when available, otherwise CPU.
pip install pepseqpredfrom pepseqpred import load_pretrained_predictor
protein_seq = "ACDEFGHIKLMNPQRSTVWY"
predictor = load_pretrained_predictor(model_id="default", device="auto")
result = predictor.predict_sequence(protein_seq, header="example_protein")
print(result.binary_mask) # e.g. 000001110000...
print(result.n_epitopes) # number of residues predicted as epitope
print(result.frac_epitope) # fraction of residues predicted as epitopeTo inspect available bundled models:
from pepseqpred import list_pretrained_models
for info in list_pretrained_models():
print(info.model_id, info.aliases, info.is_default)Use this when you have your own trained PepSeqPred artifact:
- single checkpoint:
.pt - ensemble manifest:
.json
from pepseqpred import load_predictor
predictor = load_predictor(
model_artifact="path/to/ensemble_manifest.json", # or path/to/model.pt
device="auto"
)
result = predictor.predict_sequence("ACDEFGHIKLMNPQRSTVWY")
print(result.binary_mask)results = predictor.predict_fasta("input.fasta")
predictor.write_fasta_predictions("input.fasta", "predicted_masks.fasta")device="auto"uses CUDA if available, otherwise CPU.result.binary_maskis aligned to the cleaned protein sequence.
