vermouth.processors.make_bonds module

Provides a processor that can add edges to a graph based on geometric criteria.

class vermouth.processors.make_bonds.MakeBonds(allow_name=True, allow_dist=True, fudge=1.2)[source]

Bases: Processor

Processor to add edges to a system and separate it into separate connected molecules.

Two separate criteria are used to decide where to add edges. The system’s molecules are separated into residues. Then intra-residue edges are added.

If allow_names is True, the corresponding Block is looked up in the system’s force field. First edges will be added based on the edges in that block. In addition, non-edges in the reference block are also stored.

Secondly, if allow_dist is True, edges will be added between any atoms that are close enough together. The threshold for “close enough” is determined based on the elements of the atoms in question and their van der Waals radii, multiplied by fudge. This way edges will not be added between atoms that were marked as ‘non-edge’ in the previous step, nor between residues if one of the atoms is a hydrogen.

allow_names

Whether edges should be added based on atom names.

Type:

bool

allow_dist

Whether edges should be added based on distance.

Type:

bool

fudge

A fudge factor used to increase the reference van der Waals radii to allow for conformations that are slightly out of equilibrium.

Type:

Number

See also

make_bonds()

run_system(system)[source]
vermouth.processors.make_bonds.make_bonds(system, allow_name=True, allow_dist=True, fudge=1.2)[source]

Creates bonds within molecules in the system.

First, edges will be created based on residue and atom names. Second, edges will be created based on a distance criterion. Nodes in system must have position and element attributes. The possible distance between nodes is determined by values in VDW_RADII. Edges within residues will only be guessed between atoms that are not known in the reference Block. The system will be split into connected components, keeping residues (identified by chain, residue name and residue id) within the same molecule. This does mean that the final molecules can be disconnected.

Notes

Edges for residues for which no block can be found will be added based on

the distance criterion. A warning will be issued if this is the case.

Elements that are not in VDW_RADII do not make bonds based on distances.

Parameters:
  • system (System) – The system in which to add edges.

  • fudge (Number) – Scale the allowed distance by this factor.

Returns:

Molecules in system, in which edges have been added based on atom names and possibly distance. The molecules have been split into connected components keeping residues intact. Molecules can be disconnected within residues.

Return type:

List[Molecule]