|
1 | 1 | #!/usr/bin/env nextflow
|
2 | 2 |
|
3 |
| -params.candidates = "data/mpro/expanded-17.json" |
4 |
| -params.chunk = 1000 |
| 3 | +params.smiles = '*.smi' |
| 4 | +params.molfiles = '*.mol' |
| 5 | +params.chunk_tether = 250 |
| 6 | +params.chunk_score = 10000 |
5 | 7 | params.limit = 0
|
6 |
| -params.digits = 4 |
7 |
| -params.generate_filenames = false |
| 8 | +params.num_conformers = 10 |
| 9 | +params.atom_compare = 'CompareElements' |
| 10 | +params.bond_compare = 'CompareOrder' |
| 11 | +params.complete_rings_only = true |
| 12 | +params.ring_matches_ring_only = true |
| 13 | +params.minimize = 4 |
8 | 14 |
|
9 |
| -candidates = file(params.candidates) |
10 | 15 |
|
11 |
| -process split_json { |
| 16 | +smilesfiles = file(params.smiles) |
| 17 | +molfiles = file(params.molfiles) |
| 18 | + |
| 19 | +process splitter { |
12 | 20 |
|
13 | 21 | container 'informaticsmatters/rdkit_pipelines:latest'
|
14 | 22 |
|
15 | 23 | input:
|
16 |
| - file candidates |
| 24 | + file smiles from smilesfiles.flatten() |
| 25 | + file mol from molfiles.flatten() |
17 | 26 |
|
18 | 27 | output:
|
19 |
| - file '*.smi' into smiles |
20 | 28 | file '*.mol' into mols
|
| 29 | + file '*.smi' into smiles |
21 | 30 |
|
22 | 31 | """
|
23 |
| - python -m pipelines.xchem.split_fragnet_candidates -i '$candidates' ${params.generate_filenames ? '--generate-filenames' : ''} |
| 32 | + stem=${smiles.name[0..-5]} |
| 33 | + split -l $params.chunk_tether -d -a 3 --additional-suffix .smi $smiles \${stem}_ |
| 34 | + mv $smiles ${smiles}.orig |
| 35 | + for f in *.smi |
| 36 | + do |
| 37 | + cp $mol \${f:0:-4}.mol |
| 38 | + done |
| 39 | + mv $mol ${mol}.orig |
24 | 40 | """
|
25 | 41 | }
|
26 | 42 |
|
27 | 43 | process tether {
|
28 | 44 |
|
29 | 45 | container 'informaticsmatters/rdkit_pipelines:latest'
|
| 46 | + publishDir '.' |
30 | 47 |
|
31 | 48 | input:
|
32 |
| - file smiles from smiles.flatten() //collect().toSortedList().flatten() |
33 |
| - file mol from mols.flatten() //collect().toSortedList().flatten() |
| 49 | + file smiles from smiles.flatten() |
| 50 | + file mol from mols.flatten() |
34 | 51 |
|
35 | 52 | output:
|
36 |
| - file 'Tethered_*.sdf' |
| 53 | + file 'Tethered_*.sdf' into tethered_parts |
| 54 | + |
37 | 55 | """
|
38 |
| - python -m pipelines.xchem.prepare_tether --smi '$smiles' --mol '$mol' -o 'Tethered_${smiles.name[0..-5]}' |
| 56 | + python -m pipelines.xchem.prepare_tether --smi '$smiles' --mol '$mol' --chunk-size $params.chunk_score\ |
| 57 | + --num-conformers $params.num_conformers -o 'Tethered_${smiles.name[0..-5]}'\ |
| 58 | + --atom-compare $params.atom_compare --bond-compare $params.bond_compare\ |
| 59 | + ${params.complete_rings_only ? '--complete-rings-only' : ''}\ |
| 60 | + ${params.ring_matches_ring_only ? '--ring-matches-ring-only' : ''}\ |
| 61 | + --minimize $params.minimize |
39 | 62 | """
|
40 | 63 | }
|
0 commit comments