exatomic.core.molecule module

Molecule Table

class exatomic.core.molecule.Molecule(*args, **kwargs)[source]

Bases: DataFrame

Description of molecules in the atomic universe.

classify(*classifiers)[source]

Classify molecules into arbitrary categories.

u.molecule.classify(('solute', 'Na'), ('solvent', 'H(2)O(1)'))
Parameters:

classifiers – Any number of tuples of the form (‘label’, ‘identifier’, exact) (see below)

Note

A classifier has 3 parts, “label”, e.g. “solvent”, “identifier”, e.g. “H(2)O(1)”, and exact (true or false). If exact is false (default), classification is greedy and (in this example) molecules with formulas “H(1)O(1)”, “H(3)O(1)”, etc. would get classified as “solvent”. If, instead, exact were set to true, those molecules would remain unclassified.

Warning

Classifiers are applied in the order passed; where identifiers overlap, the latter classification is used.

See also

compute_nearest_molecules()

get_atom_count()[source]

Compute the number of atoms per molecule.

get_formula(as_map=False)[source]

Compute the string representation of the molecule.

exatomic.core.molecule.compute_molecule(universe)[source]

Cluster atoms into molecules and create the Molecule table.

Parameters:

universe – Atomic universe

Returns:

molecule – Molecule table

Warning

This function modifies the universe’s atom (Atom) table in place!

exatomic.core.molecule.compute_molecule_count(universe)[source]
exatomic.core.molecule.compute_molecule_com(universe)[source]

Compute molecules’ centers of mass.