def __init__(<EOL>self,<EOL>peptide,<EOL>allele,<EOL>affinity,<EOL>percentile_rank,<EOL>source_sequence_name=None,<EOL>offset=<NUM_LIT:0>,<EOL>log_affinity=None,<EOL>prediction_method_name="<STR_LIT>"):
<EOL>if invalid_affinity(affinity) and np.isfinite(log_affinity):<EOL><INDENT>affinity = <NUM_LIT> ** (-log_affinity + <NUM_LIT:1>)<EOL><DEDENT>if invalid_affinity(affinity):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>affinity,<EOL>peptide,<EOL>allele))<EOL><DEDENT>if invalid_percentile_rank(percentile_rank):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>percentile_rank, peptide, allele))<EOL><DEDENT>self.source_sequence_name = source_sequence_name<EOL>self.offset = offset<EOL>self.allele = allele<EOL>self.peptide = peptide<EOL>self.affinity = affinity<EOL>self.percentile_rank = percentile_rank<EOL>self.prediction_method_name = prediction_method_name<EOL>
Parameters
----------
peptide : str
    Short amino acid sequence

allele : str
    HLA allele, e.g. HLA-A*02:01

affinity : float
    Predicted binding affinity

percentile_rank : float
    Percentile rank of the binding affinity for that allele

source_sequence_name : str
    Name of sequence from which peptide was extracted

offset : int
    Base0 starting position in source sequence that all epitopes were
    extracted from

log_affinity : float, optional
    NetMHC sometimes gives invalid IC50 values but we can still
    reconstruct the value from its (1.0 - log_50000(IC50)) score.

prediction_method_name : str, optional
    Name of predictor used to generate this prediction.