comparison bum.R @ 0:e41ec5af7472 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/heinz commit b0b2c64a46bdd9beebdfb7fc5312f75346483763
author iuc
date Thu, 02 Aug 2018 11:57:44 -0400
parents
children 2b80a2596064
comparison
equal deleted inserted replaced
-1:000000000000 0:e41ec5af7472
1 # Author: Cico Zhang
2 # Usage: Rscript bum.R --input p-values.txt --output result.txt --verbose TRUE
3
4 # Set up R error handling to go to stderr
5 options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)})
6
7 # Avoid crashing Galaxy with an UTF8 error on German LC settings
8 #loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
9
10 # Import required libraries
11 suppressPackageStartupMessages({
12 library('getopt')
13 library('BioNet')
14 })
15
16 # Take in trailing command line arguments
17 args <- commandArgs(trailingOnly = TRUE)
18
19 # Get options using the spec as defined by the enclosed list
20 # Read the options from the default: commandArgs(TRUE)
21 option_specification <- matrix(c(
22 'input', 'i', 2, 'character',
23 'output', 'o', 2, 'character'
24 ), byrow=TRUE, ncol=4);
25
26 # Parse options
27 options <- getopt(option_specification);
28
29 pvals <- read.table(options$input)
30 bum <- fitBumModel(pvals,plot=FALSE)
31 mat <- c(bum$lambda, bum$a)
32 #bumtablename <- paste(options$output,sep="\t")
33 write.table(x=mat, file=options$output,quote=FALSE, row.names=FALSE, col.names=FALSE)
34 message ("Parameters have been estimated successfully!")