comparison computeMatSimilarity_wrapper.R @ 3:0a3c83f2197a draft

planemo upload for repository https://github.com/bilille/galaxy-mixomics-blocksplsda commit 24b8259494ac7ab10cbd1f9ee991f455a7507590-dirty
author ppericard
date Fri, 25 Oct 2019 07:10:59 -0400
parents
children
comparison
equal deleted inserted replaced
2:655d1fbcd3e6 3:0a3c83f2197a
1 #!/usr/bin/env Rscript
2
3 # Setup R error handling to go to stderr
4 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
5
6 # we need that to not crash galaxy with an UTF8 error on German LC settings.
7 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
8
9 ## Get parameters ##
10 suppressPackageStartupMessages(require(argparse))
11
12 parser <- ArgumentParser(description='Run the computeMatSimilarity function')
13
14 parser$add_argument('--input_rdata', dest='input_rdata', required=TRUE, help="Input RData file")
15 parser$add_argument('--output_rdata', dest='output_rdata', required=TRUE, help="Output RData file")
16
17 args <- parser$parse_args()
18
19 ## Print parameters
20 print("Input RData:")
21 print(args$input_rdata)
22 print("Output RData:")
23 print(args$output_rdata)
24
25 ## Loading libraries
26 # suppressPackageStartupMessages(require(mixOmics))
27
28 # R script call
29 source_local <- function(fname)
30 {
31 argv <- commandArgs(trailingOnly = FALSE)
32 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
33 source(paste(base_dir, fname, sep="/"))
34 }
35 ## Loading local functions
36 source_local("Integration_block_splsda_fonc.R")
37
38 load(args$input_rdata)
39
40 liste_res_matSimilarity_group = compute_matSimilarity(liste_dataframe_cor_comp_var_global)
41
42 liste_matSimilarity_group = liste_res_matSimilarity_group$liste_matSimilarity_group
43 comp = liste_res_matSimilarity_group$comp
44
45 save(liste_matSimilarity_group,
46 comp,
47 file = args$output_rdata)