Skip to content

dina-lab3D/CLIPepPI

Repository files navigation

CliPepPI: Scalable prediction of domain-peptide specificity using contrastive learning

clipPepPI

Overview

ClipPepPI is a deep learning model for domain-peptide interaction prediction using contrastive learning (CLIP). The model leverages fine-tuned protein language models (ESMC) to generate embeddings for both protein domains and peptide sequences, encoding them into a shared latent space.

Read the preprint: https://www.biorxiv.org/content/early/2026/03/20/2026.03.18.712595

Webserver

ClipPepPI is available at https://bio3d.cs.huji.ac.il/webserver/clipeppi/

Installation

Requirements

  • Python 3.11+
  • CUDA 12.1+ (for GPU support)
  • 16GB of RAM is sufficient for inference (depending on input size)

System Information

  • Install time: ~5 minutes (with GPU drivers already installed)
  • Typical runtime: ~1 second for scoring 100 domain-peptide pairs (A40 GPU)
  • Tested on: Linux (Ubuntu 22.04+), Python 3.11, CUDA 12.1, PyTorch 2.4.1
  • GPU recommended: NVIDIA GPUs with CUDA support recommended for faster inference and particularly for training.

Setup

  1. Clone the repository and navigate to the directory:
cd clipPepPI
  1. Set up a virtual environment:
python3 -m venv venv
source venv/bin/activate  # windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Inference

Generate embeddings or score protein-peptide pairs using the trained model.

Basic Usage

python clip_inference.py \
    --mode <mode> \
    --csv <input_csv> \
    --save <output_path>

Arguments

  • --mode (required): Inference mode: embed_domains, embed_peptides, or score
  • --csv (required): Input CSV file path (format depends on mode)
  • --save (required): Output path for embeddings or scores (.npz format)
  • --batch_size (optional): Batch size for inference (default: 64)

Modes

1. Embed Domains

Generate embeddings for protein domains:

python clip_inference.py \
    --mode embed_domains \
    --csv domains.csv \
    --save domain_embeddings.npz

Input CSV format:

  • sequence_A: Domain protein sequences
  • interface_indexes (optional): Interface residue indices in format "i,j,k" (0-based)

2. Embed Peptides

Generate embeddings for peptide sequences:

python clip_inference.py \
    --mode embed_peptides \
    --csv peptides.csv \
    --save peptide_embeddings.npz

Input CSV format:

  • sequence_B: Peptide sequences

3. Score Pairs

Score domain-peptide interaction pairs:

python clip_inference.py \
    --mode score \
    --csv pairs.csv \
    --save scores.npz

Input CSV format:

  • sequence_A: Domain protein sequences
  • sequence_B: Peptide sequences
  • interface_indexes (optional): Interface residue indices

Examples

Example input files are provided in the examples/ directory:

Embed domains:

python clip_inference.py \
    --mode embed_domains \
    --csv examples/domains_only.csv \
    --save examples/domain_embeddings.npz

Embed peptides:

python clip_inference.py \
    --mode embed_peptides \
    --csv examples/peptides_only.csv \
    --save examples/peptide_embeddings.npz

Score domain-peptide pairs:

python clip_inference.py \
    --mode score \
    --csv examples/peptide_domain_pairs.csv \
    --save examples/scores.npz

Training

Train clipPepPI models using k-fold cross-validation on protein-peptide interaction data.

Basic Usage

python clip_ppi.py \
    --fold <fold_index> \
    --save_path <output_directory> \
    --flush_path <log_file_path>

Arguments

  • --fold (required): Fold index for cross-validation (0-6 for 7-fold CV)
  • --save_path (required): Output directory for trained models and results
  • --flush_path (required): Path to training log file

Note: The clip_ppi.py file contains boolean variables to define the type of training data (e.g., whether to include domain-fragment interactions derived from protein-protein interactions)

Example

python clip_ppi.py \
    --fold 0 \
    --save_path ./trained_models/fold_0 \
    --flush_path ./logs/fold_0/train.log

Data Format

Downloading Datasets and Weights

All datasets and model weights are deposited on Hugging Face Hub: https://huggingface.co/datasets/dorstein0909/ClipPepPI/tree/main

