diff inspect_eset.xml @ 2:577435e5e6b2 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/music/ commit 20f8561478535013e111d982b99639f48f1bea79"
author bgruening
date Sat, 29 Jan 2022 12:51:27 +0000
parents 817eb707bbf4
children 7705cc75ac18
line wrap: on
line diff
--- a/inspect_eset.xml	Fri Nov 26 15:54:31 2021 +0000
+++ b/inspect_eset.xml	Sat Jan 29 12:51:27 2022 +0000
@@ -6,7 +6,7 @@
     </macros>
     <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
-Rscript --vanilla '$__tool_directory__/scripts/inspect.R' '$conf'
+Rscript --vanilla '$conf'
 ]]></command>
     <configfiles>
         <configfile name="conf" >
@@ -26,10 +26,35 @@
 inspector = null_str_vec('$inspector')
 outfile_tab='$out_tab'
 
+suppressWarnings(suppressPackageStartupMessages(library(xbioc)))
+suppressWarnings(suppressPackageStartupMessages(library(MuSiC)))
+
+printout = function(text) {
+    if (typeof(text) %in% c("list", "vector", "integer", "double", "numeric")) {
+        write.table(text, file = outfile_tab, quote = F, sep = "\t",
+                    col.names = NA)
+    } else {
+        ## text
+        print(typeof(text))
+        capture.output(text, file = outfile_tab)  # nolint
+    }
+}
+
+if (inspector %in% c("print", "pData", "fData", "dims",
+                     "experimentData", "protocolData", "exprs",
+                     "signature", "annotation", "abstract")) {
+    op = get(inspector)
+    tab = op(rds_eset)
+    printout(tab)
+} else {
+    stop(paste0("No such option:", inspector))
+}
+
+
         </configfile>
     </configfiles>
     <inputs>
-        <param name="rds_eset" label="ESet Dataset" type="data" format="rdata.eset" />
+        <param name="rds_eset" label="ESet Dataset" type="data" format="@RDATATYPE@" />
         <param name="inspector" label="Inspect" type="select"
                help="Inspect an aspect of the ESet dataset" >
             <!-- See: https://www.rdocumentation.org/packages/Biobase/versions/2.32.0/topics/eSet -->