运行命令行和基于web的mhc绑定预测程序的python接口
mhctools的Python项目详细描述
mhctools
运行命令行和基于web的mhc绑定预测程序的python接口。
命令行示例
预测用户提供的肽序列
mhctools --sequence SIINFEKL SIINFEKLQ --mhc-predictor netmhc --mhc-alleles A0201
自动提取肽作为指定长度的子序列
mhctools --sequence AAAQQQSIINFEKL --extract-subsequences --mhc-peptide-lengths 8-10 --mhc-predictor mhcflurry --mhc-alleles A0201
python用法
frommhctoolsimportNetMHCpan# Run NetMHCpan for alleles HLA-A*01:01 and HLA-A*02:01predictor=NetMHCpan(alleles=["A*02:01","hla-a0101"])# scan the short proteins 1L2Y and 1L3Y for epitopesprotein_sequences={"1L2Y":"NLYIQWLKDGGPSSGRPPPS","1L3Y":"ECDTINCERYNGQVCGGPGRGLCFCGKCRCHPGFEGSACQA"}binding_predictions=predictor.predict_subsequences(protein_sequences,peptide_lengths=[9])# flatten binding predictions into a Pandas DataFramedf=binding_predictions.to_dataframe()# epitope collection is sorted by percentile rank# of binding predictionsforbinding_predictioninbinding_predictions:ifbinding_prediction.affinity<100:print("Strong binder: %s"%(binding_prediction,))
API
以下mhc绑定预测器在mhctools
中可用:
MHCflurry
:默认与mhctools
一起安装的开源预测程序,要求用户首先运行mhcflurry-downloads fetch
以下载mhcflurry模型NetMHC3
:需要本地安装的NetMHC 3.x版本NetMHC4
:需要本地安装的NetMHC 4.x版本NetMHC
:根据安装的内容自动使用NetMHC3
或NetMHC4
的包装函数。NetMHCpan
:需要本地安装的NetMHCpan版本NetMHCIIpan
:需要本地安装的NetMHCIIpan版本NetMHCcons
:需要本地安装的NetMHCcons版本IedbMhcClass1
:使用iedb的rest api进行类i绑定预测。IedbMhcClass2
:使用iedb的rest api进行类ii绑定预测。RandomBindingPredictor
:创建具有随机IC50和百分位秩值的绑定预测。
每个绑定预测器都由一个指定要进行预测的hla类型的alleles
参数构造。预测是通过调用predict
方法生成的,该方法通过字典将序列id或名称映射到氨基酸序列。
此外,还有一个模块用于运行NetChop蛋白质体切割预测器:
NetChop
:需要本地安装的NetChop-3.1版本