File: gridedMM.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (120 lines) | stat: -rwxr-xr-x 3,776 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

// ----------------------------------------------------
// $Maintainer: Marcel Schumann $
// $Authors: Marcel Schumann $
// ----------------------------------------------------

#include <BALL/SCORING/FUNCTIONS/gridedMM.h>

#include <BALL/SCORING/COMPONENTS/advElectrostatic.h>
#include <BALL/SCORING/COMPONENTS/aromaticRingStacking.h>
#include <BALL/SCORING/COMPONENTS/solvation.h>
#include <BALL/SCORING/COMPONENTS/fragmentationalSolvation.h>
#include <BALL/SCORING/COMPONENTS/vanDerWaals.h>
#include <BALL/SCORING/COMPONENTS/hydrogenBond.h>
#include <BALL/SCORING/COMPONENTS/rotationalEntropy.h>
#include <BALL/SCORING/COMPONENTS/lipophilic.h>


using namespace BALL;


GridedMM::GridedMM(AtomContainer& receptor, AtomContainer& ligand, Options& options)
	: DiffGridBasedScoring(receptor, ligand, options)
{
	setup();
}


GridedMM::GridedMM(AtomContainer& receptor, Vector3& hashgrid_origin, Options& options)
	: DiffGridBasedScoring(receptor, hashgrid_origin, options)
{
	setup();
}


void GridedMM::setup()
{
	setName("GridedMM");

	AdvancedElectrostatic* es = new AdvancedElectrostatic(this, options_, forcefield_parameters_);
	es->setCoefficient(0.01);
	es->setScoringFunction(*this);
	scoring_components_.push_back(es);

	VanDerWaals* vdw = new VanDerWaals(es);
	vdw->setCoefficient(0.1);
	vdw->setScoringFunction(*this);
	scoring_components_.push_back(vdw);

	FragmentationalSolvation* solv = new FragmentationalSolvation(*this);
	solv->setCoefficient(19.823265);
	scoring_components_.push_back(solv);

	// HydrogenBond for h-bonds between receptor-hydrogens and ligand-acceptors.
	// The scores for this component will be precalculated and stored in the grid.
	HydrogenBond* hb = new HydrogenBond(*this, HydrogenBond::RECEPTOR_HYDROGENS);
	hb->selectBaseFunction("fermi");
	hb->setCoefficient(3);
	hb->setup();
	hb->setName("HB_rh");
	scoring_components_.push_back(hb);

	// HydrogenBond for h-bonds between ligand-hydrogens and receptor-acceptors.
	// The scores for this component cannot be precalculated and are calculated on-the-fly during docking.
	HydrogenBond* hb2 = new HydrogenBond(*this, HydrogenBond::LIGAND_HYDROGENS);
	hb2->selectBaseFunction("fermi");
	hb2->setCoefficient(3);
	hb2->setup();
	hb2->setName("HB_lh");
	scoring_components_.push_back(hb2);

	//RotationalEntropy will not be precalculated, thus we can use normalization
	//add ( = penalize) 1kJ/mol for each rotatable bond exceeding 14
	RotationalEntropy* re = new RotationalEntropy(*this);
	re->setNormalizationParameters(1, 14);
	re->setCoefficient(1);
	scoring_components_.push_back(re);

	/*
	// The following two components are used to penalize bad ligand conformations.
	// The score for a good conformation is scaled down according to option 'conformation_scale'.
	Electrostatic* lig_es = new Electrostatic(options_, forcefield_parameters_);
	lig_es->setLigandIntraMolecular(true);
	lig_es->setName("ES_lig");
	lig_es->setCoefficient(0.1);
	lig_es->setScoringFunction(*this);
	scoring_components_.push_back(lig_es);

	VanDerWaals* lig_vdw = new VanDerWaals(lig_es);
	lig_es->setLigandIntraMolecular(true);
	lig_vdw->setName("vdW_lig");
	lig_vdw->setCoefficient(0.1);
	lig_vdw->setScoringFunction(*this);
	scoring_components_.push_back(lig_vdw);
	*/
}


BALL::AtomTypes& GridedMM::getAtomTypes()
{
	return forcefield_parameters_.getAtomTypes();
}


// used during grid-calculation in order to fetch the ES-score
double GridedMM::getES()
{
	double es_score = 0;

	for (vector<ScoringComponent*> ::iterator it = scoring_components_.begin(); it != scoring_components_.end(); ++it)
	{
		Electrostatic* es = dynamic_cast<Electrostatic*>(*it);
		if (!(*it)->isLigandIntraMolecular() && (*it)->isEnabled() && es != NULL)
		{
			es_score += es->getScaledScore();
		}
	}

	return es_score;
}