Mercurial > repos > vmarcon > summary_statistics
annotate summary_statistics_galaxy.R @ 0:46ddb0591d8b draft default tip
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
author | vmarcon |
---|---|
date | Thu, 18 Jan 2018 07:44:37 -0500 |
parents | |
children |
rev | line source |
---|---|
0
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
1 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
2 # Quality controls and descriptive analysis plots # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
3 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
4 # Authors: Melanie Petera # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
5 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
6 # Description : This script allows various displays of data for quality # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
7 # control and descriptive analysis. The input data is a matrix of # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
8 # quantitative variables, and it returns chosen plots in png format # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
9 # and a table with chosen statistics. # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
10 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
11 # Specific R packages: # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
12 # - edgeR (needed for MA plots) # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
13 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
14 # Version 1 (06-06-2014): display boxplot, histogram, density plot, # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
15 # MA plot, pairs plot, and return a table of chosen statistics # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
16 # (quantiles, mean, variance, standard error of the mean) # |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
17 ########################################################################### |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
18 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
19 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
20 ##------------------------------ |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
21 ## Libraries laoding |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
22 ##------------------------------ |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
23 # For parseCommandArgs function |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
24 library(batch) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
25 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
26 # R script call |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
27 source_local <- function(fname) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
28 { |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
29 argv <- commandArgs(trailingOnly = FALSE) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
30 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
31 source(paste(base_dir, fname, sep="/")) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
32 } |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
33 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
34 #Import the different functions used for Summary_Statistics |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
35 source_local("summary_statistics.R") |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
36 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
37 ##------------------------------ |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
38 ## Lecture parametres |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
39 ##------------------------------ |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
40 argLs <- parseCommandArgs(evaluate=FALSE) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
41 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
42 desc_fct(file.in=argLs[["file_in"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
43 nacode=argLs[["NA_code"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
44 table_file=argLs[["table_file"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
45 graph_file=argLs[["graph_file"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
46 stat=argLs[["stat"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
47 chosen.stat=argLs[["stat_chosen"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
48 ploting=argLs[["ploting"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
49 chosen.plot=argLs[["plot_chosen"]], |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
50 log_file=argLs[["log_file"]]) |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
51 |
46ddb0591d8b
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
vmarcon
parents:
diff
changeset
|
52 |