Skip to content

Commit 6766929

Browse files
committed
DFIRE cutoff and RST energy (experimental)
1 parent b8c007c commit 6766929

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lightdock/scoring/dfire/driver.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,28 @@ class DFIRE(ScoringFunction):
162162
def __init__(self, weight=1.0):
163163
super(DFIRE, self).__init__(weight)
164164
self.potential = DFIREPotential()
165+
try:
166+
with open('dfire.cutoff') as cutoff_file:
167+
self.cutoff = float(cutoff_file.readline())
168+
log.info('DFIRE cutoff is: %3.2f' % self.cutoff)
169+
except (IOError, ValueError):
170+
log.info('Using default DFIRE cutoff of 3.9')
171+
self.cutoff = 3.9
165172

166173
def __call__(self, receptor, receptor_coordinates, ligand, ligand_coordinates):
167174
energy, interface_receptor, interface_ligand = calculate_dfire(receptor, receptor_coordinates,
168175
ligand, ligand_coordinates,
169176
self.potential.dfire_dist_to_bins,
170-
self.potential.dfire_energy)
177+
self.potential.dfire_energy
178+
interface_cutoff=self.cutoff)
179+
180+
if len(receptor.restraints) and not len(ligand.restraints):
181+
return energy
182+
else:
183+
perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, interface_receptor)
184+
perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, interface_ligand)
185+
return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
171186

172-
perc_receptor_restraints = ScoringFunction.restraints_satisfied(receptor.restraints, interface_receptor)
173-
perc_ligand_restraints = ScoringFunction.restraints_satisfied(ligand.restraints, interface_ligand)
174-
return energy + perc_receptor_restraints * energy + perc_ligand_restraints * energy
175187

176188
# Needed to dynamically load the scoring functions from command line
177189
DefinedScoringFunction = DFIRE

0 commit comments

Comments
 (0)