Skip to content

Commit d90125b

Browse files
committed
fix problem with moved fragment method. Added instructions for running tests with conda.
1 parent 915dcef commit d90125b

File tree

7 files changed

+64
-5
lines changed

7 files changed

+64
-5
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,34 @@ playbooks.
203203
`Posting Squonk pipelines` section of Squonk's OpenShift Ansible
204204
[README](https://github.com/InformaticsMatters/squonk/blob/master/openshift/ansible/README.md).
205205

206+
## Running tests
207+
208+
The test running is in the pipelines-utils repo and tests are run from there.
209+
For full details consult that repo.
210+
211+
But as a quick start you should be able to run the the tests in a conda environment like this:
212+
213+
Create a conda environment containing RDKit:
214+
```
215+
conda env create -f environment-rdkit.yml
216+
```
217+
218+
Move into the `pipelines-utils` repo (this should be alongside `pipelines` and `pipelines-utils-rdkit`):
219+
```
220+
cd ../pipleines-utils
221+
```
222+
223+
Set your `PYTHONPATH` environment variable to include the `pipelines-utils` and `pipelines-utils-rdkit` sources
224+
(adjusting `/path/to/` to whatever is needed):
225+
```
226+
export PYTHONPATH=/path/to/pipelines-utils/src/python:/path/to/pipelines-utils-rdkit/src/python
227+
```
228+
229+
Run tests:
230+
```
231+
./gradlew runPipelineTester -Pptargs=-opipelines
232+
```
233+
206234
## Contact
207235

208236
Any questions contact:

environment-rdkit.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: pipelines
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.6
6+
- pip=20.0.2
7+
- rdkit=2019.09.2
8+
- pip:
9+
- matplotlib==2.2.*
10+
- molvs==0.1.1
11+
- standardiser==0.1.9

src/python/pipelines/dimorphite/enumerate_charges.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def add_src_mol_ref(src_mol, target_mol, index):
5555
:param index:
5656
:return:
5757
"""
58+
parent = None
5859
if src_mol.HasProp('uuid'):
5960
parent = src_mol.GetProp('uuid')
6061
elif src_mol.HasProp('_name_'):

src/python/pipelines/dimorphite/enumerate_charges.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version = 1,
66

77
// Testing cluster_butina.py reading from STDIN and writing to STDOUT
8-
test_raw_cluster_butina_from_sdf_to_default = [
8+
test_dimorphite_simple = [
99

1010
command: '''gunzip -c ${PIN}Kinase_inhibs.sdf.gz |
1111
python -m pipelines.dimorphite.enumerate_charges -if sdf''',

src/python/pipelines/rdkit/screen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from rdkit.Chem import MACCSkeys
2323
from rdkit.Chem.Fingerprints import FingerprintMols
2424

25-
from pipelines_utils_rdkit import filter, rdkit_utils
25+
from pipelines_utils_rdkit import filter, rdkit_utils, mol_utils
2626
from pipelines_utils import parameter_utils, utils
2727

2828
### start field name defintions #########################################
@@ -99,7 +99,7 @@ def main():
9999
i +=1
100100
if mol is None: continue
101101
if args.fragment:
102-
mol = filter.fragment(mol, args.fragment, quiet=args.quiet)
102+
mol = mol_utils.fragment(mol, args.fragment, quiet=args.quiet)
103103
if not filter.filter(mol, minHac=args.hacmin, maxHac=args.hacmax, minMw=args.mwmin, maxMw=args.mwmax, quiet=args.quiet):
104104
continue
105105
target_fp = descriptor(mol)

src/python/pipelines/rdkit/screen.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@
4848

4949
],
5050

51+
// Testing screen.py reading and writing files using sdf with --fragment argument
52+
test_screen_fragment = [
53+
54+
command: '''python -m pipelines.rdkit.screen
55+
-i ${PIN}dhfr_3d.sdf.gz -o ${POUT}output -of sdf
56+
--qsmiles 'C1N=C(C2=CC=CC=C2)C2=CC=CC=C2C2=C1C=NC(NC1=CC=CC=C1)=N2'
57+
--simmin 0.45 -if sdf --meta --fragment hac''',
58+
59+
stderr: [ 'Found [1-9]\\d+ similar molecules' ],
60+
61+
creates: [ 'output.sdf.gz',
62+
'output_metrics.txt' ],
63+
64+
metrics: [ 'RDKitScreen': '756',
65+
'__InputCount__': '756',
66+
'__OutputCount__': '[1-9]\\d+' ],
67+
68+
],
69+
5170
// Testing screen.py reading and writing files using json
5271
test_nci100_data_json = [
5372

src/python/pipelines/rdkit/screen_multi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from rdkit.Chem import MACCSkeys
2222
from rdkit.Chem.Fingerprints import FingerprintMols
2323

24-
from pipelines_utils_rdkit import filter, rdkit_utils
24+
from pipelines_utils_rdkit import filter, rdkit_utils, mol_utils
2525
from pipelines_utils import parameter_utils, utils
2626

2727
### start field name defintions #########################################
@@ -131,7 +131,7 @@ def main():
131131
i +=1
132132
if mol is None: continue
133133
if args.fragment:
134-
mol = filter.fragment(mol, args.fragment, quiet=args.quiet)
134+
mol = mol_utils.fragment(mol, args.fragment, quiet=args.quiet)
135135
if not filter.filter(mol, minHac=args.hacmin, maxHac=args.hacmax, minMw=args.mwmin, maxMw=args.mwmax, quiet=args.quiet):
136136
continue
137137
targetFp = descriptor(mol)

0 commit comments

Comments
 (0)