xnn.gnn.featurizers.molgraph#
Molecular graphs for networks that read the two-dimensional structure (ByteFF, ByteFF-Pol).
A graph-parameterized force field predicts its parameters from the two-dimensional
molecular graph alone. molecular_graph() turns an RDKit molecule (explicit
hydrogens, atoms in the order of the coordinates) into the integer features and
term lists such a model reads:
the Lewis structure is standardized first: a few hypervalent groups are written in charge-separated form (sulfoxides, trivalent sulfur, deprotonated sulfonamides, azides, odd N-oxides) and the resonance structure with the fewest formal charges is chosen (
canonical_resonance()), so that equivalent inputs give the same graph;per atom: element, number of bonded neighbors, formal charge, number of ring bonds and the size of the smallest ring through the atom; per bond: whether it lies in a ring and its order (single, double, triple, aromatic). Rings are the simple cycles of at most
MAX_RING_SIZEatoms;the bonds, angles, proper torsions and impropers (one per carbon or nitrogen with three neighbors, center first) with the directed edges along each term;
the classes of topologically equivalent atoms and bonds (symmetric atoms of the graph with every bond made single and every charge removed);
the pairs separated by one to four bonds, and the torsions through linear centers (sp carbon, two-coordinated N+), whose barriers vanish.
RDKit is an optional dependency (pip install "xnns[ffnn]").
Module Attributes
Largest ring whose bonds count as ring bonds. |
|
Bond orders of the bond-order feature, in feature order. |
Functions
|
The resonance structure of |
|
A key identifying the topology of |
|
Build the |
|
The standardized structure the graph of |
|
A sanitized copy of |
|
The connected components of |
|
Write the hypervalent groups of |
Classes
|
The graph of one molecule as read by a graph-parameterized force field. |