# HG changeset patch
# User bgruening
# Date 1637942111 0
# Node ID be91cb6f48e79f958fa7dc65a5e04badd4c5d926
# Parent 2cfd0db49bbcfe05ff715dfe8890c31dc370f2d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/music/ commit 683bb72ae92b5759a239b7e3bf4c5a229ed35b54"
diff -r 2cfd0db49bbc -r be91cb6f48e7 construct_eset.xml
--- a/construct_eset.xml Sun Sep 12 19:49:12 2021 +0000
+++ b/construct_eset.xml Fri Nov 26 15:55:11 2021 +0000
@@ -14,9 +14,12 @@
suppressWarnings(suppressPackageStartupMessages(library(xbioc)))
suppressWarnings(suppressPackageStartupMessages(library(MuSiC)))
-null_str_vec = function(gstr){
+null_str_vec = function(gstr, is.str=FALSE){
tokens = unlist(as.vector(strsplit(gstr, split=",")))
if (length(tokens) == 0){
+ if (is.str){
+ return(character(0))
+ }
return(NULL)
}
if (length(tokens) == 1){
@@ -40,6 +43,9 @@
#end if
## Annotation and Feature Data, or just a string for type of chip used
annotation = null_str_vec('$annotation')
+if (is.null(annotation)){
+ annotation = character(0)
+}
if (all(rownames(pdata) != colnames(exprs))) {
stop("Number of Samples between phenotypes and assays are not the same")
@@ -66,26 +72,27 @@
metadata\$lname = NULL
if (nrow(metadata)==0) {
- metadata = NULL
+ pheno_data = new("AnnotatedDataFrame", data = pdata)
+} else {
+ pheno_data = new("AnnotatedDataFrame", data = pdata, varMetadata = metadata)
}
-pheno_data = new("AnnotatedDataFrame", data = pdata, varMetadata = metadata)
## Experiment Description -- using the MIAME object
experiment_data = new(
"MIAME",
- name = null_str_vec('$expdata.name'),
- lab = null_str_vec('$expdata.lab'),
- contact = null_str_vec('$expdata.contact'),
- title = null_str_vec('$expdata.title'),
- abstract = null_str_vec('$expdata.abstract'),
- url = null_str_vec('$expdata.url'),
+ name = null_str_vec('$expdata.name', is.str=T),
+ lab = null_str_vec('$expdata.lab', is.str=T),
+ contact = null_str_vec('$expdata.contact', is.str=T),
+ title = null_str_vec('$expdata.title', is.str=T),
+ abstract = null_str_vec('$expdata.abstract', is.str=T),
+ url = null_str_vec('$expdata.url', is.str=T),
other = list(
#for i, row in enumerate($expdata.other):
#if i==0
- '$row.field' = null_str_vec('$row.comment')
+ '$row.field' = null_str_vec('$row.comment', is.str=T)
#else
- ,'$row.field' = null_str_vec('$row.comment')
+ ,'$row.field' = null_str_vec('$row.comment', is.str=T)
#end if
#end for
))
@@ -95,7 +102,7 @@
experimentData = experiment_data,
annotation = annotation)
-capture.output(print(e_set), file = '$out_tab')
+capture.output(print(e_set), file = '$out_txt')
saveRDS(e_set, file= '$out_rds')
@@ -112,7 +119,8 @@
-
+
@@ -149,7 +157,7 @@
-
+
@@ -186,7 +194,7 @@
-