comparison xcms_differential_analysis.r @ 8:ddef5534c294

new tool diffreport
author pieter.lukasse@wur.nl
date Thu, 06 Nov 2014 13:06:25 +0100
parents 627ddbd15823
children
comparison
equal deleted inserted replaced
7:504be42b4927 8:ddef5534c294
36 36
37 ## load the constructed DB : 37 ## load the constructed DB :
38 xcmsSet <- readRDS(args.xsetData) 38 xcmsSet <- readRDS(args.xsetData)
39 39
40 # info: levels(xcmsSet@phenoData$class) also gives access to the class names 40 # info: levels(xcmsSet@phenoData$class) also gives access to the class names
41 41 dir.create(file.path(args.htmlReportFile.files_path), showWarnings = FALSE)
42 reporttab <- diffreport(xcmsSet, args.class1, args.class2, args.htmlReportFile.files_path, args.topcount, metlin = 0.15, h=480, w=640) 42 reporttab <- diffreport(xcmsSet, args.class1, args.class2, paste(args.htmlReportFile.files_path,"/fig", sep=""), args.topcount, metlin = 0.15, h=480, w=640)
43 43
44 # write out tsv table: 44 # write out tsv table:
45 write.table(reporttab, args.outTable, sep="\t", row.names=FALSE) 45 write.table(reporttab, args.outTable, sep="\t", row.names=FALSE)
46 46
47 message("\nGenerating report.........") 47 message("\nGenerating report.........")
48 # report
49 dir.create(file.path(args.htmlReportFile.files_path), showWarnings = FALSE)
50 # setwd(file.path(args.htmlReportFile.files_path))
51 file.rename("fig_eic", paste(args.htmlReportFile.files_path, "/fig_eic"))
52
53 48
54 cat("<html><body><h1>Differential analysis report</h1>", file= args.htmlReportFile) 49 cat("<html><body><h1>Differential analysis report</h1>", file= args.htmlReportFile)
55 #HTML(reporttab[1:args.topcount,], file= args.htmlReportFile) 50 #HTML(reporttab[1:args.topcount,], file= args.htmlReportFile)
56 figuresPath <- paste(args.htmlReportFile.files_path, "_eic", sep="") 51 figuresPath <- paste(args.htmlReportFile.files_path, "/fig_eic", sep="")
57 message(figuresPath) 52 message(figuresPath)
58 listOfFiles <- list.files(path = figuresPath) 53 listOfFiles <- list.files(path = figuresPath)
59 for (i in 1:length(listOfFiles)) 54 for (i in 1:length(listOfFiles))
60 { 55 {
61 figureName <- listOfFiles[i] 56 figureName <- listOfFiles[i]