Are multiple molecular systems#
Checking whether a container (list or tuple) holds only valid molecular systems.
This function checks whether the input is a list or tuple and whether all its items are valid molecular systems in one of the supported forms.
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.are_multiple_molecular_systems().
Basic usage#
Let’s show how this method works with some simple cases:
import molsysmt as msm
molsys_A = '2LAO'
molsys_B = msm.systems['Trp-Cage']['1l2y.h5msm']
molsys_C = msm.systems['T4 lysozyme L99A']['t4_lysozyme_L99A.h5msm']
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.
msm.are_multiple_molecular_systems([molsys_A, molsys_B, molsys_C])
True
Tip
All methods defined in the molsysmt.basic module can also be invoked from the library’s top level. Hence, molsysmt.are_multiple_molecular_systems() is the same function as molsysmt.basic.are_multiple_molecular_systems().
A molecular system can also be represented as a composite form, for example a pair [Topology, Structures]. In such cases the entire pair counts as one molecular system within the container, not two separate objects.
topology = msm.convert(molsys_C, to_form='openmm.Topology')
structures = msm.convert(molsys_C, to_form='XYZ')
msm.are_multiple_molecular_systems([molsys_A, molsys_B, [topology, structures]])
True
Now consider a mixed container where at least one item is not a molecular system: the function returns False.
topology = msm.convert(molsys_B, to_form='openmm.Topology')
structures = msm.convert(molsys_C, to_form='XYZ')
msm.are_multiple_molecular_systems([molsys_A, molsys_B, [topology, structures]])
False
This function is especially useful in validation workflows where input data may be heterogeneous
or come from multiple sources. For individual objects, use molsysmt.basic.is_a_molecular_system().
See also
Related Tools & References
Convert: Convert a molecular system into another form or forms with
molsysmt.basic.convert().Is a molecular system: Check whether an object is a valid molecular system with
molsysmt.basic.is_a_molecular_system().