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.

Added in version 1.0.0.

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']
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')