Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Commit 982b26d

Browse files
committed
Substantial update that includes unit tests and moves logic to reinvent_models, reinvent_scoring and reinvent_chemistry libraries. LibINVENT running mode is included.REINVENT 3 becomes incompatible with REINVENT v 2.0 generative models. New models are provided in Reinvent Community. Contents of data folder are moved to Reinvent Community.
1 parent 6071337 commit 982b26d

File tree

197 files changed

+4771
-1444336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+4771
-1444336
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package.json
55
tags
66
.idea
77
/configs/config.json
8+
README_internal.md
89

910
# Coverage.py output
1011
.coverage

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "priors"]
2+
path = priors
3+
url = https://bitbucket.astrazeneca.net/scm/~kdmz924/reinvent-priors.git

LICENSE

-21
This file was deleted.

README.md

+67-51
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,81 @@
1-
REINVENT 3.0 - beta
2-
=======================================================================================
3-
4-
NOTE
5-
-----
6-
The code is still undergoing changes and the provided input examples might not be up-to date yet.
7-
We will try to get this up to date as soon as we can.
1+
REINVENT 3.0
2+
=================================================================================================================
83

94

10-
__In the meantime, when in doubt, ask!__
11-
12-
Usage
13-
-----
14-
15-
1. Sample inputs are provided in reinvent/configs/sample_inputs folder.
5+
Installation
6+
-------------
167

17-
2. (Recommended) Use jupyter notebooks in `Reinvent Community` repo to generate inputs.
8+
1. Install [Conda](https://conda.io/projects/conda/en/latest/index.html)
9+
2. Clone this Git repository
10+
3. Open a shell, and go to the repository and create the Conda environment:
11+
12+
$ conda env create -f reinvent.yml
1813

19-
-------------------------------------------------
20-
To use Tensorboard for logging:
14+
4. Activate the environment:
15+
16+
$ conda activate reinvent.v3.0
2117

22-
1. To launch Tensorboard, write:
23-
tensorboard --logdir "path to your log output directory" --port=8008.
24-
This will give you an address to copy to a browser and access to the graphical summaries from Tensorboard.
18+
5. Use the tool.
2519

26-
2. Further commands to Tensorboard to change the amount of scalars,histograms, images, distributions and graphs shown
27-
can be done as follows:
28-
--samples_per_plugin=scalar=700, images=20
20+
2921

30-
Installation
22+
Tutorials / `jupyter` notebooks
3123
-----
24+
There is another repository containing useful `jupyter` notebooks related to `REINVENT`
25+
called [ReinventCommunity](https://github.com/MolecularAI/ReinventCommunity). Note, that it uses a
26+
different `conda` environment to execute, so you have to set up a separate environment.
3227

33-
1. Install Anaconda / Miniconda
34-
2. Clone the repository
35-
3. (Optional) Checkout the appropriate branch of the repository and create a new local branch tied to the remote one, e.g.:
36-
git checkout --track origin/reinvent.3.0
37-
4. Open terminal, go to the repository and generate the appropriate environment:
38-
conda env create -f reinvent_shared.yml
39-
Hint: Use the appropriate `conda` binary. You might want to check, whether you succeeded:
40-
conda info --envs
41-
5. Since there are components that use OpenEye libraries, if you intend to use them you will need to set the environmental variable OE_LICENSE to activate the oechem license. One way to do this and keep it conda environment specific is:
42-
On the command line, first:
43-
44-
cd $CONDA_PREFIX
45-
mkdir -p ./etc/conda/activate.d
46-
mkdir -p ./etc/conda/deactivate.d
47-
touch ./etc/conda/activate.d/env_vars.sh
48-
touch ./etc/conda/deactivate.d/env_vars.sh
49-
50-
then edit ./etc/conda/activate.d/env_vars.sh as follows:
5128

52-
#!/bin/sh
53-
export OE_LICENSE='<path to OpenEye license file>'
54-
55-
and finally, edit ./etc/conda/deactivate.d/env_vars.sh :
29+
Usage
30+
-----
5631

57-
#!/bin/sh
58-
unset OE_LICENSE
59-
6. Activate environment (or set it in your GUI)
60-
7. In the project directory, in ./configs/ create the file `config.json` by copying over `example.config.json` and editing as required
32+
For concrete examples, you can check out the Jupyter notebook examples in the ReinventCommunity repo.
33+
Running each example will result in a template file.There are templates for many running modes.
34+
Each running mode can be executed by `python input.py some_running_mode.json` after activating the environment.
35+
36+
Templates can be manually edited before using. The only thing that needs modification for a standard run are the file
37+
and folder paths. Most running modes produce logs that can be monitored by `tensorboard`.
6138

6239

63-
Tests
40+
Tests
6441
-----
65-
Currently all tests are excluded form this repository.
42+
The REINVENT project uses the `unittest` framework for its tests; before you run them you first have to create a
43+
configuration, which the tests will use.
44+
45+
In the project directory, create a `config.json` file in the `configs/` directory; you can use the example
46+
config (`example.config.json`) as a base. Make sure that you set `MAIN_TEST_PATH` to a non-existent directory; it
47+
is where temporary files will be written during the tests; if it is set to an existing directory, that directory
48+
will be removed once the tests have finished.
49+
50+
Some tests require a proprietary OpenEye license; you have to set up a few things to make the tests read your
51+
license. The simple way is to just set the `OE_LICENSE` environment variable to the path of the file containing the
52+
license. If you just want to set the license in the `reinvent_scoring` Conda environment, it is a bit more complicated,
53+
but you only have to do it once.
54+
55+
```
56+
(reinvent-scoring) $ cd $CONDA_PREFIX
57+
$ mkdir -p etc/conda/activate.d
58+
$ mkdir -p etc/conda/deactivate.d
59+
```
60+
61+
Put the following in `etc/conda/activate.d/env_vars.sh`.
62+
63+
```
64+
#!/bin/sh
65+
export OE_LICENSE='</path/to/your/oe_license/file>'
66+
```
67+
68+
And put the following in `etc/conda/deactivate.d/env_vars.sh`.
69+
70+
```
71+
#!/bin/sh
72+
unset OE_LICENSE
73+
```
74+
75+
Once you have created the files, deactivate and re-activate the environment, and `echo $OE_LICENSE` should output the
76+
path to the license file.
77+
Once you have a configuration and your license can be read, you can run the tests.
78+
79+
```
80+
$ python main_test.py
81+
```

0 commit comments

Comments
 (0)