Get n molecules#

Counting the total number of molecules in a molecular system.

The function molsysmt.element.molecule.get_n_molecules() counts molecules satisfying given selection criteria.

Added in version 1.0.0.

Basic usage#

Let’s count elements in the system:

import molsysmt as msm
molsys = msm.convert(msm.systems['Barnase-Barstar']['barnase_barstar.h5msm'])
n = msm.element.molecule.get_n_molecules(molsys)
print('Total molecules:', n)
Total molecules: 2