<s> from mhctools import NetMHCcons <EOL> from mhctools . alleles import normalize_allele_name <EOL> DEFAULT_ALLELE = '<STR_LIT>' <EOL> def test_netmhc_cons ( ) : <EOL> alleles = [ normalize_allele_name ( DEFAULT_ALLELE ) ] <EOL> cons_predictor = NetMHCcons ( <EOL> alleles = alleles , <EOL> epitope_lengths = [ <NUM_LIT:9> ] ) <EOL> fasta_dictionary = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> epitope_collection = cons_predictor . predict ( <EOL> fasta_dictionary = fasta_dictionary ) <EOL> assert len ( epitope_collection ) == <NUM_LIT:4> , "<STR_LIT>" % ( epitope_collection , ) <EOL> def test_netmhc_cons_multiple_alleles ( ) : <EOL> alleles = '<STR_LIT>' <EOL> cons_predictor = NetMHCcons ( <EOL> alleles = alleles , <EOL> epitope_lengths = [ <NUM_LIT:9> ] ) <EOL> fasta_dictionary = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> epitope_collection = cons_predictor . predict ( <EOL> fasta_dictionary = fasta_dictionary ) <EOL> assert len ( epitope_collection ) == <NUM_LIT:8> , "<STR_LIT>" % ( epitope_collection , ) <EOL> def test_netmhc_cons_chunking ( ) : <EOL> alleles = [ normalize_allele_name ( DEFAULT_ALLELE ) ] <EOL> fasta_dictionary = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> for max_file_records in [ <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:20> ] : <EOL> for process_limit in [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:10> ] : <EOL> cons_predictor = NetMHCcons ( <EOL> alleles = alleles , <EOL> epitope_lengths = [ <NUM_LIT:9> ] , <EOL> max_file_records = max_file_records , <EOL> process_limit = process_limit <EOL> ) <EOL> epitope_collection = cons_predictor . predict ( <EOL> fasta_dictionary = fasta_dictionary ) <EOL> assert len ( epitope_collection ) == <NUM_LIT> , "<STR_LIT>" % ( epitope_collection , ) <EOL> source_keys = [ ] <EOL> for epitope in epitope_collection : <EOL> source_keys . append ( epitope . source_sequence_key ) <EOL> for fasta_key in fasta_dictionary . keys ( ) : <EOL> fasta_count = source_keys . count ( fasta_key ) <EOL> assert fasta_count == <NUM_LIT:2> , ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( <EOL> fasta_key , fasta_count ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> test_netmhc_cons ( ) <EOL> test_netmhc_cons_chunking ( ) </s>
