Mercurial > repos > mmonsoor > camera_combinexsannos
comparison CAMERA.r @ 19:608b4b95818b draft
planemo upload commit aa538ae477bc2f901c95d916e11d70eab75b5e00
author | lecorguille |
---|---|
date | Fri, 01 Feb 2019 11:31:20 -0500 |
parents | 7315b5f33b5e |
children |
comparison
equal
deleted
inserted
replaced
18:78d267387462 | 19:608b4b95818b |
---|---|
2 # CAMERA.r version="2.2.1" | 2 # CAMERA.r version="2.2.1" |
3 | 3 |
4 | 4 |
5 | 5 |
6 # ----- PACKAGE ----- | 6 # ----- PACKAGE ----- |
7 cat("\tPACKAGE INFO\n") | 7 cat("\tSESSION INFO\n") |
8 | 8 |
9 setRepositories(graphics=F, ind=31) | 9 pkgs=c("CAMERA","multtest","batch") |
10 for(pkg in pkgs) suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE))) | |
10 | 11 |
11 #pkgs=c("xcms","batch") | 12 sessioninfo = sessionInfo() |
12 pkgs=c("parallel","BiocGenerics", "Biobase", "Rcpp", "mzR", "xcms","snow","igraph","CAMERA","multtest","batch") | 13 cat(sessioninfo$R.version$version.string,"\n") |
13 for(p in pkgs) { | 14 cat("Main packages:\n") |
14 suppressPackageStartupMessages(suppressWarnings(library(p, quietly=TRUE, logical.return=TRUE, character.only=TRUE))) | 15 for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n") |
15 cat(p,"\t",as.character(packageVersion(p)),"\n",sep="") | 16 cat("Other loaded packages:\n") |
16 } | 17 for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n") |
18 | |
17 source_local <- function(fname){ argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) } | 19 source_local <- function(fname){ argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) } |
18 | 20 |
19 cat("\n\n"); | 21 cat("\n\n"); |
20 | 22 |
21 | 23 |
79 rplotspdf = "Rplots.pdf" | 81 rplotspdf = "Rplots.pdf" |
80 if (!is.null(listArguments[["rplotspdf"]])){ | 82 if (!is.null(listArguments[["rplotspdf"]])){ |
81 rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL | 83 rplotspdf = listArguments[["rplotspdf"]]; listArguments[["rplotspdf"]]=NULL |
82 } | 84 } |
83 | 85 |
84 dataMatrixOutput = "dataMatrix.tsv" | |
85 if (!is.null(listArguments[["dataMatrixOutput"]])){ | |
86 dataMatrixOutput = listArguments[["dataMatrixOutput"]]; listArguments[["dataMatrixOutput"]]=NULL | |
87 } | |
88 | |
89 variableMetadataOutput = "variableMetadata.tsv" | 86 variableMetadataOutput = "variableMetadata.tsv" |
90 if (!is.null(listArguments[["variableMetadataOutput"]])){ | 87 if (!is.null(listArguments[["variableMetadataOutput"]])){ |
91 variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL | 88 variableMetadataOutput = listArguments[["variableMetadataOutput"]]; listArguments[["variableMetadataOutput"]]=NULL |
92 } | 89 } |
93 | 90 |
103 singlefile = rawFilePath$singlefile | 100 singlefile = rawFilePath$singlefile |
104 listArguments = rawFilePath$listArguments | 101 listArguments = rawFilePath$listArguments |
105 directory = retrieveRawfileInTheWorkingDirectory(singlefile, zipfile) | 102 directory = retrieveRawfileInTheWorkingDirectory(singlefile, zipfile) |
106 } | 103 } |
107 | 104 |
105 # Because so far CAMERA isn't compatible with the new XCMSnExp object | |
106 if (exists("xdata")){ | |
107 xset <- getxcmsSetObject(xdata) | |
108 } | |
108 | 109 |
109 #addition of xset object to the list of arguments in the first position | 110 # addition of xset object to the list of arguments in the first position |
110 if (exists("xset") != 0){ | 111 if (exists("xset")){ |
111 listArguments=append(list(xset), listArguments) | 112 listArguments=append(list(xset), listArguments) |
112 } | 113 } |
113 | 114 |
114 cat("\n\n") | 115 cat("\n\n") |
115 | 116 |
120 cat("\tMAIN PROCESSING INFO\n") | 121 cat("\tMAIN PROCESSING INFO\n") |
121 | 122 |
122 #change the default display settings | 123 #change the default display settings |
123 pdf(file=rplotspdf, width=16, height=12) | 124 pdf(file=rplotspdf, width=16, height=12) |
124 | 125 |
125 | |
126 if (thefunction %in% c("annotatediff")) { | 126 if (thefunction %in% c("annotatediff")) { |
127 results_list=annotatediff(xset=xset,listArguments=listArguments,variableMetadataOutput=variableMetadataOutput,dataMatrixOutput=dataMatrixOutput) | 127 results_list=annotatediff(xset=xset,listArguments=listArguments,variableMetadataOutput=variableMetadataOutput) |
128 xa=results_list[["xa"]] | 128 xa=results_list[["xa"]] |
129 diffrep=results_list[["diffrep"]] | 129 diffrep=results_list[["diffrep"]] |
130 variableMetadata=results_list[["variableMetadata"]] | 130 variableMetadata=results_list[["variableMetadata"]] |
131 | 131 |
132 cat("\n\n") | 132 cat("\n\n") |