annotate ImportDataFromMatrix.R @ 4:58052f8bc987 draft

planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 8d4651e98155855108d1c4574392d503cc04bc95
author sblanck
date Thu, 01 Mar 2018 05:22:24 -0500
parents 1024245abc70
children 3ce32282f6a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
1 #!/usr/bin/env Rscript
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
2 # setup R error handling to go to stderr
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
3 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
4
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
5 # we need that to not crash galaxy with an UTF8 error on German LC settings.
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
6 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
7
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
8 library("optparse")
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
9
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
10 ##### Read options
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
11 option_list=list(
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
12 make_option("--input",type="character",default="NULL",help="rdata object containing eset object"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
13 make_option("--conditions",type="character",default=NULL,help="Text file summarizing conditions of the experiment (required)"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
14 make_option("--normalization",type="character",default=NULL,help="log2 transformation"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
15 make_option("--annotations",type="character",default="NULL",help="rdata object containing eset object"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
16 make_option("--rdataoutput",type="character",default="NULL",help="output rdata object containing eset object"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
17 make_option("--htmloutput",type="character",default=NULL,help="Output html report"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
18 make_option("--htmloutputpath",type="character",default="NULL",help="Path of output html report"),
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
19 make_option("--htmltemplate",type="character",default="NULL",help="html template)")
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
20
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
21
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
22 );
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
23
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
24
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
25 opt_parser = OptionParser(option_list=option_list);
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
26 opt = parse_args(opt_parser);
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
27
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
28 if(is.null(opt$input)){
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
29 print_help(opt_parser)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
30 stop("input required.", call.=FALSE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
31 }
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
32
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
33 if(is.null(opt$conditions)){
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
34 print_help(opt_parser)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
35 stop("conditions input required.", call.=FALSE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
36 }
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
37
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
38
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
39 #loading libraries
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
40 suppressPackageStartupMessages(require(GEOquery))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
41
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
42 suppressPackageStartupMessages(require(Biobase))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
43 suppressPackageStartupMessages(require(GEOquery))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
44 suppressPackageStartupMessages(require(GEOmetadb))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
45 suppressPackageStartupMessages(require(limma))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
46 suppressPackageStartupMessages(require(jsonlite))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
47 suppressPackageStartupMessages(require(affy))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
48 suppressPackageStartupMessages(require(dplyr))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
49 suppressPackageStartupMessages(require(affyPLM))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
50
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
51 dataFile=opt$input
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
52 normalization=opt$normalization
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
53 conditionsFile=opt$conditions
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
54 annotation=opt$annotations
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
55 result_export_eset=opt$rdataoutput
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
56 result=opt$htmloutput
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
57 result.path=opt$htmloutputpath
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
58 result.template=opt$htmltemplate
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
59
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
60 dir.create(result.path, showWarnings = TRUE, recursive = FALSE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
61
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
62 data=as.matrix(read.table(file = dataFile,row.names=1,header=TRUE))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
63 conditions=read.table(file=conditionsFile,sep = "\t",row.names=1)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
64 htmlfile=readChar(result.template, file.info(result.template)$size)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
65
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
66 colnames(conditions)=c("source_name_ch1","description")
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
67 phenodata<-new("AnnotatedDataFrame",data=conditions)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
68
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
69 head(data)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
70 conditions
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
71
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
72 eset=ExpressionSet(assayData=data,phenoData=phenodata,annotation=annotation)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
73
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
74 if (normalization == "quantile") {
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
75 eset <- normalize.ExpressionSet.quantiles(eset, transfn="log2")
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
76 } else if (normalization == "log2") {
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
77 exprs(eset) = log2(exprs(eset))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
78 }
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
79
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
80 boxplotnorm="boxplotnorm.png"
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
81 png(boxplotnorm,width=800,height = 400)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
82 par(mar=c(7,5,1,1))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
83 boxplot(data.frame(exprs(eset)),las=2,outline=FALSE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
84 dev.off()
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
85 htmlfile=gsub(x=htmlfile,pattern = "###BOXPLOTNORM###",replacement = boxplotnorm, fixed = TRUE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
86 file.copy(boxplotnorm,result.path)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
87
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
88 plotMAnorm="plotMAnorm.png"
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
89 nblines=length(colnames(data))%/%3 + as.numeric((length(colnames(data))%%3)!=0)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
90 png(plotMAnorm,width=800,height =300*nblines )
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
91 par(mfrow=c(nblines,3))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
92 ##for (i in 1:length(colnames(data))){
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
93 MAplot(eset)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
94 #}
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
95
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
96 dev.off()
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
97 htmlfile=gsub(x=htmlfile,pattern = "###PLOTMANORM###",replacement = plotMAnorm, fixed = TRUE)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
98 file.copy(plotMAnorm,result.path)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
99 #write.table(tolower(c(condition1Name,condition2Name)),quote = FALSE,col.names = FALSE, row.names=FALSE,file=result_export_conditions)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
100 #saveConditions=c(condition1Name,condition2Name)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
101 save(eset,file=result_export_eset)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
102 write(htmlfile,result)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
103
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
104 #l=list()
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
105 #for(i in 1:length(esets))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
106 #{
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
107 # l[[paste("study",i,sep="")]]<-res[[i]]
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
108 #}
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
109 #l[["Meta"]]=res[[length(res)-1]]
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
110 #showVenn(res,file.path(temp.files.path,"venn.png"))
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
111 #writeLines(c("<h2>Venn diagram</h2>"),file.conn)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
112 #writeLines(c("<img src='venn.png'><br/><br/>"),file.conn)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
113 #writeLines(c("</body></html>"),file.conn)
1024245abc70 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 5974f806f344dbcc384b931492d7f023bfbbe03b
sblanck
parents:
diff changeset
114 #close(file.conn)