annotate Intchecks/wrapper_intensity_check.R @ 0:c2c2e1be904a draft

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