Mercurial > repos > tduigou > rrparser
changeset 0:0b6d6980cad1 draft
Uploaded
| author | tduigou |
|---|---|
| date | Wed, 07 Jul 2021 09:18:49 +0000 |
| parents | |
| children | 8b015a6bcbbc |
| files | rrparser/rrparser.xml rrparser/test-data/rules.csv.gz |
| diffstat | 2 files changed, 119 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rrparser/rrparser.xml Wed Jul 07 09:18:49 2021 +0000 @@ -0,0 +1,119 @@ +<tool id="rrparser" name="RRules Parser" version="2.4.0"> + <description>Reaction Rules Parser</description> + <requirements> + <requirement type="package">rrparser</requirement> + </requirements> + <stdio> + <regex match="WARNING:" level="warning" /> + <regex match="ERROR:" level="fatal" /> + </stdio> + <command detect_errors="exit_code"><![CDATA[ + python -m rrparser + #if str($rules.type) != "other": + retrorules + --rule-type '$rules.type' + #else: + '$rules.file' + --input-format '$rules.format' + #end if + --diameters '$diameters' + --output-format csv + #if str($compress) == "true": + --outfile '$output'.csv.gz ; + mv '$output'.csv.gz '$output' + #else: + --outfile '$output' + #end if + ]]></command> + <inputs> + <conditional name="rules"> + <param name="type" optional="True" type="select" label="Rule Type" help=""> + <option value="retro" selected="True">RetroRules (retro)</option> + <option value="forward">RetroRules (forward)</option> + <option value="all">RetroRules (all)</option> + <option value="other">Other reaction rules...</option> + </param> + <when value="other"> + <param name="file" optional="False" type="data" format="csv" label="Rules File"/> + <param name="format" optional="False" type="select" label="File format"> + <option value="csv" selected="True">csv</option> + <option value="tsv">tsv</option> + </param> + </when> + <when value="retro|forward|all"> + <param name="file" optional="True" type="data" format="csv" label="Rules File"/> + </when> + </conditional> + <param name="diameters" type="select" display="checkboxes" multiple="True" label="Select the diameters of the reactions rules"> + <option selected="true" value="2">2</option> + <option selected="true" value="4">4</option> + <option selected="true" value="6">6</option> + <option selected="true" value="8">8</option> + <option selected="true" value="10">10</option> + <option selected="true" value="12">12</option> + <option selected="true" value="14">14</option> + <option selected="true" value="16">16</option> + </param> + <param name="compress" type="boolean" display="checkboxes" label="Compress output" /> + </inputs> + <outputs> + <data name="output" format="csv" label="${tool.name} - ${rules.type} - d=$diameters" > + <change_format> + <when input="compress" value="true" format="csv.gz"/> + </change_format> + </data> + </outputs> + <tests> + <test> + <!-- test 1: check if identical outputs are produced with compress option --> + <param name="compress" value="True" /> + <output name="output" file="rules.csv.gz" compare="diff" decompress="True"/> + </test> + </tests> + <help><![CDATA[ +RRulesParser +============ + +Retrieve the reaction rules from `RetroRules <https://retrorules.org/>`_ + +Input +----- + +* **rules-file**: (string) Filename of reaction rules +* **input-format**: (string) Valid options: csv, tsv. Format of the input file +* **rule-type**: (string) Valid options: retro, forward, all. Return the rules that are in reverse, forward or both direction +* **diameters**: (integer list) Valid options: 2, 4, 6, 8, 10, 12, 14, 16. The diameter of the rules to return +* **outdir**: (string) Path where output files will be written +* **outfile**: (string) Path where output files will be written +* **output-format**: (string) Valid options: csv, tar.gz. Format of the returned file + +Ouput +----- + +* **output**: (string): Path of the output file. Either a compressed tar.gz (containing a csv) or csv list of reaction rules that are in a RetroPath2.0 friendly format + + +Version +------- + +v2.4.0 + +Authors +------- + +* **Thomas Duigou** +* Melchior du Lac +* Joan Hérisson + +License +------- + +This project is licensed under the MIT License - see the `LICENSE <LICENSE>`_ file for details + +Acknowledgments +--------------- + +* Joan Hérisson + + ]]></help> +</tool> \ No newline at end of file
