@@ -215,21 +215,21 @@ def get_mc_scores(propensities, identifier):
215
215
identifier ]
216
216
217
217
218
- def make_pair_file (api_molecule , tempdir , f , i ):
218
+ def make_pair_file (api_molecule , tempdir , f ):
219
219
# Creates a file for the api/coformer pair
220
220
with io .MoleculeReader (f ) as reader :
221
221
coformer_molecule = reader [0 ]
222
222
coformer_name = coformer_molecule .identifier
223
- molecule_pair = make_molecule_pair (api_molecule , coformer_molecule , i )
223
+ molecule_pair = make_molecule_pair (api_molecule , coformer_molecule )
224
224
molecule_file = os .path .join (tempdir , '%s.mol2' % molecule_pair .identifier )
225
225
with io .MoleculeWriter (molecule_file ) as writer :
226
226
writer .write (molecule_pair )
227
227
return molecule_file , coformer_name
228
228
229
229
230
- def make_molecule_pair (api_molecule , coformer_molecule , i ):
230
+ def make_molecule_pair (api_molecule , coformer_molecule ):
231
231
# Creates the multi-component system for each api/coformer pair
232
- new_file_name = '%s_%d ' % (api_molecule .identifier , i )
232
+ new_file_name = '%s--%s ' % (api_molecule .identifier , coformer_molecule . identifier )
233
233
molecule_pair = molecule .Molecule (new_file_name )
234
234
molecule_pair .add_molecule (api_molecule )
235
235
molecule_pair .add_molecule (coformer_molecule )
@@ -342,8 +342,8 @@ def main(structure, work_directory, failure_directory, library, csdrefcode, forc
342
342
failures = []
343
343
344
344
# for each coformer in the library, make a pair file for the api/coformer and run a HBP calculation
345
- for i , f in enumerate ( coformer_files ) :
346
- molecule_file , coformer_name = make_pair_file (api_molecule , tempdir , f , i + 1 )
345
+ for f in coformer_files :
346
+ molecule_file , coformer_name = make_pair_file (api_molecule , tempdir , f )
347
347
print (coformer_name )
348
348
crystal_reader = io .CrystalReader (molecule_file )
349
349
crystal = crystal_reader [0 ]
0 commit comments