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.
Hint
Visit the section Items and Forms for an introduction to items and forms in MolSysMT.
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.is_a_molecular_system().
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']
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
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
Tip
All functions in the molsysmt.basic module are also accessible from the top-level namespace of the library. Hence, molsysmt.is_a_molecular_system() is the same function as molsysmt.basic.is_a_molecular_system().
What about combining topology with structures_B?
msm.is_a_molecular_system([topology, structures_B])
False
See also
Related Tools & References
Items and Forms: Learn how molecular systems are constructed from one or more items and forms.
Demo Systems Catalog: Explore demonstration datasets used in molecular systems.
Info: Display summary information about a molecular system with
molsysmt.basic.info().Is a molecular system: Check whether an object defines a single valid molecular system with
molsysmt.basic.is_a_molecular_system().Are multiple molecular systems: Check whether a collection of objects defines multiple independent molecular systems with
molsysmt.basic.are_multiple_molecular_systems().