def NetMHCpan(<EOL>alleles,<EOL>program_name="<STR_LIT>",<EOL>process_limit=-<NUM_LIT:1>,<EOL>default_peptide_lengths=[<NUM_LIT:9>],<EOL>extra_flags=[]):
<EOL>with open(os.devnull, '<STR_LIT:w>') as devnull:<EOL><INDENT>output = check_output([<EOL>program_name, "<STR_LIT>", "<STR_LIT>"],<EOL>stderr=devnull)<EOL><DEDENT>output_str = output.decode("<STR_LIT:ascii>", "<STR_LIT:ignore>")<EOL>common_kwargs = {<EOL>"<STR_LIT>": alleles,<EOL>"<STR_LIT>": default_peptide_lengths,<EOL>"<STR_LIT>": program_name,<EOL>"<STR_LIT>": process_limit,<EOL>"<STR_LIT>": extra_flags,<EOL>}<EOL>if "<STR_LIT>" in output_str:<EOL><INDENT>return NetMHCpan28(**common_kwargs)<EOL><DEDENT>elif "<STR_LIT>" in output_str:<EOL><INDENT>return NetMHCpan3(**common_kwargs)<EOL><DEDENT>elif "<STR_LIT>" in output_str:<EOL><INDENT>return NetMHCpan4(**common_kwargs)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>")<EOL><DEDENT>
This function wraps NetMHCpan28 and NetMHCpan3 to automatically detect which class
to use, with the help of the miraculous and strange '--version' netmhcpan argument.