Skip to content

Commit

Permalink
ignore bulge option in dssp calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryuichiro Ishitani committed Aug 9, 2016
1 parent cb52bf5 commit 7b39e3d
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 71 deletions.
5 changes: 2 additions & 3 deletions src/modules/molanl/MolAnlManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ namespace {
}
}


void MolAnlManager::calcProt2ndry(MolCoordPtr pMol, double hbmax)
void MolAnlManager::calcProt2ndry(MolCoordPtr pMol, double hbmax, bool bignb)
{
// Record undo info
Prot2ndryEditInfo *pPEI = NULL;
Expand All @@ -596,7 +595,7 @@ void MolAnlManager::calcProt2ndry(MolCoordPtr pMol, double hbmax)
pPEI->saveBefore(pMol);
}

pMol->calcProt2ndry(hbmax);
pMol->calcProt2ndry(hbmax, bignb);

// Record redo info
if (pPEI!=NULL && uu.isOK()) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/molanl/MolAnlManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace molanl {
double r_min, double r_max, bool hbond,
int nMax);

void calcProt2ndry(MolCoordPtr pMol, double hbmax);
void calcProt2ndry(MolCoordPtr pMol, double hbmax, bool bignb);

void setProt2ndry(MolCoordPtr pMol, SelectionPtr pSel, int nSecType);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/molanl/MolAnlManager.qif
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runtime_class MolAnlManager
//////////////////////////
// protein secondary structure

void calcProt2ndry(object<MolCoord$> pmol, real hbmax);
void calcProt2ndry(object<MolCoord$> pmol, real hbmax, boolean ignb);

void setProt2ndry(object<MolCoord$> pmol, object<MolSelection$> pSel, integer nSecType);

Expand Down
8 changes: 4 additions & 4 deletions src/modules/molstr/MolBond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace {

MolAtomPtr pBonAtm1 = pMol->getAtom(pb->getAtom1());
MolAtomPtr pBonAtm2 = pMol->getAtom(pb->getAtom2());
MB_DPRINTLN("Bond %s <--> %s",
pBonAtm1->toString().c_str(),
pBonAtm2->toString().c_str());
//MB_DPRINTLN("Bond %s <--> %s",
//pBonAtm1->toString().c_str(),
//pBonAtm2->toString().c_str());
if (pb->getAtom1()==aid1)
atoms1.push_back(pBonAtm2->getPos());
else if (pb->getAtom2()==aid1)
Expand All @@ -64,7 +64,7 @@ namespace {

bOK = true;

MB_DPRINTLN("DblBon nbon=%d, nv=%s", nbon1, nv1.toString().c_str());
//MB_DPRINTLN("DblBon nbon=%d, nv=%s", nbon1, nv1.toString().c_str());
return nv1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/molstr/MolCoord.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace molstr {
///
/// Calculate secondary structure (impl: Prot2ndry.cpp)
///
void calcProt2ndry(double hb_high = -500.0);
void calcProt2ndry(double hb_high = -500.0, bool bIgnoreBulge=false);

void calcBasePair(double cutoff, double tilt);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/molstr/MolCoord.qif
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ runtime_class MolCoord extends Object
integer appendAtom1(object<MolAtom$> pAtom, string chain, integer resid, string resn) => appendAtomScr1;

void applyTopology();
void calcProt2ndry(real hb_high);
void calcProt2ndry(real hb_high, boolean bIgnoreBulge);
void calcBasePair(real cutoff, real tilt);
};

Expand Down
48 changes: 29 additions & 19 deletions src/modules/molstr/Prot2ndry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ namespace {
/// HBHIGH - HIGHEST ALLOWED ENERGY OF A HYDROGEN BOND IN CAL/MOL
double m_hbhigh;

/// Ignore-bulge flag
/// Do not link beta strand connected by a bulge
bool m_bIgnoreBulge;

//////////////////////////////////

///
Expand Down Expand Up @@ -680,12 +684,12 @@ namespace {
MB_DPRINTLN("%s sheet", (with.btyp==parallel)?"parallel":"antiparallel");

MB_DPRINTLN(" %s%d (%d) <--> %s%d (%d)",
pr_ib->getChainName().c_str(), pr_ib->getIndex(), with.ib,
pr_jb->getChainName().c_str(), pr_jb->getIndex(), with.jb);
pr_ib->getChainName().c_str(), pr_ib->getIndex().toInt(), with.ib,
pr_jb->getChainName().c_str(), pr_jb->getIndex().toInt(), with.jb);

MB_DPRINTLN(" %s%d (%d) <--> %s%d (%d)",
pr_ie->getChainName().c_str(), pr_ie->getIndex(), with.ie,
pr_je->getChainName().c_str(), pr_je->getIndex(), with.je);
pr_ie->getChainName().c_str(), pr_ie->getIndex().toInt(), with.ie,
pr_je->getChainName().c_str(), pr_je->getIndex().toInt(), with.je);
}
#endif
}
Expand Down Expand Up @@ -783,9 +787,9 @@ namespace {
}

