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|
| 5 |
+
tags:
|
| 6 |
+
- tcr
|
| 7 |
+
- mhc
|
| 8 |
+
- peptide
|
| 9 |
+
- immunology
|
| 10 |
+
- out-of-distribution
|
| 11 |
+
- allelic-generalization
|
| 12 |
+
- biology
|
| 13 |
+
- sequence-modeling
|
| 14 |
+
size_categories:
|
| 15 |
+
- 10K<n<100K
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Allelic OOD Dataset
|
| 19 |
+
|
| 20 |
+
## Dataset Description
|
| 21 |
+
|
| 22 |
+
The Allelic OOD (Out-of-Distribution) dataset is designed to evaluate TCR-pMHC binding prediction models on **rare and novel HLA alleles** that are infrequent or completely absent in training data. This tests the model's ability to generalize to new HLA variants (allelic generalization).
|
| 23 |
+
|
| 24 |
+
### Key Features
|
| 25 |
+
|
| 26 |
+
- **Allelic OOD Testing**: Contains samples with HLA alleles that appear at ≤1% frequency in **both** PM and PMT training sets (rare alleles), plus alleles completely absent from training (zero-shot alleles)
|
| 27 |
+
- **Two OOD Types**:
|
| 28 |
+
- **Rare Alleles**: HLA alleles with ≤1% frequency in training (intersection of PM and PMT trains)
|
| 29 |
+
- **Zero-Shot Alleles**: HLA alleles completely absent from both PM and PMT training sets
|
| 30 |
+
- **Dual Task Support**:
|
| 31 |
+
- **PMT Task**: Samples with CDR3 sequences (~10% of data) for TCR-Peptide-MHC prediction
|
| 32 |
+
- **PM Task**: All samples (100%) for Peptide-MHC prediction
|
| 33 |
+
- **Peptide Length Control**: All peptides filtered to 8-14 amino acids to isolate allelic OOD from length OOD
|
| 34 |
+
- **Standardized HLA Format**: All HLA alleles normalized to A*02:01 format
|
| 35 |
+
- **Quality Controlled**: Deduplicated and validated data
|
| 36 |
+
|
| 37 |
+
## Dataset Structure
|
| 38 |
+
|
| 39 |
+
### Data Format
|
| 40 |
+
|
| 41 |
+
CSV file with the following columns:
|
| 42 |
+
|
| 43 |
+
| Column | Type | Description | Required |
|
| 44 |
+
|--------|------|-------------|----------|
|
| 45 |
+
| CDR3 | string | TCR CDR3beta amino acid sequence | Optional (for PMT task) |
|
| 46 |
+
| peptide | string | Peptide amino acid sequence (8-14 aa) | Yes |
|
| 47 |
+
| HLA | string | HLA allele (e.g., A*02:01, B*07:02) | Yes |
|
| 48 |
+
| label | int | Binding label (1=binder, 0=non-binder) | Yes |
|
| 49 |
+
| ood_type | string | OOD category: 'rare' or 'zero' | Yes |
|
| 50 |
+
| HLA_sequence | string | HLA pseudo-sequence | Optional |
|
| 51 |
+
|
| 52 |
+
### Dataset Statistics
|
| 53 |
+
|
| 54 |
+
- **Total Samples**: 62205
|
| 55 |
+
- **Positive Samples**: 28167 (45.3%)
|
| 56 |
+
- **Negative Samples**: 34038 (54.7%)
|
| 57 |
+
- **Unique HLA Alleles**: 32
|
| 58 |
+
- Rare alleles (≤1% in training): 21
|
| 59 |
+
- Zero-shot alleles (absent in training): 11
|
| 60 |
+
- **Samples with CDR3 (PMT)**: 6094 (9.8%)
|
| 61 |
+
- **Samples without CDR3 (PM only)**: 56111 (90.2%)
|
| 62 |
+
- **Peptide Length Range**: 8-14 amino acids
|
| 63 |
+
|
| 64 |
+
### HLA Allele Distribution
|
| 65 |
+
|
| 66 |
+
The dataset focuses on rare and zero-shot HLA alleles:
|
| 67 |
+
- B*18:01: 40311 samples
|
| 68 |
+
- A*32:01: 1965 samples
|
| 69 |
+
- B*14:02: 1871 samples
|
| 70 |
+
- B*38:01: 1850 samples
|
| 71 |
+
- C*16:01: 1734 samples
|
| 72 |
+
- B*27:01: 1626 samples
|
| 73 |
+
- B*35:08: 1465 samples
|
| 74 |
+
- A*02:07: 1311 samples
|
| 75 |
+
- C*14:02: 1300 samples
|
| 76 |
+
- C*01:02: 1237 samples
|
| 77 |
+
|
| 78 |
+
## Usage
|
| 79 |
+
|
| 80 |
+
### Load with Hugging Face Datasets
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from datasets import load_dataset
|
| 84 |
+
|
| 85 |
+
dataset = load_dataset("YYJMAY/allelic-ood")
|
| 86 |
+
df = dataset['train'].to_pandas()
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Load with Pandas
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
import pandas as pd
|
| 93 |
+
from huggingface_hub import hf_hub_download
|
| 94 |
+
|
| 95 |
+
file_path = hf_hub_download(
|
| 96 |
+
repo_id="YYJMAY/allelic-ood",
|
| 97 |
+
filename="allelic_ood.csv",
|
| 98 |
+
repo_type="dataset"
|
| 99 |
+
)
|
| 100 |
+
df = pd.read_csv(file_path)
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
### Use with SPRINT Framework
|
| 104 |
+
|
| 105 |
+
```python
|
| 106 |
+
from sprint.core.dataset_manager import DatasetManager
|
| 107 |
+
|
| 108 |
+
manager = DatasetManager()
|
| 109 |
+
dataset_config = {
|
| 110 |
+
'hf_repo': 'YYJMAY/allelic-ood',
|
| 111 |
+
'files': ['allelic_ood.csv'],
|
| 112 |
+
'test': 'allelic_ood.csv'
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
files = manager.get_dataset('allelic_ood', dataset_config)
|
| 116 |
+
test_file = files['test']
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
## Construction Method
|
| 120 |
+
|
| 121 |
+
This dataset was constructed by:
|
| 122 |
+
|
| 123 |
+
1. **Training Set Analysis**: Analyzing HLA frequency distribution in both PMT and PM training sets
|
| 124 |
+
2. **Rare HLA Identification**:
|
| 125 |
+
- Rare: HLA alleles appearing at ≤1% frequency in **both** PM and PMT training sets
|
| 126 |
+
- Zero-shot: HLA alleles completely absent from both training sets
|
| 127 |
+
3. **Data Collection**: Extracting samples with rare/zero-shot HLAs from multiple OOD test sources
|
| 128 |
+
4. **Peptide Length Filtering**: Restricting to 8-14 amino acids to isolate allelic shift from length shift
|
| 129 |
+
5. **Format Standardization**: Normalizing HLA naming conventions (HLA-A*02:01 → A*02:01)
|
| 130 |
+
6. **Quality Control**: Deduplication and validation
|
| 131 |
+
|
| 132 |
+
## Citation
|
| 133 |
+
|
| 134 |
+
If you use this dataset, please cite:
|
| 135 |
+
|
| 136 |
+
```bibtex
|
| 137 |
+
@dataset{allelic_ood_2024,
|
| 138 |
+
title={Allelic OOD Dataset for TCR-pMHC Binding Prediction},
|
| 139 |
+
author={SPRINT Framework Contributors},
|
| 140 |
+
year={2024},
|
| 141 |
+
url={https://huggingface.co/datasets/YYJMAY/allelic-ood}
|
| 142 |
+
}
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
## License
|
| 146 |
+
|
| 147 |
+
MIT License
|
| 148 |
+
|
| 149 |
+
## Contact
|
| 150 |
+
|
| 151 |
+
For questions or issues, please open an issue on the dataset repository.
|