@@ -162,16 +162,28 @@ class DFIRE(ScoringFunction):
162
162
def __init__ (self , weight = 1.0 ):
163
163
super (DFIRE , self ).__init__ (weight )
164
164
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
165
172
166
173
def __call__ (self , receptor , receptor_coordinates , ligand , ligand_coordinates ):
167
174
energy , interface_receptor , interface_ligand = calculate_dfire (receptor , receptor_coordinates ,
168
175
ligand , ligand_coordinates ,
169
176
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
171
186
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
175
187
176
188
# Needed to dynamically load the scoring functions from command line
177
189
DefinedScoringFunction = DFIRE
0 commit comments