Python interface to running command-line and web-based MHC binding predictors
Python Shell
Latest commit 3e5b5ed Feb 17, 2017 @iskandr iskandr committed on GitHub Merge pull request #85 from hammerlab/use-mhcnames
removed alleles module, using mhcnames package instead
Permalink
Failed to load latest commit information.
mhctools
test
.gitignore
.travis.yml
LICENSE
README.md
RELEASING.md
lint.sh
pylintrc
requirements.txt
setup.py

README.md

Build Status Coverage Status DOI

mhctools

Python interface to running command-line and web-based MHC binding predictors.

Example

from mhctools import NetMHCpan
# Run NetMHCpan for alleles HLA-A*01:01 and HLA-A*02:01
predictor = NetMHCpan(alleles=["A*02:01", "hla-a0101"])

# scan the short proteins 1L2Y and 1L3Y for epitopes
protein_sequences = {
  "1L2Y": "NLYIQWLKDGGPSSGRPPPS",
  "1L3Y": "ECDTINCERYNGQVCGGPGRGLCFCGKCRCHPGFEGSACQA"
}

epitope_collection = predictor.predict(protein_sequences)

# flatten binding predictions into a Pandas DataFrame
df = epitope_collection.dataframe()

# epitope collection is sorted by percentile rank
# of binding predictions
strongest_predicted_binder = epitope_collection[0]

API

The following MHC binding predictors are available in mhctools:

  • NetMHC3: requires locally installed version of NetMHC 3.x
  • NetMHC4: requires locally installed version of NetMHC 4.x
  • NetMHC: a wrapper function to automatically use NetMHC3 or NetMHC4 depending on what's installed.
  • NetMHCpan: requires locally installed version of NetMHCpan
  • NetMHCIIpan: requires locally installed version of NetMHCIIpan
  • NetMHCcons: requires locally installed version of NetMHCcons
  • IedbMhcClass1: Uses IEDB's REST API for class I binding predictions.
  • IedbMhcClass2: Uses IEDB's REST API for class II binding predictions.
  • RandomBindingPredictor: Creates binding predictions with random IC50 and percentile rank values.

Every binding predictor is constructed with an alleles argument specifying the HLA type for which to make predictions. Predictions are generated by calling the predict method with a dictionary mapping sequence IDs or names to amino acid sequences.

Additionally there is a module for running the NetChop proteosomal cleavage predictor:

  • NetChop: requires locally installed version of NetChop-3.1