Get molecule index#

Querying 0-indexed integer indices for molecules in a molecular system.

The function molsysmt.element.molecule.get_molecule_index() returns 0-based topological indices for molecules.

Added in version 1.0.0.

Basic usage#

Let’s retrieve the topological indices:

import molsysmt as msm
molsys = msm.convert(msm.systems['Barnase-Barstar']['barnase_barstar.h5msm'])
indices = msm.element.molecule.get_molecule_index(molsys, element='molecule', selection='all')
print('Molecule indices:', indices)
Molecule indices: [0, 1]