Get component index#

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

The function molsysmt.element.component.get_component_index() returns 0-based topological indices for components.

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.component.get_component_index(molsys, element='component', selection='all')
print('Component indices:', indices)
Component indices: [0, 1]