# HG changeset patch # User iuc # Date 1591874297 14400 # Node ID 2b80a25960646c7ce3ee0246f174a2b17ae05c32 # Parent 704c401e0afbee34765a7b3ce789bdebbeb5b5c7 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/heinz commit 8007f71281553ddfa45e6f8e1172952d956bb000" diff -r 704c401e0afb -r 2b80a2596064 bum.R --- a/bum.R Thu Jan 23 14:07:54 2020 -0500 +++ b/bum.R Thu Jun 11 07:18:17 2020 -0400 @@ -2,15 +2,16 @@ # Usage: Rscript bum.R --input p-values.txt --output result.txt --verbose TRUE # Set up R error handling to go to stderr -options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)}) - -# Avoid crashing Galaxy with an UTF8 error on German LC settings -#loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") +err_foo <- function() { + cat(geterrmessage(), file = stderr()); + q("no", 1, F) +} +options(show.error.messages = F, error = err_foo) # Import required libraries suppressPackageStartupMessages({ - library('getopt') - library('BioNet') + library("getopt") + library("BioNet") }) # Take in trailing command line arguments @@ -18,17 +19,16 @@ # Get options using the spec as defined by the enclosed list # Read the options from the default: commandArgs(TRUE) -option_specification <- matrix(c( - 'input', 'i', 2, 'character', - 'output', 'o', 2, 'character' -), byrow=TRUE, ncol=4); +option_specification <- matrix(c("input", "i", 2, "character", + "output", "o", 2, "character" + ), byrow = TRUE, ncol = 4); # Parse options options <- getopt(option_specification); pvals <- read.table(options$input) -bum <- fitBumModel(pvals,plot=FALSE) +bum <- fitBumModel(pvals, plot = FALSE) mat <- c(bum$lambda, bum$a) -#bumtablename <- paste(options$output,sep="\t") -write.table(x=mat, file=options$output,quote=FALSE, row.names=FALSE, col.names=FALSE) -message ("Parameters have been estimated successfully!") +write.table(x = mat, file = options$output, quote = FALSE, + row.names = FALSE, col.names = FALSE) +message("Parameters have been estimated successfully!")