Get n components#
Counting the total number of components in a molecular system.
The function molsysmt.element.component.get_n_components() counts components satisfying given selection criteria.
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.element.component.get_n_components().
Basic usage#
Let’s count elements in the system:
import molsysmt as msm
molsys = msm.convert(msm.systems['Barnase-Barstar']['barnase_barstar.h5msm'])
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.
n = msm.element.component.get_n_components(molsys)
print('Total components:', n)
Total components: 2
See also
Related Tools & References
Get component name: Get component names with
molsysmt.element.component.get_component_name().Get component type: Get component types with
molsysmt.element.component.get_component_type().