import molsysmt as msm

Mutate#

Mutate aminoacids in peptide or protein.

With the function molsysmt.build.mutate(), specific aminoacids of a peptide or a protein can be mutated. Let’s first of all build a short peptide to test how this function works.

molecular_system = msm.build.build_peptide('TyrGlyGlyPheMet')
msm.info(molecular_system, element='group')
index id name type n atoms component index chain index molecule index molecule type entity index entity name
0 1 TYR amino acid 21 0 0 0 peptide 0 peptide 0
1 2 GLY amino acid 7 0 0 0 peptide 0 peptide 0
2 3 GLY amino acid 7 0 0 0 peptide 0 peptide 0
3 4 PHE amino acid 20 0 0 0 peptide 0 peptide 0
4 5 MET amino acid 17 0 0 0 peptide 0 peptide 0

Let’s now explore the different ways the function molsysmt.build.mutate() can be used. The input argument mutations accepts strings or lists of strings if the mutations are specified in the tradicional way: “old_residue_name-residue_id-new_residue_name”.

new_molecular_system = msm.build.mutate(molecular_system, mutations=["GLY-2-ALA", "GLY-3-LYS"], engine='PDBFixer')

Note

In the current version of MolSysMT, the function molsysmt.build.mutate works with the library PDBFixer behind doing the dirty job. There is no native algorithm to mutate aminoacids yet. So… do not forget to give credit to the PDBFixer developers if you are using this function.

msm.info(new_molecular_system, element='group')
index id name type n atoms component index chain index molecule index molecule type entity index entity name
0 1 TYR amino acid 23 0 0 0 peptide 0 peptide 0
1 2 ALA amino acid 10 0 0 0 peptide 0 peptide 0
2 3 LYS amino acid 22 0 0 0 peptide 0 peptide 0
3 4 PHE amino acid 20 0 0 0 peptide 0 peptide 0
4 5 MET amino acid 18 0 0 0 peptide 0 peptide 0

In addition to a string or a list of strings, the input argument mutations accepts a dictionary where the keys can be the indices, ids or names of the residues to be mutated, and the corresponding values must be the new residue names. Let’s see some examples:

new_molecular_system = msm.build.mutate(molecular_system, mutations={1:'ALA', 2:'LYS'}, keys='group_index')

msm.convert(new_molecular_system, to_form='string:amino_acids_3')
'TyrAlaLysPheMet'
new_molecular_system = msm.build.mutate(molecular_system, mutations={2:'VAL', 3:'THR'}, keys='group_id')

msm.get(new_molecular_system, element='group', group_name=True)
['TYR', 'VAL', 'THR', 'PHE', 'MET']

Finally, the molsysmt.build.mutate() includes an option to select the region of the system where the mutations applies:

new_molecular_system = msm.build.mutate(molecular_system, mutations={'GLY':'ALA'}, keys='group_name', selection='group_id==[3,4,5]')

for group_id, group_name in msm.Iterator(new_molecular_system, element='group', group_id=True, group_name=True):
    print(group_id, group_name)
1 TYR
2 GLY
3 ALA
4 PHE
5 MET