def predict_subsequences(self, sequence_dict, peptide_lengths=None):
sequence_dict = check_sequence_dictionary(sequence_dict)<EOL>peptide_lengths = self._check_peptide_lengths(peptide_lengths)<EOL>binding_predictions = []<EOL>expected_peptides = set([])<EOL>normalized_alleles = []<EOL>for key, amino_acid_sequence in sequence_dict.items():<EOL><INDENT>for l in peptide_lengths:<EOL><INDENT>for i in range(len(amino_acid_sequence) - l + <NUM_LIT:1>):<EOL><INDENT>expected_peptides.add(amino_acid_sequence[i:i + l])<EOL><DEDENT><DEDENT>self._check_peptide_inputs(expected_peptides)<EOL>for allele in self.alleles:<EOL><INDENT>allele = normalize_allele_name(allele, omit_dra1=True)<EOL>normalized_alleles.append(allele)<EOL>request = self._get_iedb_request_params(<EOL>amino_acid_sequence, allele)<EOL>logger.info(<EOL>"<STR_LIT>",<EOL>self.url,<EOL>request)<EOL>response_df = _query_iedb(request, self.url)<EOL>for _, row in response_df.iterrows():<EOL><INDENT>binding_predictions.append(<EOL>BindingPrediction(<EOL>source_sequence_name=key,<EOL>offset=row['<STR_LIT:start>'] - <NUM_LIT:1>,<EOL>allele=row['<STR_LIT>'],<EOL>peptide=row['<STR_LIT>'],<EOL>affinity=row['<STR_LIT>'],<EOL>percentile_rank=row['<STR_LIT>'],<EOL>prediction_method_name="<STR_LIT>" + self.prediction_method))<EOL><DEDENT><DEDENT><DEDENT>self._check_results(<EOL>binding_predictions,<EOL>alleles=normalized_alleles,<EOL>peptides=expected_peptides)<EOL>return BindingPredictionCollection(binding_predictions)<EOL>
Given a dictionary mapping unique keys to amino acid sequences,
        run MHC binding predictions on all candidate epitopes extracted from
        sequences and return a EpitopeCollection.

        Parameters
        ----------
        fasta_dictionary : dict or string
            Mapping of protein identifiers to protein amino acid sequences.
            If string then converted to dictionary.