diff scripts/common.R @ 0:e01c989c7543 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
author iuc
date Sat, 03 Mar 2018 17:34:16 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/common.R	Sat Mar 03 17:34:16 2018 -0500
@@ -0,0 +1,23 @@
+# Load libs
+arr <- c("methods", "tsne","pheatmap","MASS","cluster","mclust","flexmix","lattice","fpc","RColorBrewer","permute","amap","locfit")
+res <- lapply(arr, require, character.only = TRUE)
+
+
+if (is.na(script_dir) || is.na(config_file) || script_dir == "None" || config_file == "None"){
+   stop("Could not find script_dir or config_file")
+}
+
+source(paste(script_dir, "RaceID_class.R", sep="/"))
+
+# Load params
+source(config_file)
+
+# Common functions
+message <- function(...){ print(sprintf(...)) }
+plotter <- function(fname, funct){
+    name <- paste(fname, "svg", sep=".")
+    svg(name,width=10,height=10)
+    force(funct)
+    dev.off()
+}
+