/*
link the two bridges connected by a buldge
link the two bridges connected by a bulge
*/
void linkBuldge(Bridge &Abr, Bridge &Bbr)
void linkBulge(Bridge &Abr, Bridge &Bbr)
{
if (Abr.btyp==parallel) {
MB_DPRINTLN("linking par: (%d:%d) --> (%d:%d)",
Expand All @@ -809,7 +813,7 @@ namespace {
If two the same b-type bridges are separated 1 and 4 residues,
they are defined to be connected by a buldge region.
*/
bool checkBuldge(Bridge &Abr, Bridge &Bbr)
bool checkBulge(Bridge &Abr, Bridge &Bbr)
{
int idiff, jdiff;

Expand All @@ -820,7 +824,7 @@ namespace {
if (1<=idiff && 1<=jdiff) {
if ((idiff<=2 && jdiff<=5) ||
(idiff<=5 && jdiff<=2)) {
linkBuldge(Abr, Bbr);
linkBulge(Abr, Bbr);
return true;
}
}
Expand All @@ -831,7 +835,7 @@ namespace {
if (1<=idiff && 1<=jdiff) {
if ((idiff<=2 && jdiff<=5) ||
(idiff<=5 && jdiff<=2)) {
linkBuldge(Bbr, Abr);
linkBulge(Bbr, Abr);
return true;
}
}
Expand All @@ -843,7 +847,7 @@ namespace {
if (1<=idiff && 1<=jdiff) {
if ((idiff<=2 && jdiff<=5) ||
(idiff<=5 && jdiff<=2)) {
linkBuldge(Abr, Bbr);
linkBulge(Abr, Bbr);
return true;
}
}
Expand All @@ -854,7 +858,7 @@ namespace {
if (1<=idiff && 1<=jdiff) {
if ((idiff<=2 && jdiff<=5) ||
(idiff<=5 && jdiff<=2)) {
linkBuldge(Bbr, Abr);
linkBulge(Bbr, Abr);
return true;
}
}
Expand All @@ -879,13 +883,18 @@ namespace {
if (iwith.ib!=iwith.ie)
iwith.bIsolated = false;

BridgeList::iterator jter = iter; //m_bridges.begin();
++jter;
for (; jter!=eiter; ++jter) {
Bridge &jwith = *jter;
if (!checkBuldge(iwith, jwith)) continue;
iwith.bIsolated = false;
jwith.bIsolated = false;
if (!m_bIgnoreBulge) {
BridgeList::iterator jter = iter;
++jter;
for (; jter!=eiter; ++jter) {
Bridge &jwith = *jter;
if (!checkBulge(iwith, jwith)) continue;
MB_DPRINTLN("Buldge detected for %d:%d/%d:%d - %d:%d/%d:%d",
iwith.ib, iwith.ie, iwith.jb, iwith.je,
jwith.ib, jwith.ie, jwith.jb, jwith.je);
iwith.bIsolated = false;
jwith.bIsolated = false;
}
}
}

Expand Down Expand Up @@ -1224,13 +1233,14 @@ namespace {

//////////////////////////////////////

void MolCoord::calcProt2ndry(double hb_high)
void MolCoord::calcProt2ndry(double hb_high /*= -500.0*/, bool bIgnoreBulge /*=false*/)
{
MolCoordPtr pMol(this);

Prot2ndry ps;
ps.init(pMol);
ps.m_hbhigh = hb_high;
ps.m_bIgnoreBulge = bIgnoreBulge;
if (ps.m_chains.size()<=0) {
MB_DPRINTLN("calcProt2ndry> no amino acid residues in %d/%s",
getUID(), getName().c_str());
Expand Down
56 changes: 28 additions & 28 deletions src/modules/molvis/RibbonRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ using gfx::ColorPtr;
/////////////////////////////////////////////////////

namespace molvis {
// Specialized evaluator for ribbon smoothness values
class RibbonSmoothEval : public RealNumEvaluator
{
public:
double m_helix;
double m_sheet;
double m_coil;

RibbonSmoothEval() : m_helix(0.0), m_sheet(0.5), m_coil(0.0) {}
virtual ~RibbonSmoothEval() {}
// Specialized evaluator for ribbon smoothness values
class RibbonSmoothEval : public RealNumEvaluator
{
public:
double m_helix;
double m_sheet;
double m_coil;

RibbonSmoothEval() : m_helix(0.0), m_sheet(0.5), m_coil(0.0) {}
virtual ~RibbonSmoothEval() {}

virtual bool getAtomValue(MolAtom *pAtom, double &value) {
// not used
return false;
}

virtual bool getAtomValue(MolAtom *pAtom, double &value) {
// not used
return false;
}
virtual bool getResidValue(MolResidue *pRes, double &value) {
if (pRes==NULL) return false;
LString sec("coil");
pRes->getPropStr("secondary", sec);
if (sec.equals("helix"))
value = m_helix;
else if (sec.equals("sheet"))
value = m_sheet;
else
value = m_coil;

virtual bool getResidValue(MolResidue *pRes, double &value) {
if (pRes==NULL) return false;
LString sec("coil");
pRes->getPropStr("secondary", sec);
if (sec.equals("helix"))
value = m_helix;
else if (sec.equals("sheet"))
value = m_sheet;
else
value = m_coil;
return true;
}

return true;
}

};
};
}

/////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions src/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Version info
//

#define FILEVER 2,2,2,393
#define PRODUCTVER 2,2,2,393
#define STRFILEVER "2.2.2.393"
#define STRPRODUCTVER "2.2.2.393"
#define BUILD_ID 20160722103849
#define STRBUILD_ID "20160722103849"
#define FILEVER 2,2,2,394
#define PRODUCTVER 2,2,2,394
#define STRFILEVER "2.2.2.394"
#define STRPRODUCTVER "2.2.2.394"
#define BUILD_ID 20160809180044
#define STRBUILD_ID "20160809180044"

#define QUE_VERSION_STRING "Version " STRPRODUCTVER " build " STRBUILD_ID

2 changes: 1 addition & 1 deletion src/xpcom/XPCTimerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# include <xmlrpc_bridge/XmlRpcMgr.hpp>
#endif

#define USE_PERFTIMER 1
// #define USE_PERFTIMER 1

#ifdef USE_PERFTIMER
# include <boost/timer/timer.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/xul_gui/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Vendor=BKR-LAB
Name=CueMol2_GUI
;
; This field specifies your application's version. This field is optional.
Version=2.2.2.393
Version=2.2.2.394
;
; This field specifies your application's build ID (timestamp). This field is
; required.
BuildID=20160722103849
BuildID=20160809180044
;
; This field specifies a compact copyright notice for your application. This
; field is optional.
Expand Down
2 changes: 2 additions & 0 deletions src/xul_gui/chrome/content/tools/prot2ndry-tool-dlg.xul
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<radio label="Recalc secondry str" id="radio_recalc" selected="true"/>
</caption>

<checkbox id="ign_bulge" label="Ignore &#0946; bulge" checked="false"/>

<hbox align="center">
<label value="Max hbond energy (cal/mol):"/>
<textbox id="hbmax" type="number"
Expand Down
7 changes: 6 additions & 1 deletion src/xul_gui/chrome/content/tools/prot2ndry-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if (!("Prot2ndryTool" in cuemolui)) {
let that = this;

this.mHbMax = document.getElementById('hbmax');
this.mIgnBlg = document.getElementById('ign_bulge');

this.mTargMol.addSelChanged(function(aEvent) {
try { that.onTargMolChanged(aEvent);}
Expand Down Expand Up @@ -133,11 +134,13 @@ if (!("Prot2ndryTool" in cuemolui)) {
dd("onRadioSelChanged: "+tgtid);
if (tgtid=="radio_recalc") {
this.mHbMax.disabled = false;
this.mIgnBlg.disabled = false;
this.mTargSel.disabled = true;
this.mSecTypeSel.disabled = true;
}
else if (tgtid=="radio_assign") {
this.mHbMax.disabled = true;
this.mIgnBlg.disabled = true;
this.mTargSel.disabled = false;
this.mSecTypeSel.disabled = false;
}
Expand Down Expand Up @@ -195,6 +198,8 @@ if (!("Prot2ndryTool" in cuemolui)) {
if (isNaN(hbmax))
return false;

let bIgnBlg = this.mIgnBlg.checked;

/////////////////////////////////////

let mgr = cuemol.getService("MolAnlManager");
Expand All @@ -203,7 +208,7 @@ if (!("Prot2ndryTool" in cuemolui)) {
scene.startUndoTxn("Recalc protein secondary str");

try {
mgr.calcProt2ndry(tgtmol, hbmax);
mgr.calcProt2ndry(tgtmol, hbmax, bIgnBlg);
}
catch (e) {
dd("calcProt2ndry Error!!");
Expand Down
3 changes: 0 additions & 3 deletions winbuild/cuemol2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal

0 comments on commit 7b39e3d

Please sign in to comment.