annotate xcms_summary.r @ 36:12c802da5367 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e131bacd37bfaf2c4132fd214c81db9b8a9df513
author lecorguille
date Mon, 17 Sep 2018 08:47:17 -0400
parents 3d4339594010
children 1d2cc6c87acf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
dc6b3773f8de planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 1bf8810447bdd1268f67bfb64ead95ce82d8d85c
lecorguille
parents: 6
diff changeset
1 #!/usr/bin/env Rscript
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
2
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
3
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
4
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
5 # ----- ARGUMENTS BLACKLIST -----
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
6 #xcms.r
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
7 argBlacklist <- c("zipfile", "singlefile_galaxyPath", "singlefile_sampleName", "xfunction", "xsetRdataOutput", "sampleMetadataOutput", "ticspdf", "bicspdf", "rplotspdf")
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
8 #CAMERA.r
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
9 argBlacklist <- c(argBlacklist, "dataMatrixOutput", "variableMetadataOutput", "new_file_path")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
10
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
11
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
12 # ----- PACKAGE -----
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
13 cat("\tSESSION INFO\n")
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
14
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
15 #Import the different functions
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
16 source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
17 source_local("lib.r")
36
12c802da5367 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e131bacd37bfaf2c4132fd214c81db9b8a9df513
lecorguille
parents: 29
diff changeset
18 source_local("lib-xcms3.x.x.r")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
19
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
20 pkgs <- c("CAMERA","batch")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
21 loadAndDisplayPackages(pkgs)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
22 cat("\n\n");
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
23
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
24
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
25 # ----- FUNCTION -----
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
26 writehtml <- function(...) { cat(...,"\n", file=htmlOutput,append = TRUE,sep="") }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
27 writeraw <- function(htmlOutput, object, open="at") {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
28 log_file <- file(htmlOutput, open = open)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
29 sink(log_file)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
30 sink(log_file, type = "output")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
31 print(object)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
32 sink()
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
33 close(log_file)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
34 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
35 getSampleNames <- function(xobject) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
36 if (class(xobject) == "xcmsSet")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
37 return (sampnames(xobject))
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
38 if (class(xobject) == "XCMSnExp")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
39 return (xobject@phenoData@data$sample_name)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
40 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
41 getFilePaths <- function(xobject) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
42 if (class(xobject) == "xcmsSet")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
43 return (xobject@filepaths)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
44 if (class(xobject) == "XCMSnExp")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
45 return (fileNames(xobject))
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
46 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
47 equalParams <- function(param1, param2) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
48 writeraw("param1.txt", param1, open="wt")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
49 writeraw("param2.txt", param2, open="wt")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
50 return(tools::md5sum("param1.txt") == tools::md5sum("param2.txt"))
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
51 }
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
52
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
53
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
54 # ----- ARGUMENTS -----
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
55
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
56 args <- parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
57
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
58
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
59 # ----- ARGUMENTS PROCESSING -----
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
60
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
61 #image is an .RData file necessary to use xset variable given by previous tools
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
62 load(args$image);
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
63
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
64 htmlOutput <- "summary.html"
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
65 if (!is.null(args$htmlOutput)) htmlOutput = args$htmlOutput;
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
66
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
67 user_email <- NULL
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
68 if (!is.null(args$user_email)) user_email = args$user_email;
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
69
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
70 # if the RData come from XCMS 1.x
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
71 if (exists("xset")) xobject <- xset
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
72 # retrocompatability
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
73 if (!exists("sampleNamesList")) sampleNamesList <- list("sampleNamesMakeNames"=make.names(sampnames(xobject)))
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
74 # if the RData come from CAMERA
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
75 if (exists("xa")) xobject <- xa@xcmsSet
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
76 # if the RData come from XCMS 3.x
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
77 if (exists("xdata")) xobject <- xdata
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
78
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
79 if (!exists("xobject")) stop("You need at least a xdata, a xset or a xa object.")
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
80
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
81
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
82
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
83 # ----- MAIN PROCESSING INFO -----
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
84 writehtml("<!DOCTYPE html>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
85 writehtml("<HTML lang='en'>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
86
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
87 writehtml("<HEAD>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
88 writehtml("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
89
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
90 writehtml("<title>[W4M] XCMS analysis summary</title>")
17
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
91
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
92 writehtml("<style>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
93 writehtml("table, tr, td, th { border: 1px solid #000000; border-collapse:collapse; }")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
94 writehtml("td,th { padding: 5px; padding-right: 12px; }")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
95 writehtml("th { background: #898989; text-align:left;color: white;}")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
96 writehtml("h2 { color: #FFA212; }")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
97 writehtml("ul li { margin-bottom:10px; }")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
98 writehtml("</style>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
99 writehtml("</HEAD>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
100
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
101 writehtml("<BODY>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
102 writehtml("<div><h1>___ XCMS analysis summary using Workflow4Metabolomics ___</h1>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
103 # to pass the planemo shed_test
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
104 if (user_email != "test@bx.psu.edu") {
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
105 if (!is.null(user_email)) writehtml("By: ", user_email," - ")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
106 writehtml("Date: ", format(Sys.time(), "%y%m%d-%H:%M:%S"))
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
107 }
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
108 writehtml("</div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
109
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
110 writehtml("<h2>Samples used:</h2>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
111 writehtml("<div><table>")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
112 if (all(getSampleNames(xobject) == sampleNamesList$sampleNamesMakeNames)) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
113 sampleNameHeaderHtml <- paste0("<th>sample</th>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
114 sampleNameHtml <- paste0("<td>",getSampleNames(xobject),"</td>")
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
115 } else {
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
116 sampleNameHeaderHtml <- paste0("<th>sample</th><th>sample renamed</th>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
117 sampleNameHtml <- paste0("<td>",getSampleNames(xobject),"</td><td>",sampleNamesList$sampleNamesMakeNames,"</td>")
17
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
118 }
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
119
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
120 if (!exists("md5sumList")) {
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
121 md5sumHeaderHtml <- ""
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
122 md5sumHtml <- ""
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
123 md5sumLegend <- ""
5
11df21afc204 planemo upload
lecorguille
parents: 4
diff changeset
124 } else if (is.null(md5sumList$removalBadCharacters)) {
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
125 md5sumHeaderHtml <- paste0("<th>md5sum<sup>*</sup></th>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
126 md5sumHtml <- paste0("<td>",md5sumList$origin,"</td>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
127 md5sumLegend <- "<br/><sup>*</sup>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."
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
128 } else {
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
129 md5sumHeaderHtml <- paste0("<th>md5sum<sup>*</sup></th><th>md5sum<sup>**</sup> after bad characters removal</th>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
130 md5sumHtml <- paste0("<td>",md5sumList$origin,"</td><td>",md5sumList$removalBadCharacters,"</td>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
131 md5sumLegend <- "<br/><sup>*</sup>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.<br/><sup>**</sup>Because some bad characters (eg: accent) were removed from your original file, the checksum have changed too.<br/>"
17
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
132 }
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
133
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
134 writehtml("<tr>",sampleNameHeaderHtml,"<th>filename</th>",md5sumHeaderHtml,"</tr>")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
135 writehtml(paste0("<tr>",sampleNameHtml,"<td>",getFilePaths(xobject),"</td>",md5sumHtml,"</tr>"))
17
a2908411620e planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 22c4e92909198328fc7439ff47e4546a273eb907
lecorguille
parents: 11
diff changeset
136
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
137 writehtml("</table>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
138 writehtml(md5sumLegend)
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
139 writehtml("</div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
140
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
141 writehtml("<h2>Function launched:</h2>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
142 writehtml("<div><table>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
143 writehtml("<tr><th>timestamp<sup>***</sup></th><th>function</th><th>argument</th><th>value</th></tr>")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
144 # XCMS 3.x
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
145 if (class(xobject) == "XCMSnExp") {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
146 xcmsFunction <- NULL
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
147 params <- NULL
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
148 for (processHistoryItem in processHistory(xobject)) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
149 if ((xcmsFunction == processType(processHistoryItem)) && equalParams(params, processParam(processHistoryItem)))
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
150 next
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
151 timestamp <- processDate(processHistoryItem)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
152 xcmsFunction <- processType(processHistoryItem)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
153 params <- processParam(processHistoryItem)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
154 writehtml("<tr><td>",timestamp,"</td><td>",xcmsFunction,"</td><td colspan='2'><pre>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
155 writeraw(htmlOutput, params)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
156 writehtml("</pre></td></tr>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
157 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
158 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
159 # CAMERA and retrocompatability XCMS 1.x
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
160 if (exists("listOFlistArguments")) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
161 for(tool in names(listOFlistArguments)) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
162 listOFlistArgumentsDisplay <- listOFlistArguments[[tool]][!(names(listOFlistArguments[[tool]]) %in% argBlacklist)]
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
163
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
164 timestamp <- strsplit(tool,"_")[[1]][1]
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
165 xcmsFunction <- strsplit(tool,"_")[[1]][2]
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
166 writehtml("<tr><td rowspan='",length(listOFlistArgumentsDisplay),"'>",timestamp,"</td><td rowspan='",length(listOFlistArgumentsDisplay),"'>",xcmsFunction,"</td>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
167 line_begin <- ""
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
168 for (arg in names(listOFlistArgumentsDisplay)) {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
169 writehtml(line_begin,"<td>",arg,"</td><td>",unlist(listOFlistArgumentsDisplay[arg][1]),"</td></tr>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
170 line_begin <- "<tr>"
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
171 }
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
172 }
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
173 }
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
174 writehtml("</table>")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
175 writehtml("<br/><sup>***</sup>timestamp format: DD MM dd hh:mm:ss YYYY or yymmdd-hh:mm:ss")
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
176 writehtml("</div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
177
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
178 if (class(xobject) == "XCMSnExp") {
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
179 writehtml("<h2>Informations about the XCMSnExp object:</h2>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
180
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
181 writehtml("<div><pre>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
182 writeraw(htmlOutput, xobject)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
183 writehtml("</pre></div>")
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
184 }
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
185
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
186 writehtml("<h2>Informations about the xcmsSet object:</h2>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
187
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
188 writehtml("<div><pre>")
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
189 # Get the legacy xcmsSet object
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
190 xset <- getxcmsSetObject(xobject)
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
191 writeraw(htmlOutput, xset)
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
192 writehtml("</pre></div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
193
29
3d4339594010 planemo upload for repository https://github.com/workflow4metabolomics/xcms commit e384d6dd5f410799ec211f73bca0b5d5d7bc651e
lecorguille
parents: 25
diff changeset
194 # CAMERA
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
195 if (exists("xa")) {
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
196 writehtml("<h2>Informations about the CAMERA object:</h2>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
197
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
198 writehtml("<div>")
5
11df21afc204 planemo upload
lecorguille
parents: 4
diff changeset
199 writehtml("Number of pcgroup: ",length(xa@pspectra))
0
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
200 writehtml("</div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
201 }
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
202
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
203 writehtml("<h2>Citations:</h2>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
204 writehtml("<div><ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
205 writehtml("<li>To cite the <b>XCMS</b> package in publications use:")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
206 writehtml("<ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
207 writehtml("<li>","Smith, C.A. and Want, E.J. and O'Maille, G. and Abagyan,R. and Siuzdak, G.XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching and identification, Analytical Chemistry, 78:779-787 (2006)","</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
208 writehtml("<li>","Ralf Tautenhahn, Christoph Boettcher, Steffen Neumann: Highly sensitive feature detection for high resolution LC/MS BMC Bioinformatics, 9:504 (2008)","</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
209 writehtml("<li>","H. Paul Benton, Elizabeth J. Want and Timothy M. D. Ebbels Correction of mass calibration gaps in liquid chromatography-mass spectrometry metabolomics data Bioinformatics, 26:2488 (2010)","</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
210 writehtml("</ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
211 writehtml("</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
212
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
213 writehtml("<li>To cite the <b>CAMERA</b> package in publications use:")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
214 writehtml("<ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
215 writehtml("<li>","Kuhl, C., Tautenhahn, R., Boettcher, C., Larson, T. R. and Neumann,S. CAMERA: an integrated strategy for compound spectra extraction and annotation of liquid chromatography/mass spectrometry data sets. Analytical Chemistry, 84:283-289 (2012)","</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
216 writehtml("</ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
217 writehtml("</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
218
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
219 writehtml("<li>To cite the <b>Workflow4Metabolimics (W4M)</b> project in publications use:")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
220 writehtml("<ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
221 writehtml("<li>","Franck Giacomoni, Gildas Le Corguillé, Misharl Monsoor, Marion Landi, Pierre Pericard, Mélanie Pétéra, Christophe Duperier, Marie Tremblay-Franco, Jean-François Martin, Daniel Jacob, Sophie Goulitquer, Etienne A. Thévenot and Christophe Caron (2014). Workflow4Metabolomics: A collaborative research infrastructure for computational metabolomics. Bioinformatics doi:10.1093/bioinformatics/btu813","</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
222 writehtml("</ul>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
223 writehtml("</li>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
224 writehtml("</ul></div>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
225
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
226 writehtml("</BODY>")
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
227
6260844b9a17 planemo upload
lecorguille
parents:
diff changeset
228 writehtml("</HTML>")