Where is attribute#
Identifying the item holding a specific attribute in a molecular system.
In MolSysMT, a molecular system can be represented by a list of items, each belonging to a different form and contributing different attributes. For example, one item might provide structural data (coordinates, time), while another defines topology (bonds, atom names). The function molsysmt.basic.where_is_attribute() identifies which item in a composite molecular system provides a given attribute.
Hint
Visit the section Attributes for a detailed overview of attributes 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.where_is_attribute().
Basic usage#
Let’s show how this function works using a composite molecular system defined by two files: an AMBER topology file (pentalanine.prmtop) and an AMBER coordinate file (pentalanine.inpcrd):
import molsysmt as msm
structure = msm.systems['pentalanine']['pentalanine.inpcrd']
topology = msm.systems['pentalanine']['pentalanine.prmtop']
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.info([topology, structure])
| form | n_atoms | n_groups | n_components | n_chains | n_molecules | n_entities | n_waters | n_peptides | n_structures |
|---|---|---|---|---|---|---|---|---|---|
| ['file:prmtop', 'file:inpcrd'] | 5207 | 1722 | 1716 | 1 | 1716 | 2 | 1715 | 1 | 1 |
The function molsysmt.basic.where_is_attribute() allows us to know where a given attribute is found in the list of items. Let’s see how {func}molsysmt.basic.where_is_attribute identifies the item holding a specific attribute:
msm.where_is_attribute([topology, structure], attribute='box')
('/home/diego/repos@uibcdf/molsysmt/molsysmt/data/inpcrd/pentalanine.inpcrd',
'file:inpcrd')
msm.where_is_attribute([topology, structure], attribute='group_name')
('/home/diego/repos@uibcdf/molsysmt/molsysmt/data/prmtop/pentalanine.prmtop',
'file:prmtop')
Tip
All methods defined in the molsysmt.basic module can also be invoked from the main level of the library. Hence, molsysmt.where_is_attribute() is the same function as molsysmt.basic.where_is_attribute().
See also
Related Tools & References
Demo Systems Catalog: Explore demonstration datasets used for testing and tutorials.
Attributes: Overview of topological and structural attributes defined for molecular systems in MolSysMT.
Info: Display structural and topological summaries of a molecular system with
molsysmt.basic.info().Where is attribute: Identify the item holding a specific attribute in a molecular system with
molsysmt.basic.where_is_attribute().Has attribute: Check whether a molecular system contains a specific attribute with
molsysmt.basic.has_attribute().Get attributes: Retrieve a dictionary of available attributes from a molecular system with
molsysmt.basic.get_attributes().