RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
PrincipalAxes.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Principal axes calculation routines (in rxdock namespace)
14
15#ifndef _RBTPRINCIPALAXES_H_
16#define _RBTPRINCIPALAXES_H_
17
18#include "rxdock/Atom.h"
19#include "rxdock/Config.h"
20
21#include <nlohmann/json.hpp>
22
23using json = nlohmann::json;
24
25namespace rxdock {
26
27// Struct for holding principal axes info
28// Center of mass, three principal axis vectors, three principal moments
30public:
31 // Default is X,Y,Z cartesian axes centered at origin
33 : com(0.0, 0.0, 0.0), axis1(1.0, 0.0, 0.0), axis2(0.0, 1.0, 0.0),
34 axis3(0.0, 0.0, 1.0), moment1(1.0), moment2(1.0), moment3(1.0) {}
35 Coord com;
36 Vector axis1;
37 Vector axis2;
38 Vector axis3;
39 double moment1;
40 double moment2;
41 double moment3;
42};
43
44void to_json(json &j, const PrincipalAxes &principalAxes);
45void from_json(const json &j, PrincipalAxes &principalAxes);
46
47typedef std::vector<PrincipalAxes> PrincipalAxesList;
48typedef PrincipalAxesList::iterator PrincipalAxesListIter;
49typedef PrincipalAxesList::const_iterator PrincipalAxesListConstIter;
50
51// Calculates principal axes and center of mass for the atoms in the atom list
52RBTDLL_EXPORT PrincipalAxes GetPrincipalAxesOfAtoms(const AtomList &atomList);
53// Calculates principal axes and center of mass for the coords in the coord list
54// (assumes all masses=1)
55RBTDLL_EXPORT PrincipalAxes GetPrincipalAxesOfAtoms(const CoordList &coordList);
56// Special case for water
57PrincipalAxes GetSolventPrincipalAxes(const AtomPtr &oAtom,
58 const AtomPtr &h1Atom,
59 const AtomPtr &h2Atom);
60// DM 17 Jul 2001 - returns the quaternion used to effect the transformation
61Quat AlignPrincipalAxesOfAtoms(AtomList &atomList,
62 const PrincipalAxes &alignAxes = PrincipalAxes(),
63 bool bAlignCOM = true);
64// Returns the quaternion required to align principal axes with reference axes
65RBTDLL_EXPORT Quat GetQuatFromAlignAxes(const PrincipalAxes &prAxes,
66 const PrincipalAxes &refAxes);
67// Returns the quaternion required to effect an alignment of v onto ref vector.
68// Vectors do not have to be unit length.
69// BadArgument exception is thrown if either v or ref is zero length.
70Quat GetQuatFromAlignVectors(const Vector &v, const Vector &ref);
71
72} // namespace rxdock
73
74#endif //_RBTPRINCIPALAXES_H_
Definition Coord.h:45
Definition PrincipalAxes.h:29
Definition Quat.h:24