htmd.builder.solvate module#

htmd.builder.solvate.solvate(mol, pad=None, minmax=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

  • 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.

  • 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


mol – A solvated molecule

Return type:

Molecule object


>>> smol = solvate(mol, pad=10)
>>> smol = solvate(mol, minmax=[[-20, -20, -20],[20, 20, 20]])