openff.toolkit.topology.HierarchyElement

class openff.toolkit.topology.HierarchyElement(scheme, identifier, atom_indices)[source]

An element in a metadata hierarchy scheme, such as a residue or chain.

__init__(scheme, identifier, atom_indices)[source]

Create a new hierarchy element.

Parameters
  • scheme (HierarchyScheme) – The scheme to which this HierarchyElement belongs

  • id (tuple of str and int) – Tuple of metadata values (not keys) that define the uniqueness criteria for this element

  • atom_indices (iterable int) – The indices of particles in scheme.parent that are in this element

Methods

__init__(scheme, identifier, atom_indices)

Create a new hierarchy element.

atom(index)

Get atom with a specified index.

to_dict()

Serialize this object to a basic dict of strings, ints, and floats

Attributes

atoms

parent

to_dict()[source]

Serialize this object to a basic dict of strings, ints, and floats

atom(index: int)[source]

Get atom with a specified index.

Parameters

index (int) –

Returns

atom (openff.toolkit.topology.molecule.Atom)