view retropath2.xml @ 3:8e56fc458ca5 draft

"planemo upload commit 2f1af427fa4c4f2aad53ab94c4cdb51456c66019-dirty"
author tduigou
date Mon, 07 Feb 2022 15:24:09 +0000
parents 8a04f97b785d
children 9c8ac9980bd6
line wrap: on
line source

<tool id="retropath2" name="RetroPath2.0" version="@TOOL_VERSION@" profile="19.09">
    <description>Build a reaction network from a set of source compounds to a set of sink compounds</description>
    <macros>
        <token name="@TOOL_VERSION@">2.3.0</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">retropath2_wrapper</requirement>
    </requirements>
    <stdio>
        <exit_code range="1" level="fatal" description="Source has been found in the sink" />
        <exit_code range="2" level="fatal" description="Cannot find source-in-sink file" />
        <exit_code range="3" level="fatal" description="Running the RetroPath2.0 Knime program produced an OSError" />
        <exit_code range="4" level="warning" description="RetroPath2.0 has found no solution" />
        <exit_code range="5" level="warning" description="Time limit reached" />
	</stdio>
    <command detect_errors="exit_code"><![CDATA[
        python -m retropath2_wrapper
            '$sinkfile'
            '$rulesfile'
            out
            --source_inchi '$source_inchi_type.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"/>
        <param name="sinkfile" type="data" format="csv" label="Sink File"/>
        <conditional name="source_inchi_type">
            <param name="inchi_type" type="select" label="InChI type">
                <!-- <option value="name" selected="true">By name</option> -->
                <option value="string">By string</option>
            </param>
            <when value="string">
                <param name="source_inchi" type="text" label="Source InChI" optional="false">
                    <validator type="empty_field" message="You must provide the InChI string"/>
                </param>
            </when>
        </conditional>
        <param name="max_steps" type="integer" value="3" min="1" max="10" label="Maximal Pathway length" />
        <param name="source_name" type="text" value="target" optional="true" label="Source name">
            <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">
                <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" />
            <param name="dmin" type="integer" value="0" min="0" max="1000" label="Minimum rule diameter" />
            <param name="dmax" type="integer" value="1000" min="0" max="1000" label="Maximum rule diameter" />
            <param name="mwmax_source" type="integer" value="1000" min="0" max="2000" label="Molecular weight of source (Da)" />
            <param name="timeout" type="integer" value="60" min="30" max="600" label="Timeout (min)" />
        </section>
    </inputs>
    <outputs>
	    <data name="Reaction_Network" format="csv" label="${tool.name}" />
    </outputs>
    <tests>
        <test>
        <!-- test 1: check if identical outputs are produced with default parameters  -->
            <param name="rulesfile" value="rules.csv.gz" />
            <param name="sinkfile" value="sink.csv" />
            <param name="source_inchi" value="InChI=1S/C6H6O4/c7-5(8)3-1-2-4-6(9)10/h1-4H,(H,7,8)(H,9,10)/p-2" />
            <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. Docker 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 docker mounts a local folder and expects the following files: rules.csv, sink.csv and source.csv. We only support a single source molecule at this time.

Input
-----

Required:

* **-sinkfile**\ : (string) Path to the sink file
* **-sourcefile**\ : (string) Path to the source file
* **-max_steps**\ : (integer) Maximal number of steps
* **-rulesfile**\ : (string) Path to the rules file
* **-rulesfile_format**\ : (string) Valid Options: tar, csv. Format of the rules file

The InChI source DB entries are obtained by the following command:

`cat chem_prop.tsv | awk -F'\\t' '{print "\\t\\t\\t\\t\\t<option value=\\""$6"\\"\\>" "["$1"]\\t " $2 "</option>"}' | sed 's/\\&/\\&amp;/g'`

where `chem_prop.tsv` has been downloaded on MetaNetX.

Advanced options:

* **-topx**\ : (integer, default: 100) For each iteration, number of rules
* **-dmin**\ : (integer, default: 0)
* **-dmax**\ : (integer, default: 1000)
* **-mwmax_source**\ : (integer, default: 1000)
* **-timeout**\ : (integer, default: 30) Timeout in minutes

Output
------

* **-scope_csv**\ : (string) Path to the output scope csv file

Authors
-------

* **Joan Hérisson**
* Melchior du Lac

License
-------

This project is licensed under the MIT License.

Acknowledgments
---------------

* Thomas Duigou

    ]]></help>
    <citations>
        <citation type="doi">10.1016/j.ymben.2017.12.002 </citation>
    </citations>
</tool>