xnn.ffnn.models.charmmlib.place_impropers#

xnn.ffnn.models.charmmlib.place_impropers(topology, fragments, elements)[source]#

The improper quadruples of a topology from its residue templates.

Every residue template lists its impropers by atom name with the central atom first; a name prefixed by - or + denotes the atom of a neighbouring residue bonded to the central atom (the carbonyl carbon -C before an amide nitrogen, the nitrogen +N after a carbonyl carbon). An improper whose neighbouring-residue atom does not exist (a chain end) is dropped, as the CHARMM builder does.

Parameters:
  • topology (MolecularTopology) – The topology; residues and residue_names must be set (by template typing).

  • fragments (dict) – The library’s residue templates.

  • elements (sequence of str) – Per-atom element symbols, used to pick the neighbouring-residue atom by the element its name starts with.

Returns:

The (i, j, k, l) quadruples, central atom first, in residue order.

Return type:

list of tuple

Raises:

ValueError – If a neighbouring-residue reference is ambiguous.