Commit 59f2387b by maarten

backup

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@419 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 6d07611e
...@@ -256,6 +256,10 @@ class Monomer : public Residue ...@@ -256,6 +256,10 @@ class Monomer : public Residue
float psi() const; float psi() const;
float alpha() const; float alpha() const;
float kappa() const; float kappa() const;
// torsion angles
size_t nrOfChis() const;
float chi(size_t i) const;
bool isCis() const; bool isCis() const;
...@@ -272,10 +276,13 @@ class Monomer : public Residue ...@@ -272,10 +276,13 @@ class Monomer : public Residue
static bool areBonded(const Monomer& a, const Monomer& b, float errorMargin = 0.5f); static bool areBonded(const Monomer& a, const Monomer& b, float errorMargin = 0.5f);
static bool isCis(const Monomer& a, const Monomer& b); static bool isCis(const Monomer& a, const Monomer& b);
// for LEU and VAL
float chiralVolume() const;
private: private:
const Polymer* mPolymer; const Polymer* mPolymer;
uint32_t mIndex; uint32_t mIndex;
}; };
// -------------------------------------------------------------------- // --------------------------------------------------------------------
......
...@@ -947,6 +947,68 @@ float Monomer::kappa() const ...@@ -947,6 +947,68 @@ float Monomer::kappa() const
return result; return result;
} }
const map<string,vector<string>> kChiAtomsMap = {
{ "ASP", {"CG", "OD1"} },
{ "ASN", {"CG", "OD1"} },
{ "ARG", {"CG", "CD", "NE", "CZ"} },
{ "HIS", {"CG", "ND1"} },
{ "GLN", {"CG", "CD", "OE1"} },
{ "GLU", {"CG", "CD", "OE1"} },
{ "SER", {"OG"} },
{ "THR", {"OG1"} },
{ "LYS", {"CG", "CD", "CE", "NZ"} },
{ "TYR", {"CG", "CD1"} },
{ "PHE", {"CG", "CD1"} },
{ "LEU", {"CG", "CD1"} },
{ "TRP", {"CG", "CD1"} },
{ "CYS", {"SG"} },
{ "ILE", {"CG1", "CD1"} },
{ "MET", {"CG", "SD", "CE"} },
{ "MSE", {"CG", "SE", "CE"} },
{ "PRO", {"CG", "CD"} },
{ "VAL", {"CG1"} }
};
size_t Monomer::nrOfChis() const
{
size_t result = 0;
auto i = kChiAtomsMap.find(mCompoundID);
if (i != kChiAtomsMap.end())
result = i->second.size();
return result;
}
float Monomer::chi(size_t nr) const
{
float result = 0;
auto i = kChiAtomsMap.find(mCompoundID);
if (i != kChiAtomsMap.end() and nr < i->second.size())
{
vector<string> atoms{ "N", "CA", "CB" };
atoms.insert(atoms.begin(), i->second.begin(), i->second.end());
// in case we have a positive chiral volume we need to swap atoms
if (chiralVolume() > 0)
{
if (mCompoundID == "LEU") atoms.back() = "CD2";
if (mCompoundID == "VAL") atoms.back() = "CG2";
}
result = DihedralAngle(
atomByID(atoms[nr + 0]).location(),
atomByID(atoms[nr + 1]).location(),
atomByID(atoms[nr + 2]).location(),
atomByID(atoms[nr + 3]).location()
);
}
return result;
}
bool Monomer::isCis() const bool Monomer::isCis() const
{ {
bool result = false; bool result = false;
...@@ -961,6 +1023,34 @@ bool Monomer::isCis() const ...@@ -961,6 +1023,34 @@ bool Monomer::isCis() const
return result; return result;
} }
float Monomer::chiralVolume() const
{
float result = 0;
if (mCompoundID == "LEU")
{
auto centre = atomByID("CG");
auto atom1 = atomByID("CB");
auto atom2 = atomByID("CD1");
auto atom3 = atomByID("CD2");
result = DotProduct(atom1.location() - centre.location(),
CrossProduct(atom2.location() - centre.location(), atom3.location() - centre.location()));
}
else if (mCompoundID == "VAL")
{
auto centre = atomByID("CB");
auto atom1 = atomByID("CA");
auto atom2 = atomByID("CG1");
auto atom3 = atomByID("CG2");
result = DotProduct(atom1.location() - centre.location(),
CrossProduct(atom2.location() - centre.location(), atom3.location() - centre.location()));
}
return result;
}
bool Monomer::areBonded(const Monomer& a, const Monomer& b, float errorMargin) bool Monomer::areBonded(const Monomer& a, const Monomer& b, float errorMargin)
{ {
bool result = false; bool result = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment