@@ -160,8 +160,9 @@ def __init__(
160160
161161 self .filterLength = filterLength # The min filtering size.
162162
163- self .hitOverallDictionary = {} # The best (hit.ID, X).
164- self .hitPairDictionary = {} # The best (hit.ID, hit.reference).
163+ self .exclusionOverallDictionary = {} # The best (hit.ID, X).
164+ self .inclusionPairDictionary = {} # The best (hit.ID, hit.reference).
165+ self .exclusionPairDictionary = {} # The best (hit.ID, hit.reference).
165166
166167 self .overallScore = {} # The overall score of a signature.
167168 self .inclusionScore = {} # The inclusion score of a signature.
@@ -184,14 +185,14 @@ def __init__(
184185 [NONE]
185186
186187 POST:
187- The [self.overallScore ] dictionary will be updated.
188+ The [self.exclusionOverallDictionary ] dictionary will be updated.
188189
189190 # =========================================================================
190191 """
191- def updateHitOverallDictionary (self , hit ):
192+ def updateExclusionOverallDictionary (self , hit ):
192193
193- key = hit .ID # The key: ID of the hit.
194- dictionary = self .hitOverallDictionary # The dictionary to update.
194+ key = hit .ID
195+ dictionary = self .exclusionOverallDictionary
195196
196197 if key not in dictionary :
197198
@@ -204,11 +205,11 @@ def updateHitOverallDictionary(self, hit):
204205 """
205206 # =========================================================================
206207
207- UPDATE HIT PAIR DICTIONARY
208+ UPDATE PAIR DICTIONARY
208209
209210 PURPOSE:
210- The pair score dictionary will be updated with the passed hit. This
211- function is looking for the best hit for a (hit, reference) pair.
211+ The passed pair score dictionary will be updated with the passed hit.
212+ This function is looking for the best hit for a (hit, reference) pair.
212213
213214 INPUT:
214215 [HIT] [hit] - The hit object associated with the hit.
@@ -217,14 +218,13 @@ def updateHitOverallDictionary(self, hit):
217218 [NONE]
218219
219220 POST:
220- The [self.hitPairDictionary] object will be updated.
221+ The passed dictionary object will be updated.
221222
222223 # =========================================================================
223224 """
224- def updateHitPairDictionary (self , hit ):
225+ def updatePairDictionary (self , dictionary , hit ):
225226
226227 key = (hit .ID , hit .reference ) # The key: ID and reference.
227- dictionary = self .hitPairDictionary # The dictionary to update.
228228
229229 if key not in dictionary :
230230
@@ -257,13 +257,13 @@ def updateHitPairDictionary(self, hit):
257257 POST:
258258 The exclusion scores and negative component of the overall scores of
259259 [self.overallScore] and [self.exclusionScore] will be updated using the
260- [self.hitPairDictionary ].
260+ [self.exclusionPairDictionary ].
261261
262262 # =========================================================================
263263 """
264264 def updateExclusionScores (self ):
265265
266- dictionary = self .hitPairDictionary # The pair dictionary.
266+ dictionary = self .exclusionPairDictionary # The pair dictionary.
267267
268268 for key in dictionary :
269269
@@ -302,13 +302,13 @@ def updateExclusionScores(self):
302302 POST:
303303 The exclusion scores and negative component of the overall scores of
304304 [self.overallScore] and [self.inclusionScore] will be updated using the
305- [self.hitPairDictionary ].
305+ [self.inclusionPairDictionary ].
306306
307307 # =========================================================================
308308 """
309309 def updateInclusionScores (self ):
310310
311- dictionary = self .hitPairDictionary # The pair dictionary.
311+ dictionary = self .inclusionPairDictionary # The pair dictionary.
312312
313313 for key in dictionary :
314314
@@ -355,7 +355,7 @@ def reportFilteredCandidates(self):
355355 outputFile = open (self .filteredLocation , 'w' ) # The output.
356356 candidateSignatures = Signature .readSignatures (
357357 self .candidatesLocation ) # The input.
358- dictionary = self .hitOverallDictionary # Overall dictionary.
358+ dictionary = self .exclusionOverallDictionary # Overall dictionary.
359359
360360 for ID in candidateSignatures :
361361
@@ -460,8 +460,8 @@ def reportSignatures(self, exclusionQueryLocation):
460460 for line in exclusionQueryFile :
461461
462462 hit = Database .Hit (line )
463- self .updateHitOverallDictionary (hit )
464- self .updateHitPairDictionary ( hit )
463+ self .updateExclusionOverallDictionary (hit )
464+ self .updatePairDictionary ( self . exclusionPairDictionary , hit )
465465
466466 exclusionQueryFile .close ()
467467
@@ -498,7 +498,7 @@ def sortSignatures(self, inclusionQueryLocation):
498498 for line in inclusionQueryFile :
499499
500500 hit = Database .Hit (line )
501- self .updateHitPairDictionary ( hit )
501+ self .updatePairDictionary ( self . inclusionPairDictionary , hit )
502502
503503 inclusionQueryFile .close ()
504504
0 commit comments