Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 2.78 KB

File metadata and controls

78 lines (55 loc) · 2.78 KB

PepSeqPred logo

PyPI version Python versions License: GPL-3.0 API: Pretrained API: Artifact Path

PepSeqPred predicts residue-level epitope locations for protein sequences.

At A Glance

  • Pretrained Use bundled models with load_pretrained_predictor(...).
  • Artifact Use your own .pt or .json artifacts with load_predictor(...).
  • Output Get residue-aligned binary epitope masks via result.binary_mask.
  • Device Use device="auto" to select CUDA when available, otherwise CPU.

Install

pip install pepseqpred

Predict With A Bundled Pretrained Model

from 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 epitope

To 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)

Predict From Your Own Artifact Path

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)

FASTA I/O

results = predictor.predict_fasta("input.fasta")
predictor.write_fasta_predictions("input.fasta", "predicted_masks.fasta")

Notes

  • device="auto" uses CUDA if available, otherwise CPU.
  • result.binary_mask is aligned to the cleaned protein sequence.