Mercurial > repos > ppericard > viscorvar
comparison viscorvar_computematsimilarity.R @ 2:c8533e9298e5 draft
"planemo upload for repository https://gitlab.com/bilille/galaxy-viscorvar commit 8cb5630238352459037b3647eebfabb5554566f6-dirty"
author | ppericard |
---|---|
date | Fri, 23 Oct 2020 10:15:56 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1:e93350dc99f1 | 2:c8533e9298e5 |
---|---|
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 | |
36 ## Loading local functions | |
37 suppressPackageStartupMessages(require(visCorVar)) | |
38 | |
39 # Loading input Rdata file | |
40 # loads res_matCorAddVar object | |
41 load(args$input_rdata) | |
42 | |
43 # Run main function | |
44 res_compute_mat_similarity = computeMatSimilarity(res_matCorAddVar = res_matCorAddVar) | |
45 | |
46 liste_mat_similarity_group = res_compute_mat_similarity$liste_mat_similarity_group | |
47 res_matCorAddVar = res_compute_mat_similarity$res_matCorAddVar | |
48 | |
49 save(res_compute_mat_similarity, | |
50 file = args$output_rdata) |