changeset 10:2d94da58904b draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit dc508ea3521991cd42ff6c1aa8aa845b36412771
author recetox
date Wed, 22 May 2024 08:04:21 +0000
parents d70dd1d6ac4d
children da7722f665f4
files macros.xml ramclustr.xml ramclustr_wrapper.R
diffstat 3 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Wed Apr 17 07:51:23 2024 +0000
+++ b/macros.xml	Wed May 22 08:04:21 2024 +0000
@@ -67,9 +67,9 @@
 
     <xml name="parameters_recetox_aplcms">
         <section name="ms_dataframe" title="Input MS Data as parquet (output from recetox-aplcms)" expanded="true">
-            <param label="Input MS1 featureDefinitions" name="ms1_featureDefinitions" type="data" format="parquet"
+            <param label="Input MS1 featureDefinitions" name="ms1_featureDefinitions" type="data" format="parquet,tabular"
                    help="Metadata with columns: mz, rt, feature names containing MS data."/>
-            <param label="Input MS1 featureValues" name="ms1_featureValues" type="data" format="parquet"
+            <param label="Input MS1 featureValues" name="ms1_featureValues" type="data" format="parquet,tabular"
                    help="data with rownames = sample names, colnames = feature names containing MS data."/>
             <param label="phenoData" name="df_phenoData" type="data" format="tsv,csv" optional="true"
                    help="CSV/TSV file containing phenoData (optional)."/>
--- a/ramclustr.xml	Wed Apr 17 07:51:23 2024 +0000
+++ b/ramclustr.xml	Wed May 22 08:04:21 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="ramclustr" name="RAMClustR" version="@TOOL_VERSION@+galaxy5" profile="21.09">
+<tool id="ramclustr" name="RAMClustR" version="@TOOL_VERSION@+galaxy6" profile="21.09">
     <description>A feature clustering algorithm for non-targeted mass spectrometric metabolomics data.</description>
     <macros>
         <import>macros.xml</import>
@@ -56,6 +56,8 @@
             ramclustObj = read_ramclustr_aplcms(
                 ms1_featuredefinitions = "$filetype.ms_dataframe.ms1_featureDefinitions",
                 ms1_featurevalues = "$filetype.ms_dataframe.ms1_featureValues",
+                ms1_featuredefinitions_ext = "$filetype.ms_dataframe.ms1_featureDefinitions.ext",
+                ms1_featurevalues_ext = "$filetype.ms_dataframe.ms1_featureValues.ext",
                 #if $filetype.ms_dataframe.df_phenoData:
                     df_phenodata = "$filetype.ms_dataframe.df_phenoData",
                     phenodata_ext = "${filetype.ms_dataframe.df_phenoData.ext}",
--- a/ramclustr_wrapper.R	Wed Apr 17 07:51:23 2024 +0000
+++ b/ramclustr_wrapper.R	Wed May 22 08:04:21 2024 +0000
@@ -46,9 +46,22 @@
                                   phenodata_ext = NULL,
                                   exp_des = NULL,
                                   st = NULL,
-                                  ensure_no_na = TRUE) {
-  ms1_featuredefinitions <- arrow::read_parquet(ms1_featuredefinitions)
-  ms1_featurevalues <- arrow::read_parquet(ms1_featurevalues)
+                                  ensure_no_na = TRUE,
+                                  ms1_featuredefinitions_ext = "parquet",
+                                  ms1_featurevalues_ext = "parquet") {
+  if (ms1_featuredefinitions_ext == "parquet") {
+    ms1_featuredefinitions <- arrow::read_parquet(ms1_featuredefinitions)
+  } else {
+    ms1_featuredefinitions <- read.csv(ms1_featuredefinitions,
+      header = TRUE, sep = "\t"
+    )
+  }
+
+  if (ms1_featurevalues_ext == "parquet") {
+    ms1_featurevalues <- arrow::read_parquet(ms1_featurevalues)
+  } else {
+    ms1_featurevalues <- read.csv(ms1_featurevalues, header = TRUE, sep = "\t")
+  }
 
   if (!is.null(df_phenodata)) {
     if (phenodata_ext == "csv") {