Skip to content

Commit 56a40e1

Browse files
committed
tighter definition of MCS and other minor tweaks
1 parent 9da6f71 commit 56a40e1

File tree

4 files changed

+9
-182
lines changed

4 files changed

+9
-182
lines changed

src/nextflow/xchem/expand-tether-dock-score.nf

Lines changed: 0 additions & 172 deletions
This file was deleted.

src/nextflow/xchem/tether-dock-score.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ process xcos {
131131

132132
container 'informaticsmatters/rdkit_pipelines:latest'
133133

134-
publishDir ".", mode: 'move'
134+
publishDir ".", mode: 'link'
135135

136136
input:
137137
file part from featurestein_parts
138138
file fragments
139139

140140
output:
141-
file 'XC_*.sdf'
141+
file 'XC_*.sdf.gz'
142142

143143
"""
144-
python -m pipelines.xchem.xcos -i '$part' -if sdf -f '$fragments' -o 'XC_${part.name[0..-5]}' -of sdf --no-gzip
144+
python -m pipelines.xchem.xcos -i '$part' -if sdf -f '$fragments' -o 'XC_${part.name[0..-5]}' -of sdf
145145
"""
146146
}

src/python/pipelines/xchem/prepare_tether.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ def multi_constrained_embed(mol, target, mcsQuery, getForceField=UFFGetMoleculeF
240240

241241
mols_to_embed = enumerate_undefined_chirals(mol, free_counts)
242242

243-
timout_embed_secs = 5
244243
for new_mol in mols_to_embed:
245244
# print(' Target match:', targetMatch)
246245
# print(' Candid match:', molMatch)
@@ -262,7 +261,6 @@ def multi_constrained_embed(mol, target, mcsQuery, getForceField=UFFGetMoleculeF
262261
print(' WARNING: Could not embed molecule.')
263262
embedding_failures += 1
264263
else:
265-
print('conf id', ci, 'num_confs', new_mol.GetNumConformers())
266264
# rotate the embedded conformation onto the core:
267265
rms = AlignMol(new_mol, target, atomMap=algMap)
268266

@@ -363,6 +361,7 @@ def minimize_mol(mol, target, molMatch, targetMatch, algMap, getForceField):
363361
rms = AlignMol(mol, target, atomMap=algMap)
364362
mol.SetDoubleProp('EmbedRMS', rms)
365363

364+
366365
def execute(smi, hit_molfile, outfile_base, min_ph=None, max_ph=None, max_inputs=0, max_outputs=0, modulus=0, timout_embed_secs=5):
367366

368367
global write_count
@@ -411,9 +410,9 @@ def execute(smi, hit_molfile, outfile_base, min_ph=None, max_ph=None, max_inputs
411410
else:
412411
enumerated_mols = [mol]
413412

414-
mcs0 = rdFMCS.FindMCS([hit, mol], completeRingsOnly=True, matchValences=False, ringMatchesRingOnly=True,
415-
atomCompare=rdFMCS.AtomCompare.CompareAny, bondCompare=rdFMCS.BondCompare.CompareAny)
416-
#mcs0 = rdFMCS.FindMCS([hit, mol], completeRingsOnly=True, matchValences=False, ringMatchesRingOnly=False)
413+
# mcs0 = rdFMCS.FindMCS([hit, mol], completeRingsOnly=True, matchValences=False, ringMatchesRingOnly=True,
414+
# atomCompare=rdFMCS.AtomCompare.CompareAny, bondCompare=rdFMCS.BondCompare.CompareAny)
415+
mcs0 = rdFMCS.FindMCS([hit, mol], completeRingsOnly=True, ringMatchesRingOnly=True)
417416
mcsQuery = Chem.MolFromSmarts(mcs0.smartsString)
418417

419418
count = 0
@@ -459,7 +458,7 @@ def execute(smi, hit_molfile, outfile_base, min_ph=None, max_ph=None, max_inputs
459458
def main():
460459
"""
461460
Example usage:
462-
python scripts/transfs/prepare-tether-v3.py --smi Mpro-x0072_0.smi --mol Mpro-x0072_0.mol -o TETHERED --max-inputs 500 --chunk-size 1000
461+
python -m pipelines.xchem.prepare_tether --smi ../../data/mpro/Mpro-x0387_0.smi --mol ../../data/mpro/Mpro-x0387_0.mol -o TETHERED --max-inputs 500 --chunk-size 100
463462
464463
:return:
465464
"""

src/python/pipelines/xchem/xcos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def main():
376376
parser = argparse.ArgumentParser(description='XCos scoring with RDKit')
377377
parameter_utils.add_default_io_args(parser)
378378
parser.add_argument('-f', '--fragments', required=True, help='Fragments to compare')
379-
parser.add_argument('--fragments-format', help='Fragments format')
379+
parser.add_argument('-ff', '--fragments-format', help='Fragments format')
380380
parser.add_argument('--no-gzip', action='store_true', help='Do not compress the output (STDOUT is never compressed')
381381
parser.add_argument('--metrics', action='store_true', help='Write metrics')
382382

0 commit comments

Comments
 (0)