annotate RnBeadsGalaxy.R @ 39:c8fcc50e1263 draft

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