Is a molecular system#

Verifying whether an object defines a single valid molecular system.

A molecular system can be defined using a single item or a list of items. To check whether a given collection defines a valid molecular system, use the function molsysmt.basic.is_a_molecular_system().

What does “valid” mean in this context? It means that all items can be combined into a single system — without internal inconsistencies — by layering their attributes (e.g., topology, coordinates, box) in a compatible way. MolSysMT first classifies the forms: two items that both provide a topology are separate systems. Complementary items, such as a topology and a trajectory, are then checked for matching atom counts. The result is False if that consistency check fails or cannot be completed.

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using demonstration datasets (pentalanine):

import molsysmt as msm
topology = msm.systems['pentalanine']['pentalanine.prmtop']
structures_A = msm.systems['pentalanine']['pentalanine.inpcrd']
structures_B = msm.systems['chicken villin HP35']['traj_chicken_villin_HP35_solvated.dcd']

We have a single item — a *.prmtop file — that by itself defines a molecular system with no structure data:

msm.info(topology)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_waters n_peptides n_structures
file:prmtop 5207 1722 1716 1 1716 2 1715 1 None

We also have two items — an “inpcrd” file and a “dcd” trajectory — which can independently define molecular systems without topological attributes.

msm.info(structures_A)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_structures
file:inpcrd 5207 None None None None None 1
msm.info(structures_B)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_structures
file:dcd 4369 None None None None None 20

Can the items topology and structures_A be combined to form a valid molecular system?

msm.is_a_molecular_system([topology, structures_A])
True

What about combining topology with structures_B?

msm.is_a_molecular_system([topology, structures_B])
False