Merge#

Merging elements from multiple molecular systems.

Elements coming from different molecular systems can be merged into a new molecular system with the molsysmt.basic.merge() function.

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using three peptides built as separate molecular systems: proline dipeptide (\(A\)), valine dipeptide (\(B\)), and lysine dipeptide (\(C\)):

import molsysmt as msm
import numpy as np
molsys_A = msm.build.build_peptide('AceProNme')
molsys_B = msm.build.build_peptide('AceValNme')
molsys_C = msm.build.build_peptide('AceLysNme')

To prevent overlaps when merging, the systems \(B\) and \(C\) are translated in space before being combined with \(A\).

molsys_B = msm.structure.translate(molsys_B, translation='[-1.0, 0.0, 0.0] nanometers')
molsys_C = msm.structure.translate(molsys_C, translation='[1.0, 0.0, 0.0] nanometers')
molsys_D = msm.merge([molsys_A, molsys_B, molsys_C])

Let’s now inspect the contents of the merged system \(D\):

msm.info(molsys_D)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_peptides n_structures
molsysmt.MolSys 88 9 3 3 3 3 3 1
msm.view(molsys_D)