Git Product home page Git Product logo

mhctools's Introduction

Tests PyPI

mhctools

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

Commandline examples

Prediction for user-supplied peptide sequences

mhctools --sequence SIINFEKL SIINFEKLQ --mhc-predictor netmhc --mhc-alleles A0201

Automatically extract peptides as subsequences of specified length

mhctools --sequence AAAQQQSIINFEKL --extract-subsequences --mhc-peptide-lengths 8-10 --mhc-predictor mhcflurry --mhc-alleles A0201

Python usage

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"
}

binding_predictions = predictor.predict_subsequences(protein_sequences, peptide_lengths=[9])

# flatten binding predictions into a Pandas DataFrame
df = binding_predictions.to_dataframe()

# epitope collection is sorted by percentile rank
# of binding predictions
for binding_prediction in binding_predictions:
    if binding_prediction.affinity < 100:
        print("Strong binder: %s" % (binding_prediction,))

API

The following MHC binding predictors are available in mhctools:

  • MHCflurry: open source predictor installed by default with mhctools, requires the user run mhcflurry-downloads fetch first to download MHCflurry models
  • 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

mhctools's People

Contributors

iskandr avatar julia326 avatar tavinathanson avatar timodonnell avatar dhuvik avatar arahuja avatar amitschang avatar denklewer avatar

Forkers

zsxshawn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.