Copy#

Creating independent copies of molecular systems.

The function molsysmt.basic.copy() allows you to create a fully independent copy of a molecular system.

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using a PDB structure (181L):

import molsysmt as msm
molsys = msm.convert('181L', to_form='molsysmt.MolSys')
msm.info(molsys)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_waters n_ions n_small_molecules n_proteins n_structures
molsysmt.MolSys 1441 302 141 6 141 5 136 2 2 1 1
molsys_copy = msm.copy(molsys)

Although the original and copied systems are structurally identical, they are stored as distinct Python objects:

id(molsys)!= id(molsys_copy)
True

But they represent the same molecular system:

msm.compare(molsys, molsys_copy, rule='equal')
True
msm.info(molsys_copy)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_waters n_ions n_small_molecules n_proteins n_structures
molsysmt.MolSys 1441 302 141 6 141 5 136 2 2 1 1