-
Notifications
You must be signed in to change notification settings - Fork 0
/
computeMatSimilarity_wrapper.R
47 lines (34 loc) · 1.44 KB
/
computeMatSimilarity_wrapper.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env Rscript
# Setup R error handling to go to stderr
options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
# we need that to not crash galaxy with an UTF8 error on German LC settings.
loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
## Get parameters ##
suppressPackageStartupMessages(require(argparse))
parser <- ArgumentParser(description='Run the computeMatSimilarity function')
parser$add_argument('--input_rdata', dest='input_rdata', required=TRUE, help="Input RData file")
parser$add_argument('--output_rdata', dest='output_rdata', required=TRUE, help="Output RData file")
args <- parser$parse_args()
## Print parameters
print("Input RData:")
print(args$input_rdata)
print("Output RData:")
print(args$output_rdata)
## Loading libraries
# suppressPackageStartupMessages(require(mixOmics))
# R script call
source_local <- function(fname)
{
argv <- commandArgs(trailingOnly = FALSE)
base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
source(paste(base_dir, fname, sep="/"))
}
## Loading local functions
source_local("Integration_block_splsda_fonc.R")
load(args$input_rdata)
liste_res_matSimilarity_group = compute_matSimilarity(liste_dataframe_cor_comp_var_global)
liste_matSimilarity_group = liste_res_matSimilarity_group$liste_matSimilarity_group
comp = liste_res_matSimilarity_group$comp
save(liste_matSimilarity_group,
comp,
file = args$output_rdata)