changeset 28:eafb37258a6f draft

planemo upload commit 62db30a8a6c62c0106fda053ca75eb48e90ea705-dirty
author proteore
date Fri, 07 Dec 2018 08:49:55 -0500
parents 54f8e6f5c59d
children 52735594cd45
files GO-enrich.R cluster_profiler.xml
diffstat 2 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/GO-enrich.R	Wed Nov 21 08:53:49 2018 -0500
+++ b/GO-enrich.R	Fri Dec 07 08:49:55 2018 -0500
@@ -153,7 +153,8 @@
   args <- as.list(as.character(argsDF$V2))
   names(args) <- argsDF$V1
   plot = unlist(strsplit(args$plot,","))
-  #print(args)
+  go_represent=str2bool(args$go_represent)
+  go_enrich=str2bool(args$go_enrich)
   
   #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
   #load("/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
@@ -209,13 +210,8 @@
   ontology <- strsplit(args$onto_opt, ",")[[1]]
   
   ## Extract GGO/EGO arguments
-  if (args$go_represent == "true") {
-    go_represent <- args$go_represent
-    level <- as.numeric(args$level)
-  }
-  
-  if (args$go_enrich == "true") {
-    go_enrich <- args$go_enrich
+  if (go_represent) {level <- as.numeric(args$level)}
+  if (go_enrich) {
     pval_cutoff <- as.numeric(args$pval_cutoff)
     qval_cutoff <- as.numeric(args$qval_cutoff)
     # Extract universe background genes (same as input file)
@@ -264,16 +260,16 @@
 
   ##enrichGO : GO over-representation test
   for (onto in ontology) {
-    if (args$go_represent == "true") {
+    if (go_represent) {
       ggo<-repartition.GO(gene, orgdb, onto, level, readable=TRUE)
-      ggo <- as.data.frame(apply(ggo, c(1,2), function(x) gsub("^$|^ $", NA, x)))  #convert "" and " " to NA
+      if (is.list(ggo)){ggo <- as.data.frame(apply(ggo, c(1,2), function(x) gsub("^$|^ $", NA, x)))}  #convert "" and " " to NA
       output_path = paste("cluster_profiler_GGO_",onto,".tsv",sep="")
       write.table(ggo, output_path, sep="\t", row.names = FALSE, quote = FALSE )
     }
 
-    if (args$go_enrich == "true") {
+    if (go_enrich) {
       ego<-enrich.GO(gene, universe_gene, orgdb, onto, pval_cutoff, qval_cutoff,plot)
-      ego <- as.data.frame(apply(ego, c(1,2), function(x) gsub("^$|^ $", NA, x)))  #convert "" and " " to NA
+      if (is.list(ego)){ego <- as.data.frame(apply(ego, c(1,2), function(x) gsub("^$|^ $", NA, x)))}  #convert "" and " " to NA
       output_path = paste("cluster_profiler_EGO_",onto,".tsv",sep="")
       write.table(ego, output_path, sep="\t", row.names = FALSE, quote = FALSE )
     }
--- a/cluster_profiler.xml	Wed Nov 21 08:53:49 2018 -0500
+++ b/cluster_profiler.xml	Fri Dec 07 08:49:55 2018 -0500
@@ -1,4 +1,4 @@
-<tool id="cluter_profiler" name="GO terms classification and enrichment analysis" version="2018.11.21.2">
+<tool id="cluter_profiler" name="GO terms classification and enrichment analysis" version="2018.12.07">
     <description>(Human, Mouse, Rat) (clusterProfiler)</description>
     <requirements>
         <requirement type="package" version="3.4.1">R</requirement>
@@ -161,7 +161,7 @@
 	    
     </inputs>
     <outputs>
-        <data name="log" format="tabular" label="Cluster profiler" />
+        <data name="log" format="tsv" label="Cluster profiler" />
         <collection type="list" label="clusterProfiler text files" name="text_output">
             <discover_datasets pattern="(?P&lt;designation&gt;.+\.tsv)" ext="tsv"/>
         </collection>