annotate CAMERA.r @ 4:87570e9b71f5 draft

planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
author lecorguille
date Mon, 25 Apr 2016 11:07:23 -0400
parents
children 198b035d4848
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
1 #!/usr/bin/env Rscript
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
2 # CAMERA.r version="2.2.1"
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
3
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
4
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
5
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
6 # ----- PACKAGE -----
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
7 cat("\tPACKAGE INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
8
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
9 setRepositories(graphics=F, ind=31)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
10
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
11 #pkgs=c("xcms","batch")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
12 pkgs=c("parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","igraph","CAMERA","multtest","batch")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
13 for(p in pkgs) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
14 suppressPackageStartupMessages(suppressWarnings(library(p, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
15 cat(p,"\t",as.character(packageVersion(p)),"\n",sep="")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
16 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
17 source_local <- function(fname){ argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
18
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
19 cat("\n\n");
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
20
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
21
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
22
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
23 # ----- ARGUMENTS -----
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
24 cat("\tARGUMENTS INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
25
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
26 listArguments = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
27 write.table(as.matrix(listArguments), col.names=F, quote=F, sep='\t')
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
28
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
29 cat("\n\n");
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
30
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
31
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
32 # ----- PROCESSING INFILE -----
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
33 cat("\tINFILE PROCESSING INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
34
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
35 #image is an .RData file necessary to use xset variable given by previous tools
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
36 if (!is.null(listArguments[["image"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
37 load(listArguments[["image"]]); listArguments[["image"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
38 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
39
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
40 if (listArguments[["xfunction"]] %in% c("combinexsAnnos")) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
41 load(listArguments[["image_pos"]])
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
42 xaP=xa
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
43 listOFlistArgumentsP=listOFlistArguments
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
44 if (exists("xsAnnotate_object")) xaP=xsAnnotate_object
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
45
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
46 diffrepP=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
47 if (exists("diffrep")) diffrepP=diffrep
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
48
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
49 load(listArguments[["image_neg"]])
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
50 xaN=xa
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
51 listOFlistArgumentsN=listOFlistArguments
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
52 if (exists("xsAnnotate_object")) xaN=xsAnnotate_object
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
53
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
54 diffrepN=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
55 if (exists("diffrep")) diffrepN=diffrep
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
56 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
57
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
58
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
59 cat("\n\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
60
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
61
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
62 # ----- ARGUMENTS PROCESSING -----
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
63 cat("\tARGUMENTS PROCESSING INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
64
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
65 # Save arguments to generate a report
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
66 if (!exists("listOFlistArguments")) listOFlistArguments=list()
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
67 listOFlistArguments[[paste(format(Sys.time(), "%y%m%d-%H:%M:%S_"),listArguments[["xfunction"]],sep="")]] = listArguments
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
68
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
69
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
70 #saving the commun parameters
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
71 thefunction = listArguments[["xfunction"]]
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
72 listArguments[["xfunction"]]=NULL #delete from the list of arguments
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
73
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
74 xsetRdataOutput = paste(thefunction,"RData",sep=".")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
75 if (!is.null(listArguments[["xsetRdataOutput"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
76 xsetRdataOutput = listArguments[["xsetRdataOutput"]]; listArguments[["xsetRdataOutput"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
77 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
78
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
79 rplotspdf = "Rplots.pdf"
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
80 if (!is.null(listArguments[["rplotspdf"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
81 rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
82 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
83
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
84 dataMatrixOutput = "dataMatrix.tsv"
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
85 if (!is.null(listArguments[["dataMatrixOutput"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
86 dataMatrixOutput = listArguments[["dataMatrixOutput"]]; listArguments[["dataMatrixOutput"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
87 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
88
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
89 variableMetadataOutput = "variableMetadata.tsv"
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
90 if (!is.null(listArguments[["variableMetadataOutput"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
91 variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
92 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
93
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
94 if (!is.null(listArguments[["new_file_path"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
95 new_file_path = listArguments[["new_file_path"]]; listArguments[["new_file_path"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
96 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
97
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
98 #Import the different functions
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
99 source_local("lib.r")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
100
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
101 #necessary to unzip .zip file uploaded to Galaxy
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
102 #thanks to .zip file it's possible to upload many file as the same time conserving the tree hierarchy of directories
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
103
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
104
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
105 if (!is.null(listArguments[["zipfile"]])){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
106 zipfile= listArguments[["zipfile"]]; listArguments[["zipfile"]]=NULL
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
107 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
108
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
109 # We unzip automatically the chromatograms from the zip files.
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
110 if (thefunction %in% c("annotatediff")) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
111 if(exists("zipfile") && (zipfile!="")) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
112 if(!file.exists(zipfile)){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
113 error_message=paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
114 print(error_message)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
115 stop(error_message)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
116 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
117
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
118 #unzip
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
119 suppressWarnings(unzip(zipfile, unzip="unzip"))
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
120
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
121 #get the directory name
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
122 filesInZip=unzip(zipfile, list=T);
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
123 directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])));
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
124 directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
125 directory = "."
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
126 if (length(directories) == 1) directory = directories
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
127
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
128 cat("files_root_directory\t",directory,"\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
129 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
130 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
131
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
132
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
133
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
134 #addition of xset object to the list of arguments in the first position
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
135 if (exists("xset") != 0){
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
136 listArguments=append(list(xset), listArguments)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
137 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
138
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
139 cat("\n\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
140
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
141
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
142
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
143
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
144 # ----- PROCESSING INFO -----
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
145 cat("\tMAIN PROCESSING INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
146
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
147 #change the default display settings
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
148 pdf(file=rplotspdf, width=16, height=12)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
149
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
150
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
151 if (thefunction %in% c("annotatediff")) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
152 results_list=annotatediff(xset=xset,listArguments=listArguments,variableMetadataOutput=variableMetadataOutput,dataMatrixOutput=dataMatrixOutput,new_file_path=new_file_path)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
153 xa=results_list[["xa"]]
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
154 diffrep=results_list[["diffrep"]]
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
155 variableMetadata=results_list[["variableMetadata"]]
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
156
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
157 cat("\n\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
158 cat("\tXSET OBJECT INFO\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
159 print(xa)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
160 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
161
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
162 if (thefunction %in% c("combinexsAnnos")) {
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
163 cAnnot=combinexsAnnos_function(xaP=xaP,xaN=xaN,listOFlistArgumentsP=listOFlistArgumentsP,listOFlistArgumentsN=listOFlistArgumentsN,diffrepP=diffrepP,diffrepN=diffrepN,convert_param=listArguments[["convert_param"]],pos=listArguments[["pos"]],tol=listArguments[["tol"]],ruleset=listArguments[["ruleset"]],keep_meta=listArguments[["keep_meta"]],variableMetadataOutput=variableMetadataOutput)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
164 }
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
165
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
166 dev.off()
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
167
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
168
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
169 #saving R data in .Rdata file to save the variables used in the present tool
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
170 objects2save = c("xa","variableMetadata","diffrep","cAnnot","listOFlistArguments","zipfile")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
171 save(list=objects2save[objects2save %in% ls()], file=xsetRdataOutput)
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
172
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
173 cat("\n\n")
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
174
87570e9b71f5 planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
lecorguille
parents:
diff changeset
175 cat("\tDONE\n")