annotate Intchecks/wrapper_intensity_check.R @ 1:4973a2104cfd draft

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