def peptides_to_network_input(self, peptides):
        """
        Encode peptides to the fixed-length encoding expected by the neural
        network (which depends on the architecture).
        
        Parameters
        ----------
        peptides : EncodableSequences or list of string

        Returns
        -------
        numpy.array
        """
        encoder = EncodableSequences.create(peptides)
        if (self.hyperparameters['peptide_amino_acid_encoding'] == "embedding"):
            encoded = encoder.variable_length_to_fixed_length_categorical(
                max_length=self.hyperparameters['kmer_size'],
                **self.input_encoding_hyperparameter_defaults.subselect(
                    self.hyperparameters))
        elif (
                self.hyperparameters['peptide_amino_acid_encoding'] in
                    available_vector_encodings()):
            encoded = encoder.variable_length_to_fixed_length_vector_encoding(
                self.hyperparameters['peptide_amino_acid_encoding'],
                max_length=self.hyperparameters['kmer_size'],
                **self.input_encoding_hyperparameter_defaults.subselect(
                    self.hyperparameters))
        else:
            raise ValueError("Unsupported peptide_amino_acid_encoding: %s" %
                             self.hyperparameters['peptide_amino_acid_encoding'])
        assert len(encoded) == len(peptides)
        return encoded
def peptides_to_network_input ( self , peptides ) : encoder = EncodableSequences . create ( peptides ) if ( self . hyperparameters [ 'peptide_amino_acid_encoding' ] == "embedding" ) : encoded = encoder . variable_length_to_fixed_length_categorical ( max_length = self . hyperparameters [ 'kmer_size' ] , ** self . input_encoding_hyperparameter_defaults . subselect ( self . hyperparameters ) ) elif ( self . hyperparameters [ 'peptide_amino_acid_encoding' ] in available_vector_encodings ( ) ) : encoded = encoder . variable_length_to_fixed_length_vector_encoding ( self . hyperparameters [ 'peptide_amino_acid_encoding' ] , max_length = self . hyperparameters [ 'kmer_size' ] , ** self . input_encoding_hyperparameter_defaults . subselect ( self . hyperparameters ) ) else : raise ValueError ( "Unsupported peptide_amino_acid_encoding: %s" % self . hyperparameters [ 'peptide_amino_acid_encoding' ] ) assert len ( encoded ) == len ( peptides ) return encoded
Encode peptides to the fixed-length encoding expected by the neural
        network (which depends on the architecture).
        
        Parameters
        ----------
        peptides : EncodableSequences or list of string

        Returns
        -------
        numpy.array