poli.core.util.proteins.mutations.mutations_from_wildtype_residues_and_mutant

poli.core.util.proteins.mutations.mutations_from_wildtype_residues_and_mutant#

poli.core.util.proteins.mutations.mutations_from_wildtype_residues_and_mutant(wildtype_residues: List[Bio.PDB.Residue.Residue], mutated_residue_string: str) List[str]#

Computes the mutations from a wildtype list of residues and a mutated residue string.

Since foldx expects an individual_list.txt file of mutations, this function computes the Levenshtein distance between the wildtype residue string and the mutated residue string, keeping track of the replacements.

This method returns a list of strings which are to be written in a single line of individual_list.txt. Each string is a mutation in the format foldx expects (e.g. “EA1R”, meaning that an E was mutated to an R in position 1 of chain A. The first letter is the original residue, the second letter is the chain, the third letter is the position, and the fourth letter is the mutant residue).

If the mutated residue string is the same as the wildtype residue string, we still need to pass a dummy mutation to foldx, so we “mutate” the first residue in the wildtype string to itself.

For example:

wildtype_residue_string = “ECDE…” mutated_residue_string = “ACDE…”

This function would return (assuming that we are mutating the chain “A”):

[“EA1A”]

Parameters
  • wildtype_residues (List[Residue]) – The list of wildtype residues.

  • mutated_residue_string (str) – The mutated residue string.

Returns

mutations – The list of mutations in the format foldx expects.

Return type

List[str]