git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/crlmm@52847 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -143,16 +143,40 @@ plate <- samplesheet$Plate |
143 | 143 |
table(plate) |
144 | 144 |
## too few samples to run the plates as separate batches |
145 | 145 |
batch <- as.factor(rep("1", nrow(samplesheet))) |
146 |
-container <- checkExists("container", .path=outdir, |
|
147 |
- .FUN=crlmm:::genotype.Illumina, |
|
148 |
- sampleSheet=samplesheet, |
|
149 |
- path=dirname(arrayNames[1]), |
|
150 |
- arrayInfoColNames=list(barcode=NULL, position="SentrixPosition"), |
|
151 |
- cdfName="human370v1c", |
|
152 |
- batch=batch, |
|
153 |
- .load.it=load.it) |
|
154 |
-cnSet <- checkExists("cnSet", .path=outdir, .FUN=crlmmCopynumber, object=container, .load.it="FALSE", |
|
155 |
- GT.CONF.THR=0.8) |
|
146 |
+if(!exists("crlmmResult")){ |
|
147 |
+ if(!file.exists(file.path(outdir, "crlmmResult.rda"))){ |
|
148 |
+ RG <- readIdatFiles(samplesheet, |
|
149 |
+ path=dirname(arrayNames[1]), |
|
150 |
+ arrayInfoColNames=list(barcode=NULL, position="SentrixPosition"), |
|
151 |
+ saveDate=TRUE) |
|
152 |
+ crlmmResult <- crlmmIllumina(RG=RG, |
|
153 |
+ cdfName="human370v1c", |
|
154 |
+ sns=pData(RG)$ID, |
|
155 |
+ returnParams=TRUE, |
|
156 |
+ cnFile=file.path(outdir, "cnFile.rda"), |
|
157 |
+ snpFile=file.path(outdir, "snpFile.rda"), |
|
158 |
+ save.it=TRUE) |
|
159 |
+ protocolData(crlmmResult)$ScanDate <- protocolData(RG)$ScanDate |
|
160 |
+ range(protocolData(crlmmResult)$ScanDate) |
|
161 |
+ save(crlmmResult, file=file.path(outdir, "crlmmResult.rda")) |
|
162 |
+ rm(RG); gc() |
|
163 |
+ } else{ |
|
164 |
+ message("Loading previously saved file...") |
|
165 |
+ load(file.path(outdir, "crlmmResult.rda")) |
|
166 |
+ } |
|
167 |
+} |
|
168 |
+##container <- checkExists("container", .path=outdir, |
|
169 |
+## .FUN=crlmm:::genotype.Illumina, |
|
170 |
+## sampleSheet=samplesheet, |
|
171 |
+## path=dirname(arrayNames[1]), |
|
172 |
+## arrayInfoColNames=list(barcode=NULL, position="SentrixPosition"), |
|
173 |
+## cdfName="human370v1c", |
|
174 |
+## batch=batch, |
|
175 |
+## .load.it=load.it) |
|
176 |
+##GT.CONF.THR <- 0.8 |
|
177 |
+##cnSet <- checkExists("cnSet", .path=outdir, .FUN=crlmmCopynumber, object=container, .load.it=load.it, |
|
178 |
+## GT.CONF.THR=GT.CONF.THR) |
|
179 |
+q("no") |
|
156 | 180 |
@ |
157 | 181 |
|
158 | 182 |
The \Robject{cnSet} returned by the \Rfunction{crlmmCopynumber} |