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.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.basic.copy().
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)
Tip
All methods defined in the molsysmt.basic module can also be invoked from the main level of the library. Hence, molsysmt.copy() is the same function as molsysmt.basic.copy().
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 |
See also
Related Tools & References
Convert: Convert a molecular system into another form or forms with
molsysmt.basic.convert().Info: Print a summary of the contents, topology, and structural data of a molecular system with
molsysmt.basic.info().Compare: Compare molecular systems across selected attributes with
molsysmt.basic.compare().