Implementation of the KNIME retropath2.0 workflow. Takes for input the minimal (dmin) and maximal (dmax) diameter for the reaction rules and the maximal path length (maxSteps). The tool expects the following files: rules.csv, sink.csv and source.csv and produces results in an output folder.
- Python 3
- KNIME (code was tested on
4.6.4,4.7.0versions)
The conda package manager is required. Fresh instructions on how to install conda are available online.
The tool tries to install the KNIME Anlytical Platform as well as the RetroPath2.0 node dependancies.
Install in the <my_env> conda environment:
conda install -c conda-forge -n <my_env> retropath2_wrapperDisclaimer: we recommand to provide absolute path to files, problems can arise with relative paths.
python -m retropath2_wrapper <sink-file> <rules-file> <out-dir> --source_file <source-file>The minimal required arguments are sink_file, source_file, rules_file and outdir.
from retropath2_wrapper import retropath2
r_code = retropath2(
sink_file='/path/to/sink/file',
source_file='/path/to/source/file',
rules_file='/path/to/rules/file',
outdir='/path/to/outdir'
)Exploration settings have default values and can be tuned:
from retropath2_wrapper import retropath2
r_code = retropath2(
sink_file='/path/to/sink/file',
source_file='/path/to/source/file',
rules_file='/path/to/rules/file',
outdir='/path/to/outdir',
max_steps=3,
topx=100,
dmin=0,
dmax=100,
mwmax_source=1000,
)Already installed KNIME app can hence be used that way, eg:
from retropath2_wrapper import retropath2
from retropath2_wrapper.knime import Knime
knime = Knime(
kinstall="/path/to/knime/directory",
workflow="/path/to/workflow",
)
r_code = retropath2(
sink_file='/path/to/sink/file',
source_file='/path/to/source/file',
rules_file='/path/to/rules/file',
outdir='/path/to/outdir'
knime=knime,
)Executions can be timed out using the timeout arguments (in minutes).
retropath2() function returns one of the following codes:
- 0: No error
- 1: File is not found
- 2: Running the RetroPath2.0 Knime program produced an OSError
- 3: InChI is malformated
- 4: Sink file is malformed
- 10: Source has been found in the sink (warning)
- 11: No solution is found (warning)
Test can be run with the following commands:
conda install -c conda-forge pytest
python -m pytest testsTo run functional tests, the environment variable RP2_FUNCTIONAL=TRUE is required.
Available options:
- You provide a path of the Knime root directory through the argument
--kinstall. You need to have the following libraries installed:org.knime.features.chem.types.feature.group,org.knime.features.datageneration.feature.group,org.knime.features.python.feature.group,org.rdkit.knime.feature.feature.group retropath2_wrapperwill install Knime for you, at the root of the python package, by downloading the softwares available on Zenodo. You can choose a version among4.6.4or4.7.0. Optionally, you can locate a path for the installation. If an executable is found in the path, Knime will not be reinstalled.
python -m retropath2_wrapper.knime online \
--kinstall "/path/to/knime/root/dir" \
--kver {4.6.4,4.7.0}Knime software and packages are available at:
All files from these repositories can be downloaded through the Download all button:
python -m retropath2_wrapper.knime local \
--kinstall "/path/to/knime/root/dir" \
--zenodo-zip "/path/to/7515771.zip"- Could not load native RDKit library, libfreetype.so.6: cannot open shared object file
Some Knime versions (like: 4.3.0) or environments can't load RDKit library.
You need to append the
$CONDA_PREFIX/libpath to theLD_LIBRARY_PATHvariable where thelibfreetypelibrary is available:
conda activate <env_name>
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_PREFIX/lib"For further tests and development tools, a CI toolkit is provided in cicd-toolkit folder (see cicd-toolkit/README.md).
Please cite:
Delépine B, Duigou T, Carbonell P, Faulon JL. RetroPath2.0: A retrosynthesis workflow for metabolic engineers. Metabolic Engineering, 45: 158-170, 2018. DOI: https://doi.org/10.1016/j.ymben.2017.12.002