schrodinger.application.matsci.network_cg_mapping.conversion module

Convert Schrodinger structures into neutral atomic networks.

The conversion preserves Structure atom indices, validates labeled PBC bonds against the current box geometry, and converts them into explicit input-box image shifts. It does not modify the input Structure or decide which atoms should participate in a later mapping.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.network_cg_mapping.conversion.StructureConverter(struct, atom_ids=None, perceive_aromatic=True)

Bases: object

Convert one Structure atom selection into an AtomicNetwork.

All atoms are included by default, including hydrogens. Supplying atom_ids constructs the induced atomic network for that selection while preserving the original Structure indices. Bonds that connect the selection to excluded atoms are omitted.

The converter resolves and stores the selected atoms once, then uses that same selection for positions, labels, aromaticity, and induced bonds. Aromatic bonds are normalized to one bond class, and labeled PBC bonds are expanded into edges with explicit image shifts. Calling convert returns the validated AtomicNetwork.

__init__(struct, atom_ids=None, perceive_aromatic=True)

Prepare a structure conversion.

Parameters:
  • struct (Structure) – Structure to convert

  • atom_ids (collections.abc.Collection[int] or None) – Atom indices to include, or None to include every atom

  • perceive_aromatic (bool) – Whether to perceive and normalize aromatic bonds

validatePBCBondMetadata()

Validate selected PBC bond labels against the current geometry.

PBC bond properties can become stale when a periodic structure is replicated, unwrapped, or otherwise modified without recalculating connectivity. Both a PBC-only bond and a bond representing regular and periodic connections must agree with the current box and coordinates. The input Structure is not modified.

Raises:

NetworkMappingError – If a selected PBC bond has no PBC box or its stored PBC properties disagree with its geometry

convert()

Return the converted atomic network.

Return type:

AtomicNetwork

Returns:

Validated neutral atomic-network representation

Raises:

NetworkMappingError – If the PBC bond metadata is inconsistent with the current periodic box and coordinates