Has attribute#
Checking if a specific molecular system form supports a given attribute.
The function molsysmt.form.has_attribute() returns a boolean indicating whether a target form provides a specific topological or structural property.
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.form.has_attribute().
Basic usage#
Let’s check attribute support across different forms:
import molsysmt as msm
print('Does molsysmt.Topology have coordinates?:', msm.form.has_attribute('molsysmt.Topology', 'coordinates'))
print('Does molsysmt.Topology have atom names?:', msm.form.has_attribute('molsysmt.Topology', 'atom_name'))
print('Does file:pdb have box dimensions?:', msm.form.has_attribute('file:pdb', 'box'))
print('Does string:amino_acids_1 have coordinates?:', msm.form.has_attribute('string:amino_acids_1', 'coordinates'))
Does molsysmt.Topology have coordinates?: False
Does molsysmt.Topology have atom names?: True
Does file:pdb have box dimensions?: True
Does string:amino_acids_1 have coordinates?: False
See also
Related Tools & References
Get attributes: Query full attribute dictionary with
molsysmt.form.get_attributes().Is file: Check file form status with
molsysmt.form.is_file().