def variable_length_to_fixed_length_vector_encoding(<EOL>self, vector_encoding_name, left_edge=<NUM_LIT:4>, right_edge=<NUM_LIT:4>, max_length=<NUM_LIT:15>):
cache_key = (<EOL>"<STR_LIT>",<EOL>vector_encoding_name,<EOL>left_edge,<EOL>right_edge,<EOL>max_length)<EOL>if cache_key not in self.encoding_cache:<EOL><INDENT>fixed_length_sequences = (<EOL>self.sequences_to_fixed_length_index_encoded_array(<EOL>self.sequences,<EOL>left_edge=left_edge,<EOL>right_edge=right_edge,<EOL>max_length=max_length))<EOL>result = amino_acid.fixed_vectors_encoding(<EOL>fixed_length_sequences,<EOL>amino_acid.ENCODING_DATA_FRAMES[vector_encoding_name])<EOL>assert result.shape[<NUM_LIT:0>] == len(self.sequences)<EOL>self.encoding_cache[cache_key] = result<EOL><DEDENT>return self.encoding_cache[cache_key]<EOL>
Encode variable-length sequences using a fixed-length encoding designed
for preserving the anchor positions of class I peptides.

The sequences must be of length at least left_edge + right_edge, and at
most max_length.

Parameters
----------
vector_encoding_name : string
    How to represent amino acids.
    One of "BLOSUM62", "one-hot", etc. Full list of supported vector
    encodings is given by available_vector_encodings().
left_edge : int, size of fixed-position left side
right_edge : int, size of the fixed-position right side
max_length : sequence length of the resulting encoding

Returns
-------
numpy.array with shape (num sequences, max_length, m) where m is
vector_encoding_length(vector_encoding_name)