xnn.gnn.featurizers.molgraph.MolecularGraph#

class xnn.gnn.featurizers.molgraph.MolecularGraph(atomic_numbers, formal_charges, degree, ring_degree, min_ring, bonds, bond_in_ring, bond_order, angles, propers, impropers, angle_edges, proper_edges, improper_edges, proper_linear, hypervalent, atom_class, edge_class, pairs12, pairs13, pairs14, pairs15, smiles='')[source]#

Bases: object

The graph of one molecule as read by a graph-parameterized force field.

Index arrays are int64; directed edge 2 k runs along bond k from its lower to its higher atom index, edge 2 k + 1 back.

Variables:
  • min_ring (atomic_numbers, formal_charges, degree, ring_degree,) – Per-atom features (n,) (min_ring 0 outside rings).

  • bonds (numpy.ndarray) – (m, 2), sorted, lower index first.

  • bond_order (bond_in_ring,) – Per-bond features (m,); the order as an index into BOND_ORDERS.

  • impropers (angles, propers,) – (a, 3), (p, 4) and (i, 4) (impropers center first, the other three sorted).

  • improper_edges (angle_edges, proper_edges,) – The directed edges along each term: (a, 2), (p, 3) and (i, 3) (impropers from the center to each neighbor).

  • proper_linear (numpy.ndarray) – (p,) bool: torsions about a linear center.

  • hypervalent (numpy.ndarray) – (n,) bool: phosphorus or sulfur with five or more neighbors.

  • edge_class (atom_class,) – Equivalence classes (n,) and (2 m,): the index of the first member.

  • pairs15 (pairs12, pairs13, pairs14,) – Atom pairs (k, 2) (lower index first) whose shortest path has one to four bonds.

  • smiles (str) – Canonical SMILES of the standardized structure.

Parameters:
property n_atoms: int#

Number of atoms.

property total_charge: int#

Net formal charge.