xnn.ffnn.common.typing#
Atom typing from a force field’s SMARTS templates.
A .frc force field carries, in its #templates section, one or more
SMARTS patterns per atom type; the atom-mapped atoms of a pattern ([C:1])
receive that type wherever the pattern matches. This module applies those
templates to a structure with RDKit, following the procedure of SEAMM’s
FFAssigner: fragments (whole-molecule patterns with a fixed type list)
are assigned first and are never overwritten; then the templates are applied
in file order, each later match overriding earlier ones, which is why the
files list general patterns before specific ones. An atom left untyped is an
error – the force field cannot describe the structure.
RDKit is an optional dependency (pip install "xnn[ffnn]"); everything
here imports it lazily and raises a clear error without it.
Functions
|
Assign the force field's atom types to a structure. |
|
Bond orders of an RDKit molecule, aligned with |
|
Sorted |
|
Build an RDKit molecule with explicit hydrogens from a structure. |
Exceptions
The force field's templates do not cover (part of) the structure. |