To download them locally:

Download Weights:

cd weights/
python download_hf_weights.py

Download Datasets:

cd data/
python download_hf_dataset.py

Requires: pip install huggingface-hub

Datasets

After downloading, datasets are available in ./data/ppi/ and ./data/domain_families/:

Training Data:

  • Domain-peptide interactions from PPI3D: fold_{0-6}.csv, fold_{0-6}_with_negatives.csv: negative examples are provided for validation, but only positive examples are used for training
  • Domain-fragment interactions derived from PINDER: ppi_all_pinder.csv
  • Specific domain families (SH3, PDZ, etc.): {domain_name}_voro.csv, {domain_name}_voro_TEST.csv

Test Data:

  • NES test set: Nuclear export signal sequences (nes_test.csv)
  • ProP-PD test set: Phage-display derived peptide interactions (propPdTest.csv)
  • Domain-peptide test set: PPI3D test splits (ppi_test.csv, ppi_test_with_negatives.csv)

CSV Format

Training/validation CSV files should contain:

  • sequence_A: Protein domain sequence
  • sequence_B: Peptide sequence
  • label: Binary interaction label (0/1)
  • pdb: PDB identifier
  • interface_indexes: Receptor interface indexes (0-based)

Citation

If you use ClipPepPI, please cite:

@article {Hochner-Vilk2026.03.18.712595,
	author = {Hochner-Vilk, Tanya and Stein, Dor and Schueler-Furman, Ora and Raveh, Barak and Chook, Yuh Min and Schneidman-Duhovny, Dina},
	title = {CliPepPI: Scalable prediction of domain-peptide specificity using contrastive learning},
	elocation-id = {2026.03.18.712595},
	year = {2026},
	doi = {10.64898/2026.03.18.712595},
	publisher = {Cold Spring Harbor Laboratory},
	abstract = {Domain-peptide interactions mediate a significant fraction of cellular protein networks, yet accurately predicting their specificity remains challenging. Peptide motifs typically have short, fuzzy sequence profiles, and their interactions are often weak and transient, limiting the size, coverage, and quality of experimentally validated domain-peptide datasets. Since true non-binders are rarely known, constructing negative examples often introduces bias. While structure-based prediction methods can achieve high accuracy, they are computationally demanding and difficult to scale to the proteome level. We introduce CLIPepPI, a dual-encoder model that leverages contrastive learning to embed domains and peptides into a shared space directly from sequence. Both encoders are initialized from a protein language model (ESM-C) and fine-tuned using lightweight LoRA adapters, enabling parameter-efficient training on positive pairs alone. To overcome data scarcity, we augment \~{}3K protein-peptide complexes from PPI3D with \~{}150K domain-peptide pairs derived from protein-protein interfaces. CLIPepPI further injects structural information by marking interface residues in the domain sequence, thus guiding the encoders toward binding regions and linking sequence-level learning with structural context. Competitive performance is achieved across three independent benchmarks: domain-peptide complexes from PPI3D, large-scale phage-library data from ProP-PD, and a curated dataset of nuclear export signal (NES) sequences. We demonstrate scalability and generalization through two applications: (i) proteome-wide NES scanning, and (ii) variant-effect prediction, where score changes in domain-peptide interactions between wild-type and mutant sequences discriminate pathogenic from benign variants. Together, CLIPepPI offers a scalable, structure-informed model for predicting domain-peptide specificity and generating meaningful embeddings suited for large-scale proteomic analyses. CLIPepPI is available at: https://bio3d.cs.huji.ac.il/webserver/clipeppi/.Competing Interest StatementThe authors have declared no competing interest.},
	URL = {https://www.biorxiv.org/content/early/2026/03/20/2026.03.18.712595},
	eprint = {https://www.biorxiv.org/content/early/2026/03/20/2026.03.18.712595.full.pdf},
	journal = {bioRxiv}
}

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Contact

For any bugs, reports or contributions please open a github issue. Alternatively contact us via: tanya.hochner@mail.huji.ac.il, dor.stein@mail.huji.ac.il

About

CLIPepPI: Domain-peptide specificity prediction using contrastive learning

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages