stko.MDAnalysis

class stko.MDAnalysis[source]

Bases: object

Converter for stk.Molecule to and from MDAnalysis.

Raises:

WrapperNotInstalledError – if MDAnalysis not installed.

Examples

An stk molecule can be converted into an MDAnalysis Universe.

import stk
import stko
import numpy as np

stkmol = stk.BuildingBlock('NCCNCCN').with_centroid(
    position=np.array((10, 10, 10))
)
universe = stko.MDAnalysis().get_universe(stkmol)


# Can now use mdanalysis methods and analysis.
radius_gyration = universe.atoms.radius_of_gyration()
b_sphere = universe.atoms.bsphere()
# These should be similar.
universe_com = universe.atoms.center_of_mass()
stk_centroid = stkmol.get_centroid()

Methods

get_universe

Get an MDAnalysis object.

get_universe(mol)[source]

Get an MDAnalysis object.

Parameters:

mol (Molecule) – Molecule to convert.

Returns:

The MDAnalysis Universe of the molecule.