xnn.ffnn.models.amberlib.match_improper#

xnn.ffnn.models.amberlib.match_improper(improper_types, center, outer)[source]#

Pick the improper parameter and atom order for one trigonal center.

Follows the conventions of the AMBER builder (LEaP) as reproduced by the amber improper ordering of OpenMM: a pattern I-J-K-L matches a center K when its three neighbours can be assigned to I, J and L (X matches anything); a pattern without wildcards is preferred over one with, the last matching wildcard-free pattern wins among those, else the first matching wildcard pattern (table order). The matched atoms are then ordered: between positions of equal type (wildcard-free patterns) or of equal element involving L (wildcard patterns), and always between the two leading positions of a wildcard pattern, the atom that comes first in its residue template goes first.

Parameters:
  • improper_types (dict) – The library’s improper table in file order, keys "I-J-K-L".

  • center (str) – Atom type of the central atom.

  • outer (sequence of (int, str, str, tuple)) – The three neighbours as (atom index, atom type, element symbol, order key), where the order key is (residue index, position in the residue template).

Returns:

The matching key and the atom indices (i, j, k, l) in evaluation order, or None when no pattern applies.

Return type:

tuple of (str, tuple) or None