Concatenate structures#

Concatenating the structures found in a list of molecular systems.

The structures found in a list of molecular systems, assuming all of them share the same topology -they must represent the same molecular system, in fact-, can concatenated with the help of the function molsysmt.basic.concatenate_structures(). The resultant molecular system will contain all structures in the same order they were concatenated.

Added in version 1.0.0.

How this function works#

API documentation

Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function:molsysmt.basic.concatenate_structures().

Let’s demonstrate how this function works using the alanine dipeptide, represented as three different molecular systems, each with a distinct structure.

import molsysmt as msm
molsys_A = msm.build.build_peptide('AceAlaNME')
molsys_B = msm.structure.translate(molsys_A, translation='[0.1, 0.1, 0.1] nanometers')
molsys_C = msm.structure.translate(molsys_A, translation='[0.2, 0.2, 0.2] nanometers')

Each of the three molecular systems contains a single structure:

msm.get(molsys_A, n_structures=True)
1
msm.get(molsys_B, n_structures=True)
1
msm.get(molsys_C, n_structures=True)
1

Now let’s create a fourth molecular system by concatenating the structures from A, B, and C:

molsys_D = msm.concatenate_structures([molsys_A, molsys_B, molsys_C])

Tip

All methods defined in the molsysmt.basic module can be invoked also from the main level of the library. As such, molsysmt.concatenate_structures() is the same method as molsysmt.basic.concatenate_structures().

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

Finally, the resulting system can be visualized to inspect the spatial arrangement of the concatenated structures.

msm.view(molsys_D)

See also

User guide > Tools > Build > Build peptide:
Build natural peptides with or without terminal caps.

User guide > Tools > Structure > Translate:
Translate entire molecular systems or specific selections in space.

User guide > Tools > Basic > Get: Get values of specific attributes from a molecular system.

User guide > Tools > Basic > Info:
Display a summary of the contents, topology, and structural data of a molecular system.

User guide > Tools > Basic > View:
Visualize a molecular system.

User_guide > Tools > Basic > Append Structures:
Append structures from one molecular system into another.