Standalone Package

Run HAIRpred2 locally on your own machine, without internet access.

HAIRpred2 Standalone (ZIP)

Complete package with Python script, pre-trained model, and README. Runs locally without internet access.

hairpred2.py best_model_random_forest.pkl README.md
Download ZIP GitHub

Pre-Trained Model Only

Download just the Random Forest model file if you already have the script installed.

best_model_random_forest.pkl ~253 MB
Download Model

Training & Test Data

Download the dataset used for model training and evaluation.

train.zip test.zip ~100 MB
Download Train Download Test

Install via pip

Quickly install HAIRpred2 directly from PyPI using pip.

pip hairpred2 PyPI
pip install hairpred2 View on PyPI

Installation

Install required Python packages and system dependencies.

Python packagesbash
# Install all required packages
pip install numpy pandas joblib gemmi biopython scipy
System dependency — mkdssp (required for RSA calculation)bash
# Linux / Ubuntu
sudo apt install dssp

# Conda (any platform — recommended)
conda install -c salilab dssp

# macOS (Homebrew)
brew install dssp

The model file best_model_random_forest.pkl must be placed in the same folder as hairpred2.py. It is loaded automatically — no argument needed.


Usage

Command-line examples for common use cases.

Basic usagebash
# Basic — single chain, default threshold 0.5
python hairpred2.py -i antigen.pdb -c A

# Custom output prefix
python hairpred2.py -i antigen.pdb -c A -o my_results

# Multiple antigen chains
python hairpred2.py -i antigen.pdb -c A,B

# Filter buried residues (recommended)
python hairpred2.py -i antigen.pdb -c A --min-rsa 0.05

# Custom probability threshold
python hairpred2.py -i antigen.pdb -c A -t 0.4
All argumentsbash
python hairpred2.py --help

  -i / --input     Input antigen PDB file             (required)
  -c / --chain     Chain ID (e.g. A) or A,B            (required)
  -o / --output    Output file prefix                  (default: hairpred2_results)
  -t / --threshold Probability threshold                (default: 0.5)
      --min-rsa     Minimum RSA filter                  (default: none)

Example Data

Test files to verify your installation.

Example PDB File

Antigen PDB file (8tui_antigen_A.pdb) for testing. Use with Chain ID A.

Download Example PDB

Training & Test Dataset

277 human Ag-Ab complexes (221 train + 56 test) with PDB IDs and epitope labels.

277 complexes human-specific
Download Dataset

Output Files Reference

Description of all 5 output files generated per prediction job.

File Description
<prefix>.csv Per-residue predictions — Residue, RSA, Probability (0–1), Prediction label
<prefix>_summary.txt Statistics: total counts, percentages, average probability, top 10 residues
<prefix>_bfactor.pdb PDB with B-factor column replaced by probability ×100. Use spectrum b, blue_white_red in PyMOL
<prefix>.pml PyMOL script — colors interacting residues red, adds residue+probability labels on Cα atoms
<prefix>_patches.txt Epitope patch clusters — spatially adjacent interacting residues (Cα < 10Å)

License

HAIRpred2 is freely available for academic and non-commercial use. For commercial licensing or collaboration enquiries, please contact us.