changeset 6:8d76e8616839 draft

planemo upload commit 28852b9b524b2b3ec85d6e85bc30f82593cb026c
author tduigou
date Thu, 20 Apr 2023 12:30:18 +0000
parents d31587621543
children 0a25e8aaad7c
files README.md config/job_conf.xml config/tool_conf.xml retropath2.xml retropath2_wrapper.xml
diffstat 5 files changed, 152 insertions(+), 140 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md	Thu Apr 20 12:30:18 2023 +0000
@@ -0,0 +1,34 @@
+# RetroPath2-wrapper -- Build a reaction network from a set of source compounds to a set of sink compounds.
+
+The open-source software package RetroPath2-wrapper is available here : https://github.com/brsynth/RetroPath2-wrapper
+
+## How to run RetroPath2 wrapper tests
+
+In order to execute tests on RetroPath2 wrapper, you need to:
+
+  - Connect to your galaxy instance in interactive mode:
+
+  ```bash
+    docker exec -it -u root galaxy_galaxy_1 bash
+  ```
+  - Copy all the contents of `test-data` folder into your own test-data directory which is located in your local galaxy instance : `/galaxy/test-data`. It contains all the input files and expected output files needed for the tests.
+
+  - Install Planemo:
+  You can see here the documentation for Planemo Installation : https://planemo.readthedocs.io/en/latest/installation.html
+  Note that they recommand to install Planemo by setting up a virtual environment:
+
+  ```bash
+  python3 -m venv planemo
+  . planemo/bin/activate
+  pip install -U planemo
+  ```
+
+  - run the tests:
+
+  ```bash
+  planemo test --conda_channels conda-forge,brsynth --conda_debug tools/BRSynthTools/RetroPath2-wrapper/wrap.xml
+  ```
+
+  IMPORTANT: Maybe you will need to remove CONDA from your PATH for the command `planemo test` to run correctly. To do that, you can edit this file `~/.bashrc`, comment this line `PATH="/root/anaconda3/bin:$PATH"` and save changes.
+
+  Planemo will output an html test summary `tool_test_output.html`.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/job_conf.xml	Thu Apr 20 12:30:18 2023 +0000
@@ -0,0 +1,1 @@
+    <tool id="retropath2_wrapper" destination="local" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/tool_conf.xml	Thu Apr 20 12:30:18 2023 +0000
@@ -0,0 +1,3 @@
+  <section id="sbc-rs" name="SynBioCAD RetroSynthesis">
+    <tool file="synbiocad-galaxy-wrappers/retropath2_wrapper/retropath2_wrapper.xml" />
+  </section>
--- a/retropath2.xml	Wed Sep 21 12:49:42 2022 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-<tool id="retropath2_wrapper" name="RetroPath2.0" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
-    <description>Build a reaction network from a set of source compounds to a set of sink compounds</description>
-    <macros>
-        <token name="@VERSION_SUFFIX@">0</token>
-        <token name="@TOOL_VERSION@">2.3.1</token>
-    </macros>
-    <requirements>
-        <requirement type="package" version="@TOOL_VERSION@">retropath2_wrapper</requirement>
-    </requirements>
-    <stdio>
-        <exit_code range="1" level="fatal" description="Cannot find source-in-sink file" />
-        <exit_code range="2" level="fatal" description="Running the RetroPath2.0 Knime program produced an OSError" />
-        <exit_code range="3" level="fatal" description="The InChI string is malformed" />
-        <exit_code range="-1" level="warning" description="Source has been found in the sink" />
-        <exit_code range="-2" level="warning" description="RetroPath2.0 has found no solution" />
-        <exit_code range="-3" level="warning" description="Time limit reached" />
-    </stdio>
-    <command detect_errors="exit_code"><![CDATA[
-        python -m retropath2_wrapper
-            '$sinkfile'
-            '$rulesfile'
-            out
-            --source_inchi '$source_inchi'
-            --source_name '$source_name'
-            --rp2_version '$adv.version'
-            --max_steps '$max_steps'
-            --topx '$adv.topx'
-            --dmin '$adv.dmin'
-            --dmax '$adv.dmax'
-            --mwmax_source '$adv.mwmax_source'
-            --timeout '$adv.timeout' &&
-        if compgen -G 'out/*_scope.csv' > /dev/null; then
-            cp out/*_scope.csv '$Reaction_Network';
-        else
-            cp out/results.csv '$Reaction_Network';
-        fi
-    ]]></command>
-    <inputs>
-        <param name="rulesfile" type="data" format="csv,tar" label="Rules File" help="File containing reaction rules which reflect the enzymatic potential of the chassis organism."/>
-        <param name="sinkfile" type="data" format="csv" label="Sink File" help=" Sink file which comprises all compounds that are considered as granted in your system."/>
-        <param name="source_inchi" type="text" label="Source InChI" optional="false" help="InChI of compound to produce.">
-            <validator type="empty_field" message="You must provide the InChI string"/>
-        </param>
-        <param name="max_steps" type="integer" value="3" min="1" max="10" label="Maximal Pathway length" help="The maximal number of metabolic steps (i.e. reactions) for exploring around the target."/>
-        <param name="source_name" type="text" value="target" optional="true" label="Source name" help="Name of compound to produce.">
-            <validator type="empty_field" message="Source name is required."/>
-        </param>
-        <section name="adv" title="Advanced Options" expanded="false">
-            <param name="version" type="select" label="Workflow version" help="Retropath2.0 Workflow versions, formatted as 'r{year}{month}{day}' (the latest version 'r20220104' is used by default).">
-                <option value="v9">v9</option>
-                <option value="r20210127">r20210127</option>
-                <option value="r20220104" selected="true">r20220104</option>
-            </param>
-            <param name="topx" type="integer" value="100" min="1" max="1000" label="TopX" help="The maximal number of intermediate compounds to use as new starting points for a next iteration of the retrosynthesis algorithm." />
-            <param name="dmin" type="integer" value="0" min="0" max="1000" label="Minimum rule diameter" help="Minimum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules." />
-            <param name="dmax" type="integer" value="1000" min="0" max="1000" label="Maximum rule diameter" help="Maximum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules."/>
-            <param name="mwmax_source" type="integer" value="1000" min="0" max="2000" label="Molecular weight of source (Da)" help="The molecular weight cutoff (in Da), above which initial source (ie target) and intermediate compounds will be filtered out." />
-            <param name="timeout" type="integer" value="60" min="30" max="600" label="Timeout (min)" help="Maximal time of RetroPath2.0 execution (60 minutes by default)." />
-        </section>
-    </inputs>
-    <outputs>
-        <data name="Reaction_Network" format="csv" label="${tool.name}" >
-            <actions>
-                <action name="column_names" type="metadata" default="Initial source,Transformation ID,Reaction SMILES,Substrate SMILES,Substrate InChI,Product SMILES,Product InChI,In Sink,Sink name,Diameter,Rule ID,EC number,Score,Starting Source SMILES,Iteration" />
-            </actions>
-        </data>
-    </outputs>
-    <tests>
-        <test>
-        <!-- test 1: check if identical outputs are produced with default parameters  -->
-            <param name="rulesfile" value="rules.csv" />
-            <param name="sinkfile" value="sink.csv" />
-            <param name="source_inchi" value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3/b12-11+,25-15+,26-16+,31-17+,32-18+,35-21+,36-22+,37-27+,38-28+,39-29+,40-30+" />
-            <output name="Reaction_Network" file="results_retropath2.csv" ftype="csv" compare="diff"/>
-        </test>
-    </tests> 
-    <help><![CDATA[
-Retropath2.0 wrapper
-====================
-
-
-Perform retrosynthesis search of possible metabolic routes between a source molecule and a collection of sink molecules. This tool is an implementation of the `KNIME retropath2.0 workflow <https://www.myexperiment.org/workflows/4987.html>`_. It 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 produce a retrosynthesis network as a CSV file providing reactions in the reaction SMILES format and chemicals in both SMILES and InChI formats along with other information like the score for each reaction. Only a single source molecule is processed at this time.
-
-Input
------
-
-Required:
-
-* **Sink File**\ : (string) Sink file which comprises all compounds that are considered as granted in your system.
-* **Source InChI**\ : (string) InChI of compound to produce.
-* **Source name**\ : (string) Name of compound to produce.
-* **Maximal Pathway length**\ : (integer) The maximal number of metabolic steps (i.e. reactions) for exploring around the target.
-* **Rules File**\ : (string) File containing reaction rules which reflect the enzymatic potential of the chassis organism.
-
-
-Advanced options:
-
-* **TopX**\ : (integer, default: 100) The maximal number of intermediate compounds to use as new starting points for a next iteration of the retrosynthesis algorithm.
-* **Minimum rule diameter**\ : (integer, default: 0) Minimum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules.
-* **Maximum rule diameter**\ : (integer, default: 1000) Maximum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules.
-* **Molecular weight of source (Da)**\ : (integer, default: 1000) The molecular weight cutoff (in Da), above which initial source (ie target) and intermediate compounds will be filtered out.
-* **Timeout (min)**\ : (integer, default: 60) Maximal time of RetroPath2.0 execution (60 minutes by default)
-* **Workflow version**\ : Retropath2.0 Workflow versions, formatted as r{year}{month}{day} (the latest version r20220104 is used by default)
-
-Output
-------
-
-* **Reaction Network**\ : CSV file containing retrosynthesis network which provides reactions in the reaction SMILES format and chemicals in both SMILES and InChI formats along with other information like the score for each reaction.
-
-Project Links
----------------------
-
-* `GitHub <https://github.com/brsynth/RetroPath2-wrapper>`_
-
-Version
-----------
-
-2.3.1
-
-Authors
--------
-
-* **Joan Hérisson**
-* Melchior du Lac
-
-License
--------
-
-This project is licensed under the `MIT <https://github.com/brsynth/RetroPath2-wrapper/blob/master/LICENSE>`_ License.
-
-Acknowledgments
----------------
-
-* Thomas Duigou
-
-    ]]></help>
-    <citations>
-        <citation type="doi">10.1016/j.ymben.2017.12.002 </citation>
-    </citations>
-</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/retropath2_wrapper.xml	Thu Apr 20 12:30:18 2023 +0000
@@ -0,0 +1,114 @@
+<tool id="retropath2_wrapper" name="RetroPath2.0" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09" license="MIT">
+    <description>Build a reaction network from a set of source compounds to a set of sink compounds</description>
+    <macros>
+        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@TOOL_VERSION@">3.0.1</token>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">retropath2_wrapper</requirement>
+    </requirements>
+    <stdio>
+        <exit_code range="1" level="fatal" description="Cannot find source-in-sink file" />
+        <exit_code range="2" level="fatal" description="Running the RetroPath2.0 Knime program produced an OSError" />
+        <exit_code range="3" level="fatal" description="The InChI string is malformed" />
+        <exit_code range="-1" level="warning" description="Source has been found in the sink" />
+        <exit_code range="-2" level="warning" description="RetroPath2.0 has found no solution" />
+        <exit_code range="-3" level="warning" description="Time limit reached" />
+    </stdio>
+    <command detect_errors="exit_code"><![CDATA[
+        python -m retropath2_wrapper
+            '$sinkfile'
+            '$rulesfile'
+            out
+            --source_inchi '$source_inchi'
+            --source_name '$source_name'
+            --rp2_version '$adv.version'
+            --max_steps '$max_steps'
+            --topx '$adv.topx'
+            --dmin '$adv.dmin'
+            --dmax '$adv.dmax'
+            --mwmax_source '$adv.mwmax_source'
+            --kinstall "\${TMPDIR:-.}"
+            --msc_timeout '$adv.timeout' &&
+        if compgen -G 'out/*_scope.csv' > /dev/null; then
+            cp out/*_scope.csv '$Reaction_Network';
+        else
+            cp out/results.csv '$Reaction_Network';
+        fi
+    ]]></command>
+    <inputs>
+        <param name="rulesfile" type="data" format="csv,tar" label="Rules File" help="File containing reaction rules which reflect the enzymatic potential of the chassis organism."/>
+        <param name="sinkfile" type="data" format="csv" label="Sink File" help=" Sink file which comprises all compounds that are considered as granted in your system."/>
+        <param name="source_inchi" type="text" label="Source InChI" optional="false" help="InChI of compound to produce.">
+            <validator type="empty_field" message="You must provide the InChI string"/>
+        </param>
+        <param name="max_steps" type="integer" value="3" min="1" max="10" label="Maximal Pathway length" help="The maximal number of metabolic steps (i.e. reactions) for exploring around the target."/>
+        <param name="source_name" type="text" value="target" optional="true" label="Source name" help="Name of compound to produce.">
+            <validator type="empty_field" message="Source name is required."/>
+        </param>
+        <section name="adv" title="Advanced Options" expanded="false">
+            <param name="version" type="select" label="Workflow version" help="Retropath2.0 Workflow versions, formatted as 'r{year}{month}{day}' (the latest version 'r20220104' is used by default).">
+                <option value="v9">v9</option>
+                <option value="r20210127">r20210127</option>
+                <option value="r20220104" selected="true">r20220104</option>
+            </param>
+            <param name="topx" type="integer" value="100" min="1" max="1000" label="TopX" help="The maximal number of intermediate compounds to use as new starting points for a next iteration of the retrosynthesis algorithm." />
+            <param name="dmin" type="integer" value="0" min="0" max="1000" label="Minimum rule diameter" help="Minimum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules." />
+            <param name="dmax" type="integer" value="1000" min="0" max="1000" label="Maximum rule diameter" help="Maximum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules."/>
+            <param name="mwmax_source" type="integer" value="1000" min="0" max="2000" label="Molecular weight of source (Da)" help="The molecular weight cutoff (in Da), above which initial source (ie target) and intermediate compounds will be filtered out." />
+            <param name="timeout" type="integer" value="60" min="30" max="600" label="Timeout (min)" help="Maximal time of RetroPath2.0 execution (60 minutes by default)." />
+        </section>
+    </inputs>
+    <outputs>
+        <data name="Reaction_Network" format="csv" label="${tool.name}" >
+            <actions>
+                <action name="column_names" type="metadata" default="Initial source,Transformation ID,Reaction SMILES,Substrate SMILES,Substrate InChI,Product SMILES,Product InChI,In Sink,Sink name,Diameter,Rule ID,EC number,Score,Starting Source SMILES,Iteration" />
+            </actions>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+        <!-- test 1: check if identical outputs are produced with default parameters  -->
+            <param name="rulesfile" value="rules.csv" />
+            <param name="sinkfile" value="sink.csv" />
+            <param name="source_inchi" value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3/b12-11+,25-15+,26-16+,31-17+,32-18+,35-21+,36-22+,37-27+,38-28+,39-29+,40-30+" />
+            <output name="Reaction_Network" file="results_retropath2.csv" ftype="csv" compare="diff"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+Retropath2.0 wrapper
+====================
+
+
+Perform retrosynthesis search of possible metabolic routes between a source molecule and a collection of sink molecules. This tool is an implementation of the `KNIME retropath2.0 workflow <https://www.myexperiment.org/workflows/4987.html>`_. It 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 produce a retrosynthesis network as a CSV file providing reactions in the reaction SMILES format and chemicals in both SMILES and InChI formats along with other information like the score for each reaction. Only a single source molecule is processed at this time.
+
+Input
+-----
+
+Required:
+
+* **Sink File**\ : (string) Sink file which comprises all compounds that are considered as granted in your system.
+* **Source InChI**\ : (string) InChI of compound to produce.
+* **Source name**\ : (string) Name of compound to produce.
+* **Maximal Pathway length**\ : (integer) The maximal number of metabolic steps (i.e. reactions) for exploring around the target.
+* **Rules File**\ : (string) File containing reaction rules which reflect the enzymatic potential of the chassis organism.
+
+
+Advanced options:
+
+* **TopX**\ : (integer, default: 100) The maximal number of intermediate compounds to use as new starting points for a next iteration of the retrosynthesis algorithm.
+* **Minimum rule diameter**\ : (integer, default: 0) Minimum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules.
+* **Maximum rule diameter**\ : (integer, default: 1000) Maximum rule diameter of the sphere including the atoms around the reacting center. The higher is the diameter, the more specific are the rules.
+* **Molecular weight of source (Da)**\ : (integer, default: 1000) The molecular weight cutoff (in Da), above which initial source (ie target) and intermediate compounds will be filtered out.
+* **Timeout (min)**\ : (integer, default: 60) Maximal time of RetroPath2.0 execution (60 minutes by default)
+* **Workflow version**\ : Retropath2.0 Workflow versions, formatted as r{year}{month}{day} (the latest version r20220104 is used by default)
+
+Output
+------
+
+* **Reaction Network**\ : CSV file containing retrosynthesis network which provides reactions in the reaction SMILES format and chemicals in both SMILES and InChI formats along with other information like the score for each reaction.
+    ]]></help>
+    <citations>
+        <citation type="doi">10.1016/j.ymben.2017.12.002 </citation>
+    </citations>
+</tool>