kunikohunter's picture
Update README.md
f81d14d verified
---
license: cc-by-4.0
task_categories:
- other
tags:
- biology
- protein-structure
- MHC
- HLA
- peptide
- binding-affinity
- rosetta
- immunology
pretty_name: pHLA Binding Affinity with Rosetta FlexPepDock Structures
size_categories:
- 10K<n<100K
---
# pHLA Binding Affinity with Rosetta FlexPepDock Structures
**Author:** K. Hunter, Vanderbilt University Medical Center
**License:** CC BY 4.0
**Metadata source:** [Immune Epitope Database (IEDB)](https://www.iedb.org)
---
## Dataset Summary
This dataset combines experimentally measured peptide–HLA (pHLA) binding affinities from the IEDB with computationally generated 3D structures produced using Rosetta FlexPepDock. It covers 37 HLA class I alleles (HLA-A and HLA-B), 14,077 unique peptides, and 49,490 peptide–allele pairs with associated docked structures.
Each peptide–allele pair with a recorded binding measurement (Kd or IC50) is linked to an ensemble of 25 Rosetta FlexPepDock decoy structures, along with summary Rosetta energy statistics.
Intended uses include:
- Training and benchmarking machine learning models for pHLA binding affinity prediction
- Evaluating computational docking and scoring methods against experimental binding data
---
## Dataset Structure
```
pHLA_binding/
├── README.md
├── metadata.csv # Master table — one row per IEDB measurement
└── structures/
├── A0101/
│ ├── FHEFLSSKL.silent
│ ├── GILGFVFTL.silent
│ └── ...
├── A0201/
└── ...
```
Each silent file contains the full 25-decoy ensemble for a single peptide–allele pair, including embedded Rosetta energy scores. Allele directory names use filesystem-safe notation (e.g. `A0101/` for `HLA-A*01:01`), and silent files are named after the peptide sequence. The `allele` column in `metadata.csv` contains the standard notation (`A*01:01`).
---
## Metadata Fields
| Column | Description |
|---|---|
| `allele_iedb` | Allele name in IEDB format (e.g. `HLA-A_01_01`) |
| `allele` | Standard allele notation (e.g. `A*01:01`) |
| `peptide` | Peptide amino acid sequence |
| `peptide_length` | Length of peptide in residues |
| `measurement_type` | `IC50` or `Kd` |
| `measurement_value` | Quantitative binding measurement |
| `measurement_units` | Units of measurement (nM) |
| `assay_method` | Assay method as reported in IEDB |
| `assay_response` | Full assay response description from IEDB |
| `pubmed_id` | PubMed ID of the source publication |
| `parent_protein` | Source protein of the peptide |
| `protein_accession` | UniProt/GenBank accession of source protein |
| `source_organism` | Organism of origin |
| `assay_pdb_id` | Experimental PDB ID from IEDB (if available) |
| `flagged` | Whether entry was flagged during IEDB data cleaning |
| `num_decoys` | Number of decoy structures in the silent file (typically 25) |
| `rosetta_best_score` | Minimum total_score across 25 decoys (REU), extracted from silent file |
| `rosetta_mean_score` | Mean total_score across 25 decoys (REU), extracted from silent file |
| `pdb_dir` | Relative path to the peptide silent file within the dataset |
---
## Dataset Statistics
| Metric | Count |
|---|---|
| Total measurements | 49,924 |
| Unique alleles | 37 |
| Unique peptides | 14,077 |
| IC50 measurements | 13,942 |
| Kd measurements | 35,982 |
| Flagged entries | 16 |
| Total silent files | 49,924 |
| Total decoy structures | 1,237,250 |
---
## IEDB Data Curation
Binding affinity data were retrieved from a local copy of the IEDB bulk download (`mhc_ligand_full.csv`) and processed using a custom Python pipeline (`IEDBTestPipeline.py`). The curation procedure is described below.
### 1. Retrieval and Assay Filtering
The full IEDB MHC ligand table was read in chunks and filtered to retain only entries belonging to HLA-A or HLA-B alleles with quantitative binding measurements. Rows were retained only if they reported one of two assay response types:
- **Half maximal inhibitory concentration (IC50)**
- **Dissociation constant (Kd)**
Variant labels in the IEDB (e.g., `dissociation constant KD (~EC50)`, `dissociation constant KD (~IC50)`) were normalized to a single canonical label (`dissociation constant (KD)`) prior to filtering. Entries missing either a quantitative measurement value or assay units were dropped.
### 2. Per-Allele Deduplication
After filtering, records were grouped by allele. Within each allele, duplicate entries for the same epitope (identified by IEDB Epitope IRI) were resolved separately for IC50 and Kd measurements using the following decision rules, applied in order:
| Scenario | Action |
|---|---|
| Two entries, one lacks a PubMed ID | Retain the entry with a PubMed ID; drop the other |
| Two entries, both lack PubMed IDs, values differ by ≤10 nM | Retain one entry (first occurrence) |
| Two entries, both lack PubMed IDs, values differ by >10 nM | Drop both entries |
| Two entries, both have PubMed IDs, values differ by <10 nM | Retain one entry (first occurrence) |
| Two entries, both have PubMed IDs, values conflict (≥10 nM difference) | Flag both for manual review |
| More than two entries | Drop entries lacking PubMed IDs first; if >2 remain, retain the entry closest to the median measurement value |
| Any other ambiguous case | Flag for manual review |
Entries that could not be unambiguously resolved were written to a separate `flagged_IEDB_data.csv` file for each allele and excluded from the cleaned dataset. These correspond to the `flagged = True` entries in `metadata.csv`.
### 3. Sequence-Level Filtering
After deduplication, peptide sequences containing the `+` character (used by IEDB to denote non-canonical or modified amino acids) were excluded from the final FASTA output and downstream structure generation.
### 4. Outputs per Allele
For each allele, the pipeline produced:
- `{allele}_cleaned_IEDB_data.csv` — deduplicated, unflagged entries retained for structure modeling
- `{allele}_flagged_IEDB_data.csv` — ambiguous entries excluded from modeling but retained for reference
- `{allele}_IEDB_data.fasta` — peptide sequences in FASTA format for input to Rosetta FlexPepDock
These per-allele files were generated in filesystem-safe allele directories (e.g., `HLA-A_01_01/` for `HLA-A*01:01`) within the working directory at the time of pipeline execution.
### 5. Manual Review Checkpoint
By default, the pipeline pauses after generating per-allele cleaned and flagged CSVs to allow manual literature review of flagged entries before structure generation proceeds. In this dataset, flagged entries were reviewed and those confirmed as erroneous or unresolvable were excluded. The `--skipReview` flag bypasses this checkpoint when manual review is not required.
---
## Computational Methods
3D structures were generated using **Rosetta FlexPepDock** with 25 decoys per peptide–allele pair. Input structures were prepared by threading the peptide sequence of interest onto a template pHLA structure and performing flexible peptide docking.
All decoy structures and their associated Rosetta energy scores are stored in per-peptide Rosetta silent files (`structures/{allele}/{peptide}.silent`). Scores are reported as `total_score` (Rosetta Energy Units, REU) and are embedded directly in the silent file alongside the decoy coordinates. Summary statistics (min, mean) across the 25-decoy ensemble are precomputed and included in `metadata.csv`. Individual decoy structures can be extracted from silent files using `extract_pdbs` from the Rosetta toolkit.
---
## Known Limitations and Caveats
**Binding measurement caveats:**
- IC50 values show large spikes at 20,000 nM and 70,000 nM, consistent with assay detection limits. These values should be treated as censored (i.e. greater than the reported value) rather than exact measurements.
- Kd values show analogous saturation at 5,000 nM and 20,000 nM for the same reason.
- IC50 and Kd are not directly comparable and have not been normalized or converted between each other. Both are retained with `measurement_type` indicating which was recorded.
**Structure caveats:**
- All 3D structures are computationally generated; no experimental validation has been performed.
- RMSD values embedded in silent files are calculated relative to the threaded template input, not to any experimental reference structure, and should not be interpreted as a measure of model accuracy.
- The best-scoring Rosetta decoy is not guaranteed to represent the native-like conformation.
**Coverage caveats:**
- Allele representation is highly uneven: `A*02:01` accounts for ~9,500 entries (~19% of the dataset), while several alleles have fewer than 10 entries.
- The dataset covers HLA class I only (HLA-A and HLA-B). HLA-C and class II alleles are not included.
- The `assay_pdb_id` column references experimental structures deposited in the PDB as recorded by IEDB; these structures are not included in this dataset.
---
## License
This dataset is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). You are free to share and adapt the material for any purpose, provided appropriate credit is given.
Experimental binding data is sourced from the [Immune Epitope Database (IEDB)](https://www.iedb.org), which is also available under CC BY 4.0. Please cite IEDB if you use this dataset:
> Vita R, Mahajan S, Overton JA, et al. The Immune Epitope Database (IEDB): 2018 update. *Nucleic Acids Research*. 2019;47(D1):D339–D343. https://doi.org/10.1093/nar/gky1006
---
## Usage Example
```python
import pandas as pd
from pathlib import Path
# Load metadata
df = pd.read_csv("metadata.csv")
# Filter to unflagged IC50 entries below detection limit
df_clean = df[
~df["flagged"] &
(df["measurement_type"] == "IC50") &
(df["measurement_value"] < 20000)
]
print(f"{len(df_clean)} clean IC50 entries")
print(f"Alleles: {df_clean['allele'].nunique()}")
print(f"Unique peptides: {df_clean['peptide'].nunique()}")
# Locate the silent file for a specific peptide-allele pair
silent_file = Path("structures/A0101/FHEFLSSKL.silent")
print(f"Silent file exists: {silent_file.exists()}")
# To extract individual PDB structures, use Rosetta's extract_pdbs:
# extract_pdbs.linuxgccrelease -in:file:silent structures/A0101/FHEFLSSKL.silent
```