Topology#
molsysmt.Topology is the native data structure in MolSysMT responsible for managing atom inventories, residue groups, molecular entities, chemical chains, and covalent bonding graphs.
Overview and Role#
As a user, molsysmt.Topology is the object holding all structural identity and chemical metadata for a system. It provides fast selection queries, atom index resolution, and structural hierarchy traversals without needing 3D spatial coordinates.
Internal Attributes#
Inside molsysmt.Topology, data is maintained across seven canonical tabular DataFrames representing the structural hierarchy and chemical bonding state:
Attribute |
Data Frame Class |
Columns / Fields |
Description |
|---|---|---|---|
|
|
|
Atom inventory storing string IDs, element types, isotopes, and parent group/chain links. |
|
|
|
Residue and group inventory specifying sequence names, group types (amino acid, water, ion), and parent molecule links. |
|
|
|
Connected covalent graph components. |
|
|
|
Higher-level biological molecule classifications (protein, peptide, small molecule) and parent entity links. |
|
|
|
Unique chemical species entities. |
|
|
|
Structural chain segment labels and chain type classifications. |
|
|
|
Covalent bond graph specifying bonded atom index pairs, bond orders, and aromaticity flags. |
Invariants and Performance#
String Identifier Invariant: All element IDs (
atom_id,group_id,molecule_id,component_id,entity_id,chain_id,bond_id) are strictly normalized and stored as string representations.Hierarchical Index Links: Structural parent-child relationships use integer 0-indexed vectors (
group_index,chain_index,molecule_index,entity_index).Fast Selections: Optimized for zero-overhead Boolean evaluation by MolSysMT’s internal selection parser.
Container Conversion#
A topology can be wrapped in a molsysmt.MolSys without inventing structural data:
topology_only = msm.convert(topology, to_form="molsysmt.MolSys")
The resulting container preserves the complete topology and has zero structures. This is
useful when a workflow needs the central native container before coordinates are available.
A three-dimensional viewer has a stricter contract: converting a topology to
nglview.NGLWidget requires explicit coordinates= because MolSysMT does not fabricate a
geometry for a topology-only system.
API Documentation#
All methods, getters, and converters for molsysmt.Topology are documented in the [molsysmt.Topology API Reference].