Path C - Module 26: Attribute Engineering (Patching)#
In drug design pipelines, ligands often come with weird atom names (like ‘C1’, ‘C2’, ‘C3’). This is hard to read. In this module, you will learn to rename the atoms of your inhibitor to match a standard nomenclature.
import molsysmt as msm
from molsysmt import systems
# Load Mpro and select the ligand
molsys = msm.convert('pdb:6LU7', to_form='molsysmt.MolSys')
ligand_selection = 'molecule_type=="small molecule"'
# Patch the first atom of the ligand to be called 'HEAD'
msm.set(molsys, element='atom', selection='atom_index==0 and '+ligand_selection, atom_name='HEAD')
print("Ligand atom renamed.")