diff isolib.xml @ 4:2b1118bce0b1 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/isolib commit e21ab1b7f16bc0a58b33b8e46f828e150372c307
author recetox
date Fri, 01 Nov 2024 08:45:59 +0000
parents b3251a7dae25
children
line wrap: on
line diff
--- a/isolib.xml	Thu May 30 14:52:02 2024 +0000
+++ b/isolib.xml	Fri Nov 01 08:45:59 2024 +0000
@@ -1,5 +1,5 @@
-<tool id="isolib" name="isolib" version="1.0.1+galaxy0" profile="21.09">
-    <description>create an isotopic pattern library for given compounds and adducts</description>
+<tool id="isolib" name="isolib" version="2.6+galaxy0" profile="21.09">
+    <description>create an isotopic pattern library for given compounds and adducts based on enviPat</description>
     <creator>
         <person
             givenName="Helge"
@@ -20,9 +20,23 @@
         <requirement type="package" version="1.6.0">bioconductor-msbackendmsp</requirement>
         <requirement type="package" version="2.6">r-envipat</requirement>
         <requirement type="package" version="2.1.5">r-readr</requirement>
+        <requirement type="package" version="1.3.1">r-tidyr</requirement>
+        <requirement type="package" version="1.5.1">r-stringr</requirement>
+        <requirement type="package" version="1.0.2">r-purrr</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-        Rscript '${__tool_directory__}/isolib.R' '${input_file}' '${ionization.adducts}' '${threshold}' '${append_adduct}' '${isotope_library}'
+        Rscript '${__tool_directory__}/isolib.R'
+            '${input_file}'
+            '${ionization.adducts}'
+            '${threshold}'
+            '${append_adduct}'
+            #if $formatting.out_format == "tabular"
+            '${formatting.append_isotopes}'
+            #else
+            'FALSE'
+            #end if
+            '${formatting.out_format}'
+            '${isotope_library}'
     ]]></command>
     <inputs>
         <param name="input_file" type="data" format="tabular" label="Table with input compounds"/>
@@ -46,9 +60,25 @@
         </conditional>
         <param name="threshold" type="float" min="0" max="100" value="1" label="Threshold" help="Probability threshold to use as cutoff for isotopic pattern distribution - this can be used to remove low abundant peaks and improve computation performance." />
         <param name="append_adduct" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Append adduct to compound name" help="Append the adduct string to the compound name for easy identification." />
+        <conditional name="formatting">
+            <param name="out_format" type="select" label="Output Format" help="Choose the output format, either MSP or Tabular">
+                <option value="tabular">tabular</option>
+                <option value="msp" selected="true">msp</option>
+            </param>
+            <when value="tabular">
+                <param name="append_isotopes" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Append isotopes to formula" help="Append the isotopic composition to the formula for easy identification." />
+            </when>
+            <when value="msp">
+            </when>
+        </conditional>
     </inputs>
     <outputs>
-        <data format="msp" name="isotope_library"/>
+        <data format="msp" name="isotope_library">
+            <change_format>
+                <when input="formatting.out_format" value="msp" format="msp" />
+                <when input="formatting.out_format" value="tabular" format="tabular" />
+            </change_format>
+        </data>
     </outputs>
 
     <tests>
@@ -60,6 +90,18 @@
             <param name="input_file" value="markers_no_rt.tsv"/>
             <output name="isotope_library" file="test1.msp"/>
         </test>
+        <test>
+            <param name="input_file" value="lc_markers_neg.tsv"/>
+            <param name="out_format" value="tabular"/>
+            <param name="append_isotopes" value="TRUE" />
+            <output name="isotope_library" file="test2.tabular"/>
+        </test>
+        <test>
+            <param name="input_file" value="lc_markers_neg.tsv"/>
+            <param name="out_format" value="tabular"/>
+            <param name="adducts" value="M-H,2M-H"/>
+            <output name="isotope_library" file="test3.tabular"/>
+        </test>
     </tests>
     <help><![CDATA[
         This tool computes isotopic patterns for given compounds and adduct forms.