Mercurial > repos > melpetera > intensity_checks
comparison Intchecks/wrapper_intensity_check.R @ 0:c2c2e1be904a draft
Uploaded
author | melpetera |
---|---|
date | Thu, 11 Oct 2018 05:33:19 -0400 |
parents | |
children | 4973a2104cfd |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c2c2e1be904a |
---|---|
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file | |
2 | |
3 #################################################################### | |
4 # WRAPPER for INTENSITY CHECK | |
5 #Script: Script_intensity_check_v1.R | |
6 #Xml: xml_intensity_check_v1.xml | |
7 # | |
8 # V1: Fold and NA | |
9 # | |
10 # Input: Data Matrix, VariableMetadata, SampleMetadata | |
11 # Output: VariableMetadata, Graphics (barplots and boxplots) | |
12 # | |
13 # | |
14 #################################################################### | |
15 | |
16 | |
17 library(batch) #necessary for parseCommandArgs function | |
18 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects | |
19 | |
20 source_local <- function(...){ | |
21 argv <- commandArgs(trailingOnly = FALSE) | |
22 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | |
23 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))} | |
24 } | |
25 #Import the different functions | |
26 source_local("Script_intensity_check.R", "RcheckLibrary.R") | |
27 | |
28 | |
29 if(length(args) < 7){ stop("NOT enough argument !!!") } | |
30 | |
31 class1 <- NULL | |
32 if(args$type == "One_class"){ | |
33 class1 <- args$class1 | |
34 } | |
35 | |
36 #print args | |
37 cat("\n-------------------------------\nIntensity Check parameters:\n\n") | |
38 print(args) | |
39 cat("--------------------------------\n") | |
40 | |
41 | |
42 intens_check(args$dataMatrix_in, args$sampleMetadata_in, args$variableMetadata_in, args$type, | |
43 args$class_col, class1, args$variableMetadata_out, args$graphs_out) | |
44 | |
45 sessionInfo() | |
46 cat("--------------------------------\n") | |
47 | |
48 #delete the parameters to avoid the passage to the next tool in .RData image | |
49 rm(args) |