def __init__(<EOL>self,<EOL>program_name,<EOL>alleles,<EOL>parse_output_fn,<EOL>supported_alleles_flag,<EOL>input_file_flag,<EOL>length_flag,<EOL>allele_flag,<EOL>peptide_mode_flags=["<STR_LIT>"],<EOL>tempdir_flag=None,<EOL>extra_flags=[],<EOL>max_peptides_per_file=<NUM_LIT:10> ** <NUM_LIT:4>,<EOL>process_limit=-<NUM_LIT:1>,<EOL>default_peptide_lengths=[<NUM_LIT:9>],<EOL>group_peptides_by_length=False,<EOL>min_peptide_length=<NUM_LIT:8>,<EOL>max_peptide_length=None,):
require_string(program_name, "<STR_LIT>")<EOL>self.program_name = program_name<EOL>if supported_alleles_flag is not None:<EOL><INDENT>require_string(supported_alleles_flag, "<STR_LIT>")<EOL><DEDENT>self.supported_alleles_flag = supported_alleles_flag<EOL>require_string(input_file_flag, "<STR_LIT>")<EOL>self.input_file_flag = input_file_flag<EOL>require_string(length_flag, "<STR_LIT>")<EOL>self.length_flag = length_flag<EOL>require_string(allele_flag, "<STR_LIT>")<EOL>self.allele_flag = allele_flag<EOL>require_iterable_of(peptide_mode_flags, string_types)<EOL>self.peptide_mode_flags = peptide_mode_flags<EOL>if tempdir_flag is not None:<EOL><INDENT>require_string(tempdir_flag, "<STR_LIT>")<EOL><DEDENT>self.tempdir_flag = tempdir_flag<EOL>require_iterable_of(extra_flags, string_types)<EOL>self.extra_flags = extra_flags<EOL>require_integer(<EOL>max_peptides_per_file,<EOL>"<STR_LIT>")<EOL>self.max_peptides_per_file = max_peptides_per_file<EOL>require_integer(process_limit, "<STR_LIT>")<EOL>self.process_limit = process_limit<EOL>self.parse_output_fn = parse_output_fn<EOL>if isinstance(default_peptide_lengths, int):<EOL><INDENT>default_peptide_lengths = [default_peptide_lengths]<EOL><DEDENT>self.group_peptides_by_length = group_peptides_by_length<EOL>if self.supported_alleles_flag:<EOL><INDENT>valid_alleles = self._determine_supported_alleles(<EOL>self.program_name,<EOL>self.supported_alleles_flag)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>run_command([self.program_name])<EOL><DEDENT>except:<EOL><INDENT>raise SystemError("<STR_LIT>" % self.program_name)<EOL><DEDENT>valid_alleles = None<EOL><DEDENT>try:<EOL><INDENT>BasePredictor.__init__(<EOL>self,<EOL>alleles=alleles,<EOL>valid_alleles=valid_alleles,<EOL>default_peptide_lengths=default_peptide_lengths,<EOL>min_peptide_length=min_peptide_length,<EOL>max_peptide_length=max_peptide_length)<EOL><DEDENT>except UnsupportedAllele as e:<EOL><INDENT>if self.supported_alleles_flag:<EOL><INDENT>additional_message = (<EOL>"<STR_LIT>" % (<EOL>self.program_name,<EOL>self.supported_alleles_flag))<EOL><DEDENT>else:<EOL><INDENT>additional_message = "<STR_LIT>"<EOL><DEDENT>raise UnsupportedAllele(str(e) + additional_message)<EOL><DEDENT>
Parameters
----------
program_name : str
    Name of prediction program to run
    (e.g. "netMHCcons" or "netMHCIIpan")

alleles : list of str
    MHC alleles

supported_alleles_flag : str
    Flag to pass to the predictor to get a list of supported alleles
    (e.g. "-A", "-list", "-listMHC")

parse_output_fn : fn
    Takes the stdout string from the predictor and returns a collection
    of BindingPrediction objects

input_file_flag : str
    How to specify the input FASTA file of source sequences (e.g. "-f")

length_flag : str
    How to specify the desired predicted peptide length (e.g. "-length")

allele_flag : str
    How to specify the allele we want predictions for (e.g. "-a")

peptide_mode_flags : list of str
    How to switch from the default FASTA subsequences input mode to
    where peptides are explicitly given one per line of a text file.

tempdir_flag : str, optional
    How to specify the predictor's temporary directory (e.g. "-tdir")

extra_flags : list of str
    Extra flags to pass to the predictor

max_peptides_per_file : int, optional
    Maximum number of lines per file when predicting peptides directly.

process_limit : int, optional
    Maximum number of parallel processes to start
    (0 for no limit, -1 for use all available processors)

default_peptide_lengths : list of int, optional
    When making predictions across subsequences of protein sequences,
    what peptide lengths to predict for.

group_peptides_by_length : bool
    Run commandline predictor on groups of peptides of equal length

min_peptide_length : int
    Shortest peptide this predictor can handle

max_peptide_length : int
    Longest peptide this predictor can handle