@@ -200,8 +200,7 @@ def getReverseScores(mols, frags, score_threshold, writer):
200
200
# Score 1: the score is scaled by the number of bit atoms
201
201
score_1 = final_df .Modified_SuCOS_score .sum ()
202
202
203
- # Let's only get frags with a score > 0
204
- #final_df['SuCOS_score'] = 0.5 * final_df.Feat_score + 0.5 * final_df.Shape_score
203
+ # Let's only get frags with a score > 0
205
204
final_df = final_df [final_df .Modified_SuCOS_score > 0 ]
206
205
207
206
# Get the unique fragments above threshold
@@ -216,7 +215,7 @@ def getReverseScores(mols, frags, score_threshold, writer):
216
215
writer .write (mol )
217
216
writer .flush ()
218
217
219
- def process (molecules , fragments , writer ):
218
+ def process (molecules , fragments , writer , threshold = 0.4 ):
220
219
221
220
frag_mol_list = []
222
221
errors = 0
@@ -231,20 +230,20 @@ def process(molecules, fragments, writer):
231
230
utils .log ('Using' , len (frag_mol_list ), 'fragments. No errors' )
232
231
233
232
#mols, frags, score_threshold, writer
234
- getReverseScores (molecules , frag_mol_list , 0.5 , writer )
233
+ getReverseScores (molecules , frag_mol_list , threshold , writer )
235
234
236
235
237
236
def main ():
238
237
239
238
# Example usage:
240
- # python -m pipelines.xchem.xcos -f ../../data/mpro/hits-17.sdf.gz -i ../../data/mpro/poses.sdf.gz -o xcos
241
-
242
- global fmaps
239
+ # python -m pipelines.xchem.xcos -f ../../data/mpro/hits-17.sdf.gz -i ../../data/mpro/poses.sdf.gz -o xcos
243
240
244
241
parser = argparse .ArgumentParser (description = 'XCos scoring with RDKit' )
245
242
parameter_utils .add_default_io_args (parser )
246
243
parser .add_argument ('-f' , '--fragments' , required = True , help = 'Fragments to compare' )
247
244
parser .add_argument ('-ff' , '--fragments-format' , help = 'Fragments format' )
245
+ parser .add_argument ('-t' , '--score-threshold' , type = float , default = 0.4 ,
246
+ help = 'Minimum shape overlay and feature map score required for scoring a bit to a fragment' )
248
247
parser .add_argument ('--no-gzip' , action = 'store_true' , help = 'Do not compress the output (STDOUT is never compressed' )
249
248
parser .add_argument ('--metrics' , action = 'store_true' , help = 'Write metrics' )
250
249
@@ -276,7 +275,7 @@ def main():
276
275
compress = not args .no_gzip )
277
276
278
277
# this does the processing
279
- process (inputs_supplr , frags_suppl , writer )
278
+ process (inputs_supplr , frags_suppl , writer , threshold = args . score_threshold )
280
279
281
280
writer .close ()
282
281
0 commit comments