Binding Pocket Isolation#
Task: Extract only the residues that form the active site around a ligand using spatial intelligence.
In large complexes, you often need to isolate the residues that are physically close to your drug candidate. This recipe shows you how to do it with a single selection string.
import molsysmt as msm
from molsysmt import systems
# Load the T4 Lysozyme with its Benzene ligand
lysozyme = systems['T4 lysozyme L99A']['181l.h5msm']
1. The Power Selection#
We use the within ... of operator to find all protein residues within 0.5 nm of the Benzene.
selection = 'molecule_type=="protein" within 0.5 nm of entity_name=="BENZENE"'
pocket = msm.extract(lysozyme, selection=selection)
print(f"The binding pocket has {msm.get(pocket, element='group', n_groups=True)} residues.")
msm.info(pocket, element='group')
2. Visualize the Result#
We can visualize the original ligand inside our newly extracted pocket.
ligand = msm.extract(lysozyme, selection='entity_name=="BENZENE"')
msm.view([pocket, ligand])