Get attributes#

Retrieving the set of available attributes in a molecular system.

Molecular systems have attributes such as the number of atoms, the group ids, the box shape or the water model. The set of attribute values of a system and its elements defines a molecular system, making it different from others. Given that a system can take different forms, the attributes are also limited by each form. Given a molecular system, the function molsysmt.basic.get_attributes() returns a dictionary indicating whether each attribute is present with a non-None value.

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using an OpenMM Topology converted from PDB 181L:

import molsysmt as msm
molecular_system = msm.convert('181L', to_form='openmm.Topology')
dict_attributes = msm.get_attributes(molecular_system, output_type='dictionary')

Let’s inspect the resultant dictionary:

dict_attributes['box_volume']
True
dict_attributes['forcefield']
False

As mentioned earlier, not all molecular systems have all attributes with non-None values.. If this is the case, the function molsysmt.basic.get_attributes() returns False for these attributes -although they can be contained in the corresponding molecular system’s form-:

msm.set(molecular_system, box=None)
dict_attributes = msm.get_attributes(molecular_system, output_type='dictionary')
dict_attributes['box_volume']
False