")
if (all(getSampleNames(xobject) == sampleNamesList$sampleNamesMakeNames)) {
- sampleNameHeaderHtml <- paste0("sample | ")
- sampleNameHtml <- paste0("", getSampleNames(xobject), " | ")
+ sampleNameHeaderHtml <- paste0("sample | ")
+ sampleNameHtml <- paste0("", getSampleNames(xobject), " | ")
} else {
- sampleNameHeaderHtml <- paste0("sample | sample renamed | ")
- sampleNameHtml <- paste0("", getSampleNames(xobject), " | ", sampleNamesList$sampleNamesMakeNames, " | ")
+ sampleNameHeaderHtml <- paste0("sample | sample renamed | ")
+ sampleNameHtml <- paste0("", getSampleNames(xobject), " | ", sampleNamesList$sampleNamesMakeNames, " | ")
}
if (!exists("md5sumList")) {
- md5sumHeaderHtml <- ""
- md5sumHtml <- ""
- md5sumLegend <- ""
+ md5sumHeaderHtml <- ""
+ md5sumHtml <- ""
+ md5sumLegend <- ""
} else if (is.null(md5sumList$removalBadCharacters)) {
- md5sumHeaderHtml <- paste0("md5sum* | ")
- md5sumHtml <- paste0("", md5sumList$origin, " | ")
- md5sumLegend <- "
*The program md5sum is designed to verify data integrity. So you can check if the data were uploaded correctly or if the data were changed during the process."
+ md5sumHeaderHtml <- paste0("md5sum* | ")
+ md5sumHtml <- paste0("", md5sumList$origin, " | ")
+ md5sumLegend <- "
*The program md5sum is designed to verify data integrity. So you can check if the data were uploaded correctly or if the data were changed during the process."
} else {
- md5sumHeaderHtml <- paste0("md5sum* | md5sum** after bad characters removal | ")
- md5sumHtml <- paste0("", md5sumList$origin, " | ", md5sumList$removalBadCharacters, " | ")
- md5sumLegend <- "
*The program md5sum is designed to verify data integrity. So you can check if the data were uploaded correctly or if the data were changed during the process.
**Because some bad characters (eg: accent) were removed from your original file, the checksum have changed too.
"
+ md5sumHeaderHtml <- paste0("md5sum* | md5sum** after bad characters removal | ")
+ md5sumHtml <- paste0("", md5sumList$origin, " | ", md5sumList$removalBadCharacters, " | ")
+ md5sumLegend <- "
*The program md5sum is designed to verify data integrity. So you can check if the data were uploaded correctly or if the data were changed during the process.
**Because some bad characters (eg: accent) were removed from your original file, the checksum have changed too.
"
}
writehtml("", sampleNameHeaderHtml, "filename | ", md5sumHeaderHtml, "
")
@@ -155,43 +159,44 @@ writehtml("")
writehtml("timestamp*** | function | argument | value |
")
# XCMS 3.x
if (class(xobject) == "XCMSnExp") {
- xcmsFunction <- NULL
- params <- NULL
- for (processHistoryItem in processHistory(xobject)) {
- if ((xcmsFunction == processType(processHistoryItem)) && equalParams(params, processParam(processHistoryItem)))
- next
- timestamp <- processDate(processHistoryItem)
- xcmsFunction <- processType(processHistoryItem)
- params <- processParam(processHistoryItem)
- writehtml("", timestamp, " | ", xcmsFunction, " | ")
- writeraw(htmlOutput, params)
- writehtml(" |
")
- }
+ xcmsFunction <- NULL
+ params <- NULL
+ for (processHistoryItem in processHistory(xobject)) {
+ if ((xcmsFunction == processType(processHistoryItem)) && equalParams(params, processParam(processHistoryItem))) {
+ next
+ }
+ timestamp <- processDate(processHistoryItem)
+ xcmsFunction <- processType(processHistoryItem)
+ params <- processParam(processHistoryItem)
+ writehtml("", timestamp, " | ", xcmsFunction, " | ")
+ writeraw(htmlOutput, params)
+ writehtml(" |
")
+ }
}
# CAMERA and retrocompatability XCMS 1.x
if (exists("listOFlistArguments")) {
- for (tool in names(listOFlistArguments)) {
- listOFlistArgumentsDisplay <- listOFlistArguments[[tool]][!(names(listOFlistArguments[[tool]]) %in% argBlacklist)]
-
- timestamp <- strsplit(tool, "_")[[1]][1]
- xcmsFunction <- strsplit(tool, "_")[[1]][2]
- writehtml("", timestamp, " | ", xcmsFunction, " | ")
- line_begin <- ""
- for (arg in names(listOFlistArgumentsDisplay)) {
- writehtml(line_begin, "", arg, " | ", unlist(listOFlistArgumentsDisplay[arg][1]), " |
")
- line_begin <- ""
+ for (tool in names(listOFlistArguments)) {
+ listOFlistArgumentsDisplay <- listOFlistArguments[[tool]][!(names(listOFlistArguments[[tool]]) %in% argBlacklist)]
+
+ timestamp <- strsplit(tool, "_")[[1]][1]
+ xcmsFunction <- strsplit(tool, "_")[[1]][2]
+ writehtml("
", timestamp, " | ", xcmsFunction, " | ")
+ line_begin <- ""
+ for (arg in names(listOFlistArgumentsDisplay)) {
+ writehtml(line_begin, "", arg, " | ", unlist(listOFlistArgumentsDisplay[arg][1]), " |
")
+ line_begin <- ""
+ }
}
- }
}
writehtml("
")
writehtml("
***timestamp format: DD MM dd hh:mm:ss YYYY or yymmdd-hh:mm:ss")
writehtml("
")
if (class(xobject) == "XCMSnExp") {
- writehtml("Informations about the XCMSnExp object:
")
- writehtml("")
- writeraw(htmlOutput, xobject)
- writehtml("
")
+ writehtml("Informations about the XCMSnExp object:
")
+ writehtml("")
+ writeraw(htmlOutput, xobject)
+ writehtml("
")
}
writehtml("Informations about the xcmsSet object:
")
@@ -204,10 +209,10 @@ writehtml("")
# CAMERA
if (exists("xa")) {
- writehtml("Informations about the CAMERA object:
")
- writehtml("")
- writehtml("Number of pcgroup: ", length(xa@pspectra))
- writehtml("
")
+ writehtml("Informations about the CAMERA object:
")
+ writehtml("")
+ writehtml("Number of pcgroup: ", length(xa@pspectra))
+ writehtml("
")
}
writehtml("Citations:
")
diff --git a/tools/xcms/xcms_xcmsSet.r b/tools/xcms/xcms_xcmsSet.r
index fbf2b146e2..4e654f11a0 100755
--- a/tools/xcms/xcms_xcmsSet.r
+++ b/tools/xcms/xcms_xcmsSet.r
@@ -9,11 +9,11 @@ sink(log_file, type = "output")
# ----- PACKAGE -----
cat("\tSESSION INFO\n")
-#Import the different functions
+# Import the different functions
source_local <- function(fname) {
- argv <- commandArgs(trailingOnly = FALSE)
- base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
- source(paste(base_dir, fname, sep = "/"))
+ argv <- commandArgs(trailingOnly = FALSE)
+ base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
+ source(paste(base_dir, fname, sep = "/"))
}
source_local("lib.r")
@@ -24,7 +24,7 @@ cat("\n\n")
# ----- ARGUMENTS -----
cat("\tARGUMENTS INFO\n")
-args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects
+args <- parseCommandArgs(evaluate = FALSE) # interpretation of arguments given in command line as an R list of objects
write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t")
cat("\n\n")
@@ -33,14 +33,14 @@ cat("\n\n")
# ----- PROCESSING INFILE -----
cat("\tARGUMENTS PROCESSING INFO\n")
-#saving the commun parameters
+# saving the commun parameters
BPPARAM <- MulticoreParam(1)
if (!is.null(args$BPPARAM)) {
- BPPARAM <- MulticoreParam(args$BPPARAM)
+ BPPARAM <- MulticoreParam(args$BPPARAM)
}
register(BPPARAM)
-#saving the specific parameters
+# saving the specific parameters
if (!is.null(args$filterAcquisitionNum)) filterAcquisitionNumParam <- args$filterAcquisitionNum
if (!is.null(args$filterRt)) filterRtParam <- args$filterRt
if (!is.null(args$filterMz)) filterMzParam <- args$filterMz
@@ -49,9 +49,9 @@ if (!is.null(args$peaklist)) peaklistParam <- args$peaklist
method <- args$method
if (!is.null(args$roiList)) {
- cat("\t\troiList provided\n")
- args$roiList <- list(getDataFrameFromFile(args$roiList))
- print(args$roiList)
+ cat("\t\troiList provided\n")
+ args$roiList <- list(getDataFrameFromFile(args$roiList))
+ print(args$roiList)
}
cat("\n\n")
@@ -59,7 +59,7 @@ cat("\n\n")
# ----- INFILE PROCESSING -----
cat("\tINFILE PROCESSING INFO\n")
-#image is an .RData file necessary to use xset variable given by previous tools
+# image is an .RData file necessary to use xset variable given by previous tools
load(args$image)
if (!exists("raw_data")) stop("\n\nERROR: The RData doesn't contain any object called 'raw_data' which is provided by the tool: MSnbase readMSData")
@@ -79,12 +79,12 @@ cat("\tMAIN PROCESSING INFO\n")
cat("\t\tCOMPUTE\n")
cat("\t\t\tApply filter[s] (if asked)\n")
-if (exists("filterAcquisitionNumParam")) raw_data <- filterAcquisitionNum(raw_data, filterAcquisitionNumParam[1]:filterAcquisitionNumParam[2])
+if (exists("filterAcquisitionNumParam")) raw_data <- filterAcquisitionNum(raw_data, filterAcquisitionNumParam[1]:filterAcquisitionNumParam[2])
if (exists("filterRtParam")) raw_data <- filterRt(raw_data, filterRtParam)
if (exists("filterMzParam")) raw_data <- filterMz(raw_data, filterMzParam)
-#Apply this filter only if file contain MS and MSn
+# Apply this filter only if file contain MS and MSn
if (length(unique(msLevel(raw_data))) != 1) {
- raw_data <- filterMsLevel(raw_data, msLevel = 1)
+ raw_data <- filterMsLevel(raw_data, msLevel = 1)
}
cat("\t\t\tChromatographic peak detection\n")
@@ -103,10 +103,10 @@ sampleNamesList <- getSampleMetadata(xdata = xdata, sampleMetadataOutput = "samp
# Create a chromPeaks table if required
if (exists("peaklistParam")) {
- if (peaklistParam) {
- cat("\nCreating the chromatographic peaks' table...\n")
- write.table(chromPeaks(xdata), file = "chromPeak_table.tsv", sep = "\t", quote = FALSE, row.names = FALSE)
- }
+ if (peaklistParam) {
+ cat("\nCreating the chromatographic peaks' table...\n")
+ write.table(chromPeaks(xdata), file = "chromPeak_table.tsv", sep = "\t", quote = FALSE, row.names = FALSE)
+ }
}
cat("\n\n")
@@ -123,7 +123,7 @@ xset <- getxcmsSetObject(xdata)
print(xset)
cat("\n\n")
-#saving R data in .Rdata file to save the variables used in the present tool
+# saving R data in .Rdata file to save the variables used in the present tool
objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList")
save(list = objects2save[objects2save %in% ls()], file = "xcmsSet.RData")