Commit 05860ed6 authored by sruizcarmona's avatar sruizcarmona

commented all XB changes for atom-weighting. Unit test 55/55 ok now.

parent 65480cf8
......@@ -326,7 +326,7 @@ SOURCES = ../import/simplex/src/NMSearch.cxx \
../src/lib/RbtVdwIntraSF.cxx \
../src/lib/RbtVdwSF.cxx \
../src/lib/RbtWorkSpace.cxx
VERSION = rDock_2013.1
VERSION = rDock_2013.1_src
INCLUDEPATH = ../include;../include/GP;../import/simplex/include;../import/tnt/include
DEPENDPATH = $INCLUDEPATH
DEFINES += _NDEBUG
......
......@@ -11,7 +11,6 @@ TMAKE_CC = /usr/bin/gcc
TMAKE_CFLAGS = -pipe -m64
TMAKE_CFLAGS_WARN_ON = -Wall -W
TMAKE_CFLAGS_WARN_OFF =
#TMAKE_CFLAGS_RELEASE = -O3 -ffast-math -march=i686 -march=k8
TMAKE_CFLAGS_RELEASE = -O3 -ffast-math
TMAKE_CFLAGS_DEBUG = -g
TMAKE_CFLAGS_SHLIB = -fPIC
......
......@@ -251,8 +251,8 @@ class RbtAtom
// XB
// reweighting factor
RbtDouble GetReweight() const {return m_dReweight;}
void SetReweight(const RbtDouble dReweight) {m_dReweight = dReweight;}
// RbtDouble GetReweight() const {return m_dReweight;}
// void SetReweight(const RbtDouble dReweight) {m_dReweight = dReweight;}
// XB END MODIFICATIONS
......@@ -327,7 +327,7 @@ class RbtAtom
RbtDouble m_dAtomicMass; //atomic mass
RbtDouble m_dVdwRadius; //atomic mass
RbtString m_strFFType; //force field atom type
RbtDouble m_dReweight; // XB reweighting factor
// RbtDouble m_dReweight; // XB reweighting factor
RbtUIntCoordMap m_savedCoords; //DM 08 Feb 1999 - now store all saved coords in a map<RbtUInt,RbtCoord>
};
......
......@@ -48,7 +48,7 @@ class RbtVdwSF : public virtual RbtBaseSF, public virtual RbtAnnotationHandler
//As above, but with additional checks for enabled state of each atom
RbtDouble VdwScoreEnabledOnly(const RbtAtom* pAtom, const RbtAtomRList& atomList) const;
//XB Same as above, used to calcutate intra terms without the reweighting factors
RbtDouble VdwScoreIntra(const RbtAtom* pAtom, const RbtAtomRList& atomList) const;
//RbtDouble VdwScoreIntra(const RbtAtom* pAtom, const RbtAtomRList& atomList) const;
//Looks up the maximum range (rmax_sq) for any interaction
//i.e. from across a row of m_vdwTable
RbtDouble MaxVdwRange(const RbtAtom* pAtom) const;
......
......@@ -242,12 +242,12 @@ void RbtMOL2FileSource::ParseRecordATOM(const RbtString& aLine) {
// XB reweighting parameters
// RbtDouble wxb = (tokens.size() > 9) ? atof(tokens[9].c_str()) : 1.0;
//XB mod for only doing if number, not characters
RbtDouble wxb;
if (tokens.size() > 9 && isdigit(tokens[9][0])){
wxb = atof(tokens[9].c_str());
} else {
wxb = 1.0;
}
// RbtDouble wxb;
// if (tokens.size() > 9 && isdigit(tokens[9][0])){
// wxb = atof(tokens[9].c_str());
// } else {
// wxb = 1.0;
// }
//end XB reweighting parameters
//Derived atom params (some may be updated later)
......@@ -281,7 +281,7 @@ void RbtMOL2FileSource::ParseRecordATOM(const RbtString& aLine) {
newAtom->SetPartialCharge(charge);
newAtom->SetHybridState(hybrid_state);
newAtom->SetAtomicMass(elementData.mass);
newAtom->SetReweight(wxb);
// newAtom->SetReweight(wxb); //XB
m_atomList.push_back(newAtom);
m_ssAtoms[subst_id].push_back(newAtom);
......
......@@ -126,13 +126,13 @@ void RbtSetupPolarSF::SetupAtomList(RbtAtomList& atomList,
charge *= guanFactor;//Adjustable weight for "IONIC" interactions with guanidinium carbons
}
// XB apply reweighting factor for receptor's polar atoms:
if (traceTriggerLevel == 1) {
RbtDouble wxb = (*iter)->GetReweight();
(*iter)->SetUser1Value(fNeighb*charge*wxb);
// if (traceTriggerLevel == 1) {
// RbtDouble wxb = (*iter)->GetReweight();
// (*iter)->SetUser1Value(fNeighb*charge*wxb);
// cout << "Atom: " << (*iter)->GetAtomName() << " Polar_User1Value: " << (*iter)->GetUser1Value() << " weigth: " << wxb << endl;
}else{
//}else{
(*iter)->SetUser1Value(fNeighb*charge);
}
// }
// XB END MODIFICATIONS
(*iter)->SetUser1Flag(bIsLipo(*iter));
if (iTrace > traceTriggerLevel) {
......
......@@ -425,7 +425,8 @@ RbtDouble RbtVdwIdxSF::ReceptorScore() const {
RbtInt id = (*iter)->GetAtomId()-1;
//XB changed call from "VdwScore" to "VdwScoreIntra" and created new function
// in "RbtVdwSF.cxx" to avoid using reweighting terms for intra
RbtDouble s = VdwScoreIntra(*iter,m_recFlexPrtIntns[id]);
//RbtDouble s = VdwScoreIntra(*iter,m_recFlexPrtIntns[id]);
RbtDouble s = VdwScore(*iter,m_recFlexPrtIntns[id]);
score += s;
}
return score;
......@@ -467,7 +468,8 @@ RbtDouble RbtVdwIdxSF::ReceptorSolventScore() const {
const RbtAtomRList& recepAtomList = m_spGrid->GetAtomList(c);
//XB changed call from "VdwScore" to "VdwScoreIntra" and created new function
// in "RbtVdwSF.cxx" to avoid using reweighting terms for intra
score += VdwScoreIntra(*iter,recepAtomList);
//score += VdwScoreIntra(*iter,recepAtomList);
score += VdwScore(*iter,recepAtomList);
}
}
return score;
......
......@@ -109,7 +109,8 @@ RbtDouble RbtVdwIntraSF::RawScore() const {
RbtInt id = (*iter)->GetAtomId()-1;
//XB changed call from "VdwScore" to "VdwScoreIntra" and created new function
// in "RbtVdwSF.cxx" to avoid using reweighting terms for intra
RbtDouble s = VdwScoreIntra(*iter,m_prtIntns[id]);
//RbtDouble s = VdwScoreIntra(*iter,m_prtIntns[id]);
RbtDouble s = VdwScore(*iter,m_prtIntns[id]);
score += s;
}
return score;
......
......@@ -94,9 +94,9 @@ RbtDouble RbtVdwSF::VdwScore(const RbtAtom* pAtom, const RbtAtomRList& atomList)
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f4_8(R_sq,*iter2);
// XB NOTE: Apply weight here
RbtDouble wxb = (*iter)->GetReweight();
// RbtDouble wxb = (*iter)->GetReweight();
// cout << "4-8vdw " << (*iter)->GetAtomName() << " weight: " << wxb << " score " << s;
s *= wxb;
// s *= wxb;
// cout << " score*w " << s << endl;
// XB END MODIFICATIONS
score += s;
......@@ -112,9 +112,9 @@ RbtDouble RbtVdwSF::VdwScore(const RbtAtom* pAtom, const RbtAtomRList& atomList)
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f6_12(R_sq,*iter2);
// XB NOTE: Apply weight here
RbtDouble wxb = (*iter)->GetReweight();
//RbtDouble wxb = (*iter)->GetReweight();
// cout << "6-12vdw " << (*iter)->GetAtomName() << " weight: " << wxb << " score " << s;
s *= wxb;
// s *= wxb;
// cout << " score*w " << s << endl;
// XB END MODIFICATIONS
if (s != 0.0) {
......@@ -134,9 +134,9 @@ RbtDouble RbtVdwSF::VdwScore(const RbtAtom* pAtom, const RbtAtomRList& atomList)
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f6_12(R_sq,*iter2);
// XB NOTE: Apply weight here
RbtDouble wxb = (*iter)->GetReweight();
// RbtDouble wxb = (*iter)->GetReweight();
// cout << "6-12vdw " << (*iter)->GetAtomName() << " weight: " << wxb << " score " << s;
s *= wxb;
// s *= wxb;
// cout << " score*w " << s << endl;
// XB END MODIFICATIONS
score += s;
......@@ -206,60 +206,60 @@ RbtDouble RbtVdwSF::VdwScoreEnabledOnly(const RbtAtom* pAtom, const RbtAtomRList
return score;
}
//This is the old VdwScore, without reweighting factors
RbtDouble RbtVdwSF::VdwScoreIntra(const RbtAtom* pAtom, const RbtAtomRList& atomList) const {
RbtDouble score = 0.0;
if (atomList.empty()) {
return score;
}
const RbtCoord& c1 = pAtom->GetCoords();
//Get the iterator into the appropriate row of the vdw table for this atom type
RbtTriposAtomType::eType type1 = pAtom->GetTriposType();
RbtVdwTableConstIter iter1 = m_vdwTable.begin() + type1;
//4-8 potential, never annotated
if (m_use_4_8) {
for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
const RbtCoord& c2 = (*iter)->GetCoords();
RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
//iter2 points to the vdw params for this atom type pair
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f4_8(R_sq,*iter2);
score += s;
}
}
//6-12 with annotation
else if (isAnnotationEnabled()) {
for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
const RbtCoord& c2 = (*iter)->GetCoords();
RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
//iter2 points to the vdw params for this atom type pair
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f6_12(R_sq,*iter2);
if (s != 0.0) {
score += s;
RbtAnnotationPtr spAnnotation(new RbtAnnotation(pAtom,*iter,sqrt(R_sq),s));
AddAnnotation(spAnnotation);
}
}
}
//6-12 without annotation
else {
for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
const RbtCoord& c2 = (*iter)->GetCoords();
RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
//iter2 points to the vdw params for this atom type pair
RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
RbtDouble s = f6_12(R_sq,*iter2);
score += s;
}
}
return score;
}
//XB This is the old VdwScore, without reweighting factors
//RbtDouble RbtVdwSF::VdwScoreIntra(const RbtAtom* pAtom, const RbtAtomRList& atomList) const {
// RbtDouble score = 0.0;
// if (atomList.empty()) {
// return score;
// }
//
// const RbtCoord& c1 = pAtom->GetCoords();
// //Get the iterator into the appropriate row of the vdw table for this atom type
// RbtTriposAtomType::eType type1 = pAtom->GetTriposType();
// RbtVdwTableConstIter iter1 = m_vdwTable.begin() + type1;
//
// //4-8 potential, never annotated
// if (m_use_4_8) {
// for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
// const RbtCoord& c2 = (*iter)->GetCoords();
// RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
// RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
// //iter2 points to the vdw params for this atom type pair
// RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
// RbtDouble s = f4_8(R_sq,*iter2);
// score += s;
// }
// }
// //6-12 with annotation
// else if (isAnnotationEnabled()) {
// for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
// const RbtCoord& c2 = (*iter)->GetCoords();
// RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
// RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
// //iter2 points to the vdw params for this atom type pair
// RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
// RbtDouble s = f6_12(R_sq,*iter2);
// if (s != 0.0) {
// score += s;
// RbtAnnotationPtr spAnnotation(new RbtAnnotation(pAtom,*iter,sqrt(R_sq),s));
// AddAnnotation(spAnnotation);
// }
// }
// }
// //6-12 without annotation
// else {
// for (RbtAtomRListConstIter iter = atomList.begin(); iter != atomList.end(); iter++) {
// const RbtCoord& c2 = (*iter)->GetCoords();
// RbtDouble R_sq = Rbt::Length2(c1,c2);//Distance squared
// RbtTriposAtomType::eType type2 = (*iter)->GetTriposType();
// //iter2 points to the vdw params for this atom type pair
// RbtVdwRowConstIter iter2 = (*iter1).begin() + type2;
// RbtDouble s = f6_12(R_sq,*iter2);
// score += s;
// }
// }
// return score;
//}
RbtDouble RbtVdwSF::MaxVdwRange(const RbtAtom* pAtom) const {
return m_maxRange[pAtom->GetTriposType()];
}
......
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