Datasets:
File size: 7,549 Bytes
992621a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | ---
license: mit
task_categories:
- text-classification
tags:
- tcr
- mhc
- peptide
- immunology
- temporal-shift
- covid-19
- out-of-distribution
size_categories:
- 10K<n<100K
---
# Temporal OOD Dataset for TCR-pMHC Binding Prediction
## Dataset Description
The **Temporal OOD (Out-of-Distribution) Dataset** evaluates TCR-pMHC binding prediction models under **temporal shift**. This dataset contains SARS-CoV-2 T cell receptor sequences collected during the COVID-19 pandemic, providing a natural test of model generalization to time-lagged data.
### Key Features
- **Temporal Shift Testing**: Data collected after training set construction
- **COVID-19 Focus**: SARS-CoV-2 T cell repertoire from pandemic
- **Complete PMT Data**: All samples include CDR3, peptide, and HLA
- **Multi-Laboratory**: Compiled from multiple research laboratories
- **Experimentally Validated**: All TCR-pMHC interactions experimentally annotated
## Dataset Details
### Construction Method
This dataset follows the out-of-date testing protocol introduced in FusionPMT, using the external SARS-CoV-2 repertoire from VDJdb's recent update. The sequences were:
1. Collected during COVID-19 pandemic by multiple laboratories
2. Experimentally annotated for peptide and HLA specificities
3. Filtered using standard quality control rules
4. Deduplicated to remove redundant entries
5. Validated for completeness
### Statistics
- **Total Samples**: 13979
- **Positive Samples**: 1272 (9.1%)
- **Negative Samples**: 12707 (90.9%)
- **Unique TCR Sequences**: N/A
- **Unique Peptide Epitopes**: 239
- **Unique HLA Alleles**: 48
### Data Format
CSV file with the following columns:
| Column | Type | Description | Required |
|--------|------|-------------|----------|
| CDR3 | string | TCR CDR3beta amino acid sequence | Yes |
| peptide | string | Peptide amino acid sequence | Yes |
| HLA | string | HLA allele (e.g., A*02:01) | Yes |
| label | int | Binding label (1=binder, 0=non-binder) | Yes |
| HLA_sequence | string | HLA pseudo-sequence | Optional |
### Peptide Length Distribution
- 7aa: 54 samples (0.4%)\n- 8aa: 1016 samples (7.3%)\n- 9aa: 9287 samples (66.4%)\n- 10aa: 2662 samples (19.0%)\n- 11aa: 729 samples (5.2%)\n- 12aa: 137 samples (1.0%)\n- 13aa: 42 samples (0.3%)\n- 20aa: 52 samples (0.4%)
### Label Distribution
- **Binders (label=1)**: 1272 samples
- **Non-binders (label=0)**: 12707 samples
- **Imbalance Ratio**: ~1:10.0 (positive:negative)
## Usage
### Load with Hugging Face Datasets
```python
from datasets import load_dataset
dataset = load_dataset("YYJMAY/temporal-ood")
df = dataset['train'].to_pandas()
```
### Load with Pandas
```python
import pandas as pd
from huggingface_hub import hf_hub_download
file_path = hf_hub_download(
repo_id="YYJMAY/temporal-ood",
filename="temporal_ood.csv",
repo_type="dataset"
)
df = pd.read_csv(file_path)
```
### Use with SPRINT Framework
```python
from sprint.core.dataset_manager import DatasetManager
manager = DatasetManager()
dataset_config = {
'hf_repo': 'YYJMAY/temporal-ood',
'files': ['temporal_ood.csv'],
'test': 'temporal_ood.csv'
}
files = manager.get_dataset('temporal_ood', dataset_config)
test_file = files['test']
```
## Scientific Context
### Temporal Shift Challenge
This dataset addresses a critical challenge in machine learning for immunology: **temporal generalization**. Models trained on historical data must generalize to new sequences collected at later time points. The COVID-19 pandemic provides a unique natural experiment for this evaluation.
### Why Temporal OOD Matters
1. **Real-world Deployment**: Clinical applications require models that work on future data
2. **Emerging Pathogens**: New disease outbreaks generate novel epitopes
3. **Distribution Drift**: Immune repertoires evolve over time
4. **Model Robustness**: Tests whether models learn fundamental biology vs. dataset artifacts
### Biological Significance
- **SARS-CoV-2 Epitopes**: Includes key viral peptides recognized by T cells
- **Pandemic Diversity**: Represents diverse patient populations and disease stages
- **Laboratory Consensus**: Multi-laboratory validation increases reliability
- **Clinical Relevance**: Direct connection to COVID-19 immune response research
## Task Compatibility
- **PMT Task**: Yes (all samples have CDR3)
- **PM Task**: Yes (peptide-HLA pairs available)
All 13979 entries are suitable for TCR-peptide-MHC (PMT) binding prediction.
## Quality Control
### Filtering Rules Applied
1. Removed entries with missing CDR3, peptide, or HLA
2. Removed duplicate (CDR3, peptide, HLA, label) combinations
3. Validated label values (0 or 1 only)
4. Checked for empty strings in critical columns
5. Verified HLA sequence availability
### Data Integrity
- **No Missing Values**: All required columns complete
- **No Duplicates**: 659 duplicates removed during preprocessing
- **Valid Labels**: All labels are binary (0 or 1)
- **Standardized Format**: Consistent with other SPRINT datasets
## Comparison with Training Data
This dataset intentionally differs from training data in temporal dimension:
| Aspect | Training Data | Temporal OOD |
|--------|---------------|--------------|
| Collection Period | Pre-pandemic | During COVID-19 pandemic |
| Epitope Source | Various pathogens | SARS-CoV-2 dominant |
| Data Vintage | Historical | Recent/contemporary |
| Distribution | Established | Time-shifted |
## Benchmark Results
This dataset is used to evaluate multiple TCR-pMHC binding prediction methods in the SPRINT benchmark suite. Expected performance characteristics:
- **Difficulty**: Moderate to challenging due to temporal shift
- **Baseline**: Random classifier ~9.1% (positive class frequency)
- **Evaluation Metrics**: AUC, AUPR, F1, Precision, Recall
## Citation
If you use this dataset, please cite:
```bibtex
@dataset{temporal_ood_2024,
title={Temporal OOD Dataset for TCR-pMHC Binding Prediction},
author={SPRINT Framework Contributors},
year={2024},
note={SARS-CoV-2 T cell repertoire data from VDJdb},
url={https://huggingface.co/datasets/YYJMAY/temporal-ood}
}
```
And the original VDJdb paper:
```bibtex
@article{goncharov2022vdjdb,
title={VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium},
author={Goncharov, Mikhail and others},
journal={Nucleic Acids Research},
year={2022}
}
```
## Related Datasets
- **Allelic OOD**: Tests generalization to rare HLA alleles
- **Modality OOD**: Tests cross-modality generalization (BA ↔ EL)
- **FusionPMT Training**: Original training data
## Limitations
1. **COVID-19 Bias**: Heavy emphasis on SARS-CoV-2 epitopes
2. **Temporal Specificity**: Limited to pandemic time period
3. **Imbalanced Labels**: Negative samples dominate (~87%)
4. **HLA Coverage**: 48 alleles, may not cover all population diversity
## License
MIT License - Free for academic and commercial use
## Contact
For questions, issues, or contributions:
- Dataset repository: YYJMAY/temporal-ood
- SPRINT framework: https://github.com/Computational-Machine-Intelligence/SPRINT
## Acknowledgments
- VDJdb team for SARS-CoV-2 repertoire data
- Multiple laboratories contributing T cell sequences during COVID-19 pandemic
- FusionPMT authors for temporal OOD protocol design
|