Skip to content

Commit

Permalink
fix problem with moved fragment method. Added instructions for runnin…
Browse files Browse the repository at this point in the history
…g tests with conda.
  • Loading branch information
tdudgeon committed Jan 27, 2020
1 parent 915dcef commit d90125b
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 5 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,34 @@ playbooks.
`Posting Squonk pipelines` section of Squonk's OpenShift Ansible
[README](https://github.com/InformaticsMatters/squonk/blob/master/openshift/ansible/README.md).

## Running tests

The test running is in the pipelines-utils repo and tests are run from there.
For full details consult that repo.

But as a quick start you should be able to run the the tests in a conda environment like this:

Create a conda environment containing RDKit:
```
conda env create -f environment-rdkit.yml
```

Move into the `pipelines-utils` repo (this should be alongside `pipelines` and `pipelines-utils-rdkit`):
```
cd ../pipleines-utils
```

Set your `PYTHONPATH` environment variable to include the `pipelines-utils` and `pipelines-utils-rdkit` sources
(adjusting `/path/to/` to whatever is needed):
```
export PYTHONPATH=/path/to/pipelines-utils/src/python:/path/to/pipelines-utils-rdkit/src/python
```

Run tests:
```
./gradlew runPipelineTester -Pptargs=-opipelines
```

## Contact

Any questions contact:
Expand Down
11 changes: 11 additions & 0 deletions environment-rdkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pipelines
channels:
- conda-forge
dependencies:
- python=3.6
- pip=20.0.2
- rdkit=2019.09.2
- pip:
- matplotlib==2.2.*
- molvs==0.1.1
- standardiser==0.1.9
1 change: 1 addition & 0 deletions src/python/pipelines/dimorphite/enumerate_charges.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def add_src_mol_ref(src_mol, target_mol, index):
:param index:
:return:
"""
parent = None
if src_mol.HasProp('uuid'):
parent = src_mol.GetProp('uuid')
elif src_mol.HasProp('_name_'):
Expand Down
2 changes: 1 addition & 1 deletion src/python/pipelines/dimorphite/enumerate_charges.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version = 1,

// Testing cluster_butina.py reading from STDIN and writing to STDOUT
test_raw_cluster_butina_from_sdf_to_default = [
test_dimorphite_simple = [

command: '''gunzip -c ${PIN}Kinase_inhibs.sdf.gz |
python -m pipelines.dimorphite.enumerate_charges -if sdf''',
Expand Down
4 changes: 2 additions & 2 deletions src/python/pipelines/rdkit/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from rdkit.Chem import MACCSkeys
from rdkit.Chem.Fingerprints import FingerprintMols

from pipelines_utils_rdkit import filter, rdkit_utils
from pipelines_utils_rdkit import filter, rdkit_utils, mol_utils
from pipelines_utils import parameter_utils, utils

### start field name defintions #########################################
Expand Down Expand Up @@ -99,7 +99,7 @@ def main():
i +=1
if mol is None: continue
if args.fragment:
mol = filter.fragment(mol, args.fragment, quiet=args.quiet)
mol = mol_utils.fragment(mol, args.fragment, quiet=args.quiet)
if not filter.filter(mol, minHac=args.hacmin, maxHac=args.hacmax, minMw=args.mwmin, maxMw=args.mwmax, quiet=args.quiet):
continue
target_fp = descriptor(mol)
Expand Down
19 changes: 19 additions & 0 deletions src/python/pipelines/rdkit/screen.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@

],

// Testing screen.py reading and writing files using sdf with --fragment argument
test_screen_fragment = [

command: '''python -m pipelines.rdkit.screen
-i ${PIN}dhfr_3d.sdf.gz -o ${POUT}output -of sdf
--qsmiles 'C1N=C(C2=CC=CC=C2)C2=CC=CC=C2C2=C1C=NC(NC1=CC=CC=C1)=N2'
--simmin 0.45 -if sdf --meta --fragment hac''',

stderr: [ 'Found [1-9]\\d+ similar molecules' ],

creates: [ 'output.sdf.gz',
'output_metrics.txt' ],

metrics: [ 'RDKitScreen': '756',
'__InputCount__': '756',
'__OutputCount__': '[1-9]\\d+' ],

],

// Testing screen.py reading and writing files using json
test_nci100_data_json = [

Expand Down
4 changes: 2 additions & 2 deletions src/python/pipelines/rdkit/screen_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from rdkit.Chem import MACCSkeys
from rdkit.Chem.Fingerprints import FingerprintMols

from pipelines_utils_rdkit import filter, rdkit_utils
from pipelines_utils_rdkit import filter, rdkit_utils, mol_utils
from pipelines_utils import parameter_utils, utils

### start field name defintions #########################################
Expand Down Expand Up @@ -131,7 +131,7 @@ def main():
i +=1
if mol is None: continue
if args.fragment:
mol = filter.fragment(mol, args.fragment, quiet=args.quiet)
mol = mol_utils.fragment(mol, args.fragment, quiet=args.quiet)
if not filter.filter(mol, minHac=args.hacmin, maxHac=args.hacmax, minMw=args.mwmin, maxMw=args.mwmax, quiet=args.quiet):
continue
targetFp = descriptor(mol)
Expand Down

0 comments on commit d90125b

Please sign in to comment.