diff ribbonPlot.R @ 0:12b4f093e6c4 draft default tip

planemo upload commit 2774930eebe258ecd56c8f1c5ddabf5092282ab9
author bcclaywell
date Mon, 12 Oct 2015 16:46:15 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ribbonPlot.R	Mon Oct 12 16:46:15 2015 -0400
@@ -0,0 +1,50 @@
+#!/usr/bin/env Rscript
+
+## begin warning handler
+withCallingHandlers({
+
+library(methods) # Because Rscript does not always do this
+
+options('useFancyQuotes' = FALSE)
+
+suppressPackageStartupMessages(library("optparse"))
+suppressPackageStartupMessages(library("RGalaxy"))
+
+
+option_list <- list()
+
+option_list$CommunityFile <- make_option('--CommunityFile', type='character')
+option_list$Attributes <- make_option('--Attributes', type='character')
+option_list$ClusteringAlgorithm <- make_option('--ClusteringAlgorithm', type='character')
+option_list$OutputFile <- make_option('--OutputFile', type='character')
+
+
+opt <- parse_args(OptionParser(option_list=option_list))
+
+suppressPackageStartupMessages(library(microbiomePkg))
+
+## function body not needed here, it is in package
+
+params <- list()
+for(param in names(opt))
+{
+    if (!param == "help")
+        params[param] <- opt[param]
+}
+
+setClass("GalaxyRemoteError", contains="character")
+wrappedFunction <- function(f)
+{
+    tryCatch(do.call(f, params),
+        error=function(e) new("GalaxyRemoteError", conditionMessage(e)))
+}
+
+
+suppressPackageStartupMessages(library(RGalaxy))
+do.call(ribbonPlot, params)
+
+## end warning handler
+}, warning = function(w) {
+    cat(paste("Warning:", conditionMessage(w), "\n"))
+    invokeRestart("muffleWarning")
+})