Mercurial > repos > vmarcon > normalization
annotate normalization_galaxy.R @ 0:79f00bc83ecc draft default tip
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
author | vmarcon |
---|---|
date | Thu, 18 Jan 2018 06:20:30 -0500 |
parents | |
children |
rev | line source |
---|---|
0
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
1 #!/usr/local/bioinfo/bin/Rscript --vanilla --slave --no-site-file |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
2 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
3 # R Script making the bridge between Galaxy and the call of the normalization method |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
4 #----------------------------------------------------------------- |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
5 # Authors : luc.jouneau(at)inra.fr |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
6 # valentin.marcon(at)inra.fr |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
7 # Version : 0.9 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
8 # Date : 30/08/2017 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
9 #--------------------------------------------------------------- |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
10 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
11 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
12 ## Options |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
13 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
14 strAsFacL <- options()$stringsAsFactors |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
15 options(stringsAsFactors = FALSE) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
16 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
17 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
18 ## Libraries laoding |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
19 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
20 # For parseCommandArgs function |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
21 library(batch) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
22 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
23 # R script call |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
24 source_local <- function(fname) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
25 { |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
26 argv <- commandArgs(trailingOnly = FALSE) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
27 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
28 source(paste(base_dir, fname, sep="/")) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
29 } |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
30 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
31 #Import the different functions used for Normalization |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
32 source_local("normalization.R") |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
33 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
34 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
35 ## Lecture parametres |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
36 ##------------------------------ |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
37 argLs <- parseCommandArgs(evaluate=FALSE) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
38 |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
39 normalization(input_file=argLs[["input_file"]], |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
40 transformation_method=argLs[["transformation_method"]], |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
41 na_encoding=argLs[["na_encoding"]], |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
42 output_file=argLs[["output_file"]], |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
43 log_file=argLs[["log_file"]], |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
44 variable_in_line=argLs[["variable_in_line"]]) |
79f00bc83ecc
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
45 |