def test_netmhc_pan(): alleles = [normalize_allele_name(DEFAULT_ALLELE)] pan_predictor = NetMHCpan( alleles=alleles, epitope_lengths=[9]) fasta_dictionary = { "SMAD4-001": "ASIINFKELA", "TP53-001": "ASILLLVFYW" } epitope_collection = pan_predictor.predict( fasta_dictionary=fasta_dictionary) assert len(epitope_collection) == 4, \ "Expected 4 epitopes from %s" % (epitope_collection,)
# Downloaded from https://github.com/hammerlab/mhctools#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] # should be NLYIQWLKDGGPSSGRPPPS print strongest_predicted_binder.source_sequence