htmd.builder.solvate module#

htmd.builder.solvate.solvate(mol, pad=None, minmax=None, centersel=None, boxsize=None, negx=0, posx=0, negy=0, posy=0, negz=0, posz=0, buffer=2.4, watsize=65.4195, prefix='W', rotate=False, spdb=None)#

Solvates the system in a water box

Parameters:
  • mol (Molecule object) – The molecule object we want to solvate

  • pad (float) – The padding to add to the minmax in all dimensions. You can specify different padding in each dimension using the negx, negy, negz, posx, posy, posz options. This option will override any values in the neg and pos options.

  • minmax (list) – Min and max dimensions. Should be a 2D matrix of the form [[minx, miny, minz], [maxx, maxy, maxz]]. If none is given, it is calculated from the minimum and maximum coordinates in the mol.

  • centersel (str) – An atom selection string defining the center of the solvation box. The geometric center of the selected atoms is used. Must be combined with boxsize.

  • boxsize (float or list of 3 floats) – The dimensions of the solvation box. If a single float, a cubic box of that side length is created. If a 3-element iterable [sx, sy, sz], an axis-aligned box of those dimensions is created. The box extends from center - boxsize/2 to center + boxsize/2 in each dimension. Must be combined with centersel.

  • negx (float) – The padding in the -x dimension

  • posx (float) – The padding in the +x dimension

  • negy (float) – The padding in the -y dimension

  • posy (float) – The padding in the +y dimension

  • negz (float) – The padding in the -z dimension

  • posz (float) – The padding in the +z dimension

  • buffer (float) – How much buffer space to leave empty between waters and other molecules

  • watsize (float) – The size of the water box

  • prefix (str) – The prefix used for water segments

  • keysel (str) – The key selection for water atoms

  • rotate (bool) – Enable automated rotation of molecule to fit best in box

  • rotsel (str) – The selection of atoms to rotate

  • rotinc (float) – The increment in degrees to rotate

  • spdb (str) – The path to the water pdb file

Returns:

mol – A solvated molecule

Return type:

Molecule object

Examples

>>> smol = solvate(mol, pad=10)
>>> smol = solvate(mol, minmax=[[-20, -20, -20],[20, 20, 20]])
>>> smol = solvate(mol, centersel="protein", boxsize=100)
>>> smol = solvate(mol, centersel="protein", boxsize=[80, 80, 120])