# HG changeset patch # User proteore # Date 1544190595 18000 # Node ID eafb37258a6fd14b134499eb240880de66446251 # Parent 54f8e6f5c59dfd3dd3e04ede2d9df28d0cb0c639 planemo upload commit 62db30a8a6c62c0106fda053ca75eb48e90ea705-dirty diff -r 54f8e6f5c59d -r eafb37258a6f GO-enrich.R --- 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 ) } diff -r 54f8e6f5c59d -r eafb37258a6f cluster_profiler.xml --- 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 @@ - + (Human, Mouse, Rat) (clusterProfiler) R @@ -161,7 +161,7 @@ - +