Path D - Module 26: Attribute Engineering (Patching)#
In large membrane systems, chain IDs can be confusing. In this module, you will learn to rename all your lipid molecules to a single chain called ‘MEMB’ to simplify your analysis scripts.
import molsysmt as msm
from molsysmt import systems
# Load a system with lipids
topo = systems['POPC membrane']['popc_membrane.h5msm']
molsys = msm.convert(topo, to_form='molsysmt.MolSys')
# Patch the lipid chain names
msm.set(molsys, element='chain', selection='molecule_type=="lipid"', chain_name='MEMB')
msm.info(molsys, element='chain')