molsysmt.basic.is_a_molecular_system#
- molsysmt.basic.is_a_molecular_system(molecular_system)[source]#
Verifying whether the input is a single valid molecular system.
This function checks whether molecular_system represents one valid molecular system. The input may be a single item (any supported form) or a list/tuple combining compatible items (e.g., topology + coordinates files). For sequence inputs, validity requires internal consistency such as a matching number of atoms across all items.
- Parameters:
molecular_system (molecular system) – Tentative molecular system, provided as a single item or a list/tuple of items in any of the supported forms.
- Returns:
True if the input encodes a single valid molecular system, False otherwise.
- Return type:
bool
Notes
Supported molecular-system forms are summarized in Forms.
See also
molsysmt.basic.are_multiple_molecular_systems()
Check whether each item in a container is a valid molecular system.
molsysmt.basic.get_form()
Retrieve the form of a molecular system.
Examples
>>> import molsysmt as msm >>> from molsysmt import systems >>> topology = systems['pentalanine']['pentalanine.prmtop'] >>> structures_A = systems['pentalanine']['pentalanine.inpcrd'] >>> structures_B = systems['chicken villin HP35']['traj_chicken_villin_HP35_solvated.dcd'] >>> msm.basic.is_a_molecular_system([topology, structures_A]) True >>> msm.basic.is_a_molecular_system([topology, structures_B]) False
Tutorial with more examples
See the following tutorial for a practical demonstration of how to use this function, along with additional examples: Is a molecular system.
Added in version 1.0.0.