Geometry methods

moldesign.geom.distance(a1, a2)[source]

Return distance between two atoms

Parameters:a1,a2 (mdt.Atom) – the two atoms
Returns:the distance
Return type:u.Scalar[length]
moldesign.geom.angle(a1, a2, a3)[source]

The angle between bonds a2-a1 and a2-a3

Parameters:a1,a2,a3 (mdt.Atom) – the atoms describing the angle
Returns:the distance
Return type:u.Scalar[length]
moldesign.geom.dihedral(a1, a2=None, a3=None, a4=None)[source]

Twist angle of bonds a1-a2 and a4-a3 around around the central bond a2-a3

Can be called as dihedral(a1, a2, a3, a4)
OR dihedral(a2, a2) OR dihedral(bond)
Parameters:
  • a1 (mdt.Bond) – the central bond in the dihedral. OR
  • a1,a2 (mdt.Atom) – the atoms describing the dihedral
  • a3,a4 (mdt.Atom) – (optional) if not passed, a1 and a2 will be treated as the central atoms in this bond, and a3 and a4 will be inferred.
Returns:

angle - [0, 2 pi) radians

Return type:

(units.Scalar[angle])

moldesign.geom.distance_gradient(a1, a2)[source]

Gradient of the distance between two atoms,

\[\frac{\partial \mathbf{R}_1}{\partial \mathbf{r}} ||\mathbf{R}_1 - \mathbf{R}_2|| = \frac{\mathbf{R}_1 - \mathbf{R}_2}{||\mathbf{R}_1 - \mathbf{R}_2||}\]
Parameters:a1,a2 (mdt.Atom) – the two atoms
Returns:(gradient w.r.t. first atom, gradient w.r.t. second atom)
Return type:Tuple[u.Vector[length], u.Vector[length]]
moldesign.geom.angle_gradient(a1, a2, a3)[source]

Gradient of the angle between bonds a2-a1 and a2-a3

\[\nabla \theta_{ijkl} = \frac{\partial \theta_{ijkl}}{\partial \mathbf R}\]
Parameters:a1,a2,a3 (mdt.Atom) – the atoms describing the vector

References

https://salilab.org/modeller/9v6/manual/node436.html

moldesign.geom.dihedral_gradient(a1, a2, a3, a4)[source]

Cartesian gradient of a dihedral coordinate,

\[\nabla \theta_{ijkl} = \frac{\partial \theta_{ijkl}}{\partial \mathbf R}\]
Parameters:a1,a2,a3,a4 (mdt.Atom) – the atoms describing the dihedral

References

https://salilab.org/modeller/9v6/manual/node436.html

moldesign.geom.set_distance(a1, a2, newlength, adjustmol=True)[source]

Set the distance between two atoms. They will be adjusted along the vector separating them. If the two atoms are A) bonded, B) not part of the same ring system, and C) adjustmol is True, then the entire molecule’s positions will be modified as well

Parameters:
  • a1,a2 (mdt.Atom) – atoms to adjust
  • newlength (u.Scalar[length]) – new length to set
  • adjustmol (bool) – Adjust all atoms on either side of this bond?
moldesign.geom.set_angle(a1, a2, a3, theta, adjustmol=True)[source]

Set the angle between bonds a1-a2 and a3-a2. The atoms will be adjusted along the gradient of the angle. If adjustmol is True and the topology is unambiguous, then the entire molecule’s positions will be modified as well

Parameters:
  • a1,a2,a3 (mdt.Atom) – atoms to adjust
  • theta (u.Scalar[angle]) – new angle to set
  • adjustmol (bool) – Adjust all atoms on either side of this bond?
moldesign.geom.set_dihedral(a1, a2=None, a3=None, a4=None, theta=None, adjustmol=True)[source]

Set the twist angle of atoms a1 and a4 around the central bond a2-a3. The atoms will be adjusted along the gradient of the angle.

Can be called as set_dihedral(a1, a2, a3, a4, theta, adjustmol=True)
OR set_dihedral(a2, a2, theta, adjustmol=True) OR set_dihedral(bond, theta, adjustmol=True)

If adjustmol is True and the topology is unambiguous, then the entire molecule’s positions will be modified as well

Parameters:
  • a1 (mdt.Bond) – central bond in dihedral
  • a1,a2 (mdt.Atom) – atoms around central bond in dihedral
  • a4 (a3,) –
  • theta (u.Scalar[angle]) – new angle to set
  • adjustmol (bool) – Adjust all atoms on either side of this bond?