changeset 4:425c0494ec2d draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/waveica commit 84de3bc96ad2859d87c70ba94d8ceb0b2bc2a0da
author recetox
date Tue, 07 May 2024 12:49:20 +0000
parents dbbedb14b44c
children e424fa636281
files macros.xml test-data/normalized_data.csv waveica.xml waveica_wrapper.R
diffstat 4 files changed, 17 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Thu Oct 12 13:45:41 2023 +0000
+++ b/macros.xml	Tue May 07 12:49:20 2024 +0000
@@ -99,7 +99,11 @@
 
     <xml name="outputs">
         <outputs>
-             <data format_source="data" name="normalized_data"/>
+            <data name="normalized_data" format="tsv">
+                <change_format>
+                    <when input_dataset="data" attribute="ext" value="parquet" format="parquet" />
+                </change_format>
+            </data>
         </outputs>
     </xml>
 
--- a/test-data/normalized_data.csv	Thu Oct 12 13:45:41 2023 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-sampleName,class,sampleType,injectionOrder,batch,M85T34,M86T41,M86T518,M86T539
-VT_160120_002,sample,sample,1,1,355200.506508035,75115889.9077485,6101488.54615418,2007379.02604984
-VT_160120_004,sample,sample,2,1,216897.826587868,75204863.1495248,6170882.26270475,2069979.64992079
-VT_160120_006,sample,sample,3,1,362337.195084504,76490295.1450204,12588041.969092,1818589.63912375
-VT_160120_008,sample,sample,4,1,143303.377379009,83771659.9549148,6181538.46316058,1975712.25920485
-VT_160120_010,sample,sample,5,1,189065.516447239,84108898.7658797,6103964.42378424,1935671.32085241
--- a/waveica.xml	Thu Oct 12 13:45:41 2023 +0000
+++ b/waveica.xml	Tue May 07 12:49:20 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="waveica" name="WaveICA" version="@TOOL_VERSION@+galaxy4" python_template_version="3.5">
+<tool id="waveica" name="WaveICA" version="@TOOL_VERSION@+galaxy5" profile="21.09">
     <description>removal of batch effects for untargeted metabolomics data</description>
     <macros>
         <import>macros.xml</import>
@@ -103,7 +103,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.csv"/>
+            <output name="normalized_data" file="normalized_data.tsv" ftype="tsv"/>
         </test>
         <test><!-- TEST 2 -->
             <param name="data" value="input_data.tsv" ftype="tsv"/>
@@ -114,7 +114,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.tsv"/>
+            <output name="normalized_data" file="normalized_data.tsv" ftype="tsv"/>
         </test>
         <test><!-- TEST 3 -->
             <param name="data" value="input_data.parquet" ftype="parquet"/>
@@ -125,7 +125,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.parquet"/>
+            <output name="normalized_data" file="normalized_data.parquet" ftype="parquet"/>
         </test>
         <test><!-- TEST 4 -->
             <param name="input_choice" value="2"/>
@@ -138,7 +138,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.csv"/>
+            <output name="normalized_data" file="normalized_data.tsv" ftype="tsv"/>
         </test>
         <test><!-- TEST 5 -->
             <param name="input_choice" value="2"/>
@@ -151,7 +151,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.tsv"/>
+            <output name="normalized_data" file="normalized_data.tsv" ftype="tsv"/>
         </test>
         <test><!-- TEST 6 -->
             <param name="input_choice" value="2"/>
@@ -164,7 +164,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200"/>
+            <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/>
         </test>
         <test><!-- TEST 7 -->
             <param name="input_choice" value="2"/>
@@ -178,7 +178,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200"/>
+            <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/>
         </test>
         <test><!-- TEST 8 -->
             <param name="input_choice" value="2"/>
@@ -192,7 +192,7 @@
             <param name="t" value="0.05"/>
             <param name="t2" value="0.05"/>
             <param name="alpha" value="0"/>
-            <output name="normalized_data" file="normalized_data.csv"/>
+            <output name="normalized_data" file="normalized_data.tsv" ftype="tsv"/>
         </test>
         <!-- The following test has different results on three platform I've tried -->
         <!-- <test>
--- a/waveica_wrapper.R	Thu Oct 12 13:45:41 2023 +0000
+++ b/waveica_wrapper.R	Tue May 07 12:49:20 2024 +0000
@@ -231,15 +231,13 @@
 }
 
 store_data <- function(data, output, ext) {
-  if (ext == "csv") {
-    write.csv(data, file = output, row.names = FALSE, quote = FALSE)
-  } else if (ext == "tsv") {
+  if (ext == "parquet") {
+    arrow::write_parquet(data, output)
+  } else {
     write.table(data,
       file = output, sep = "\t",
       row.names = FALSE, quote = FALSE
     )
-  } else {
-    arrow::write_parquet(data, sink = output)
   }
   cat("Normalization has been completed.\n")
 }