<commit_before># mhcflurry
Peptide-MHC binding affinity prediction

## Quickstart

Set up the Python environment:

```
# (set up environment)
pip install scipy Cython
pip install h5py
python setup.py develop
```

Download, Normalize, and Combine Training Data:

(make sure you have `wget` available, e.g. `brew install wget` on Mac OS X)

```
scripts/download-iedb.sh
scripts/download-peters-2013-dataset.sh
scripts/create-iedb-class1-dataset.py
scripts/create-combined-class1-dataset.py
```

## Getting Started: Train Neural Network Models

```
scripts/train-class1-allele-specific-models.py
```
<commit_msg>Add usage example<commit_after># mhcflurry
Peptide-MHC binding affinity prediction

## Quickstart

Set up the Python environment:

```
# (set up environment)
pip install scipy Cython
pip install h5py
python setup.py develop
```

Download, Normalize, and Combine Training Data:

(make sure you have `wget` available, e.g. `brew install wget` on Mac OS X)

```
scripts/download-iedb.sh
scripts/download-peters-2013-dataset.sh
scripts/create-iedb-class1-dataset.py
scripts/create-combined-class1-dataset.py
```

## Train Neural Network Models

```
scripts/train-class1-allele-specific-models.py
```

This will train separate models for each HLA type.

## Making predictions

```python
from mhcflurry import Mhc1BindingPredictor
predictor = Mhc1BindingPredictor('A0201')
predictor.predict_peptides(['SIINFEKL'])
```

```
  Allele   Peptide  Prediction
0  A0201  SIINFEKL  586.730529
```
{'fraction_non_alphanumeric': 0.11066398390342053, 'fraction_numerical': 0.02414486921529175, 'mean_word_length': 5.016129032258065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1707891', 'n_tokens_mistral': 541, 'n_tokens_neox': 485, 'n_words': 138}