annotate RnBeadsGalaxy.R @ 43:39b78c48d064 draft

Uploaded
author pavlo-lutsik
date Fri, 05 Jul 2013 17:39:25 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
1 #msg.file<-file("RnBeads.messages.out", open="w")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
2 #sink(file=msg.file)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
3
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
4
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
5 ## add the RnBeads dependencies if we are on a cloud share-instance
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
6 if("Rsitelibrary" %in% list.files("/mnt")){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
7
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
8 .libPaths("/mnt/galaxy/Rsitelibrary")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
9
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
10
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
11 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
12
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
13 if(!'wordcloud' %in% rownames(installed.packages())){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
14 install.packages('wordcloud',repos='http://cran.us.r-project.org')
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
15 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
16
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
17 suppressWarnings(suppressPackageStartupMessages(library(RnBeads)))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
18 suppressWarnings(suppressPackageStartupMessages(library(getopt)))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
19
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
20 #all.opts<-names(rnb.options())
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
21 opt.class<-RnBeads:::OPTION.TYPES[-28]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
22 all.opts<-names(opt.class)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
23 #all.opts<-paste("--", all.opts, sep="")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
24 #all.opts<-gsub("\\.([a-z])", "\\U\\1", all.opts, perl=TRUE)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
25 all.opts<-gsub("\\.","-", all.opts)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
26 #opt.class<-sapply(rnb.options(), class)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
27
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
28 rnb.opt.spec<-data.frame(
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
29 Long=all.opts,
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
30 Short=as.character(1:length(all.opts)),
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
31 Mask=c(1,2)[as.integer((opt.class=="logical"))+1],
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
32 Type=opt.class)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
33
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
34 ### automated xml file preparation
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
35 xml.strings<-apply(rnb.opt.spec,1, function(row){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
36
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
37 opt.lab<-gsub("-", ".", row[1])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
38 opt.def.val<-rnb.getOption(opt.lab)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
39 opt.name<-gsub("-([0-9a-z])", "\\U\\1", row[1], perl=TRUE)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
40 tf.opt<-"\t\t\t<option value=\"True\">True</option>\n\t\t\t<option value=\"False\">False</option>"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
41 opt.lab<-paste(opt.lab, gsub("\\."," ", row[4]), sep=", ")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
42 if(row[4]=="logical"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
43 opt.type<-'select'
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
44 if(!is.null(opt.def.val) && opt.def.val)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
45 opt.def.val<-"1" else
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
46 opt.def.val<-"0"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
47 string<-sprintf("\t\t<param name=\"%s\" type=\"%s\" label=\"%s\" value=\"%s\">\n%s\n\t\t</param>\n", opt.name, opt.type, opt.lab, opt.def.val, tf.opt)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
48 }else{
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
49 opt.type<-'text'
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
50 if(!is.null(opt.def.val) && opt.def.val!="")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
51 opt.def.val<-paste(opt.def.val, collapse=",") else
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
52 opt.def.val<-""
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
53 string<-sprintf("\t\t<param name=\"%s\" type=\"%s\" label=\"%s\" value=\"%s\"/>\n", opt.name, opt.type, opt.lab, opt.def.val)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
54 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
55 string
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
56 })
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
57
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
58 cat(xml.strings, sep="", file="automated.settings.xml.txt")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
59
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
60 opt.def.strings<-apply(rnb.opt.spec,1, function(row){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
61
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
62 opt.name<-gsub("-([0-9a-z])", "\\U\\1", row[1], perl=TRUE)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
63 opt.long<-row[1]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
64 opt.short<-row[2]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
65
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
66 if(row[4]=="logical"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
67 def.string<-sprintf("#if str( $options.%s ) == \"True\"\n\t--%s\n#end if\n", opt.name, opt.long)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
68 }else{
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
69 def.string<-sprintf("#if str( $options.%s ) != \"\"\n\t--%s=\"$options.%s\" \n#end if\n", opt.name, opt.long, opt.name)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
70 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
71 def.string
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
72
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
73 })
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
74 cat(opt.def.strings, sep="", file="automated.option.assignments.txt")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
75
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
76
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
77 rnb.opt.spec$Type<-gsub("\\.vector", "", rnb.opt.spec$Type)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
78 rnb.opt.spec$Type<-gsub("numeric", "double", rnb.opt.spec$Type)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
79 rnb.opt.spec<-rbind(data.frame(
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
80 Long=c("data-type", "pheno", "idat-dir","idat-files","bed-files", "gs-report", "geo-series", "betas", "pvals","output-file", "report-dir"),
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
81 Short=c("d","s","a","i","f","g","e","b","p","r","o"),
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
82 Mask=c(1,2,2,2,2,2,2,2,2,1,1),
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
83 Type=c("character","character","character","character","character","character","character","character","character","character", "character")),
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
84 rnb.opt.spec)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
85
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
86 opts<-getopt(as.matrix(rnb.opt.spec))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
87 #opts<-getopt(as.matrix(rnb.opt.spec), opt=list("--data-type=idats","--report-dir=dir", "--idats=file1\tfile2"))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
88 print(opts)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
89
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
90 if(opts[["data-type"]]=="idatDir"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
91
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
92 data.source<-list()
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
93 data.type<-"idat.dir"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
94 data.source[["idat.dir"]]<-opts[["idat-dir"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
95 data.source[["sample.sheet"]]<-opts[["pheno"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
96
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
97 }else if(opts[["data-type"]]=="idatFiles"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
98
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
99 data.type<-"idat.dir"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
100 file.string<-gsub(" ","", opts[["idat-files"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
101 files<-strsplit(file.string, ",")[[1]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
102 files<-files[files!=""]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
103 bed.dir<-sprintf("%s_beds",opts[["report-dir"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
104 dir.create(bed.dir)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
105 file.copy(files, bed.dir)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
106 for(dat.file in list.files(bed.dir, full.names = TRUE)){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
107 file.rename(dat.file, gsub("\\.dat", ".bed", dat.file))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
108 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
109 data.source<-list()
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
110 data.source[["bed.dir"]]<-bed.dir
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
111 data.source[["sample.sheet"]]<-opts[["pheno"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
112
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
113
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
114 }else if(opts[["data-type"]]=="GS.report"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
115
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
116 data.type<-"GS.report"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
117 data.source<-opts[["gs-report"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
118
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
119 }else if(opts[["data-type"]]=="GEO"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
120
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
121 data.type<-"GEO"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
122 data.source<-opts[["geo-series"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
123
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
124 }else if(opts[["data-type"]]=="data.files"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
125
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
126 data.type<-"GEO"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
127 data.source<-opts[["geo-series"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
128
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
129 }else if(opts[["data-type"]]=="data.files"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
130
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
131 data.type<-"data.files"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
132 data.source<-c(opts[["pheno"]], opts[["betas"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
133 if(!is.null(opts[["pvals"]]))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
134 data.source<-c(data.source, opts[["pvals"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
135
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
136 }else if(opts[["data-type"]]=="bed.dir"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
137
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
138 data.type<-"bed.dir"
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
139 file.string<-gsub(" ","", opts[["bed-files"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
140 files<-strsplit(file.string, ",")[[1]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
141 files<-files[files!=""]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
142 bed.dir<-sprintf("%s_beds",opts[["report-dir"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
143 dir.create(bed.dir)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
144 file.copy(files, bed.dir)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
145 for(dat.file in list.files(bed.dir, full.names = TRUE)){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
146 file.rename(dat.file, gsub("\\.dat", ".bed", dat.file))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
147 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
148 data.source<-list()
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
149 data.source[["bed.dir"]]<-bed.dir
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
150
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
151 logger.start(fname="NA")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
152 sample.sheet<-rnb.read.annotation(opts[["pheno"]])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
153 logger.close()
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
154 if(length(files) < nrow(sample.sheet))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
155 stop("Not all bed files are present")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
156
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
157 cn<-colnames(sample.sheet)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
158 dat.files<-sapply(strsplit(files, "\\/"), function(el) el[length(el)])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
159 sample.sheet<-cbind(sample.sheet, gsub("\\.dat", ".bed", dat.files))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
160 colnames(sample.sheet)<-c(cn, "BED_files")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
161 data.source[["sample.sheet"]]<-sample.sheet
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
162 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
163
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
164 if("logging" %in% names(opts)){ # TODO create a cleaner way of checking whether the full options set was supplied
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
165
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
166 dump<-sapply(names(opt.class), function(on){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
167 getoptname<-gsub("-", "\\.","-",on)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
168 if(getoptname %in% names(opts)){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
169 if(opt.class[on]=="logical"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
170 ov<-TRUE
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
171 }else if(opt.class %in% c("character","character.vector")){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
172 ov<-opts[[getoptname]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
173 ov<-gsub("\"", "", ov)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
174 if(opt.class=="character.vector"){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
175 ov<-as.character(strsplit(ov,","))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
176 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
177
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
178 }else if(opt.class %in% c("integer","numeric","integer.vector","numeric.vector")){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
179 ov<-opts[[getoptname]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
180 ov<-gsub("\"", "", ov)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
181 if(opt.class %in% c("integer.vector","numeric.vector")){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
182 ov<-as.character(strsplit(ov,","))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
183 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
184 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
185 eval(parse(text=sprintf("rnb.options(%s=ov)",on)))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
186 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
187 })
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
188
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
189 logical.opts<-names(opt.class[opt.class=="logical"])
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
190 logical.opts.false<-logical.opts[!logical.opts %in% gsub("-",".",names(opts))]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
191
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
192
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
193 dump<-sapply(logical.opts.false, function(on){
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
194 eval(parse(text=sprintf("rnb.options(%s=FALSE)",on)))
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
195 })
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
196 }
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
197
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
198 print(rnb.options())
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
199
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
200 #report.out.dir<-sprintf("%s_rnbReport", tempdir())
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
201 report.out.dir<-opts[["report-dir"]]
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
202 print("Starting RnBeads with the following inputs:")
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
203 print(data.source)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
204 print(report.out.dir)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
205 print(data.type)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
206 rnb.run.analysis(data.source=data.source, dir.report=report.out.dir, data.type=data.type)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
207
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
208
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
209 #sink(file=NULL)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
210 #flush(msg.file)
39b78c48d064 Uploaded
pavlo-lutsik
parents:
diff changeset
211 #close(msg.file)