Browse code

Revised accesors in methods-AssayData -- some of the conflicts resolved by hand during rebase were incorrect

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/crlmm@49140 bc3139a8-67e5-0310-9ffc-ced21a209358

Rob Scharp authored on 30/08/2010 19:41:03
Showing3 changed files

... ...
@@ -56,7 +56,7 @@ importFrom(mvtnorm, dmvnorm)
56 56
 
57 57
 importFrom(ellipse, ellipse)
58 58
 
59
-importFrom(ff, ffdf, physical.ff, physical.ffdf)
59
+importFrom(ff, ffdf, physical.ff, physical.ffdf, ffrowapply)
60 60
 
61 61
 ## It is important not to import these classes from oligoClasses
62 62
 ## Doing so causes the following errors:
... ...
@@ -66,7 +66,8 @@ importFrom(ff, ffdf, physical.ff, physical.ffdf)
66 66
 ##importClassesFrom(oligoClasses, ffdf, ff_matrix)
67 67
 
68 68
 ## Important to export these classes
69
-exportClasses(ff_or_matrix, ff_matrix, ffdf)
69
+##exportClasses(ff_or_matrix, ff_matrix, ffdf)
70
+exportClasses(ff_or_matrix)
70 71
 exportMethods(lines)
71 72
 exportMethods(CA, CB)
72 73
 export(crlmm,
... ...
@@ -1887,7 +1887,7 @@ estimateCnParameters <- function(object,
1887 1887
 			      index.list=list(marker.index),
1888 1888
 			      marker.index=marker.index,
1889 1889
 			      object=object,
1890
-			      batchSize=batchSize,
1890
+			      batchSize=ocProbesets(),
1891 1891
 			      SNRMin=SNRMin,
1892 1892
 			      MIN.SAMPLES=MIN.SAMPLES,
1893 1893
 			      MIN.OBS=MIN.OBS,
... ...
@@ -24,30 +24,6 @@ setMethod("Ns", signature(object="AssayData"),
24 24
 		  res <- array(NA, dim=c(nrow(N.AA), 3, ncol(N.AA)))
25 25
 		  dimnames(res)[[2]] <- c("AA", "AB", "BB")
26 26
 		  dimnames(res)[[3]] <- batchnames
27
-		  if(missing(i) & missing(j)){
28
-			  N.AA <- as.matrix(assayDataElement(object, "N.AA"))
29
-			  N.AB <- as.matrix(assayDataElement(object, "N.AB"))
30
-			  N.BB <- as.matrix(assayDataElement(object, "N.BB"))
31
-		  }
32
-		  if(missing(i) & !missing(j)){
33
-			  J <- match(batchnames, batchNames(object))
34
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
35
-			  N.AA <- as.matrix(assayDataElement(object, "N.AA"))[, J, ...]
36
-			  N.AB <- as.matrix(assayDataElement(object, "N.AB"))[, J, ...]
37
-			  N.BB <- as.matrix(assayDataElement(object, "N.BB"))[, J, ...]
38
-		  }
39
-		  if(!missing(i) & !missing(j)){
40
-			  J <- match(batchnames, batchNames(object))
41
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
42
-			  N.AA <- as.matrix(assayDataElement(object, "N.AA"))[i, J, ...]
43
-			  N.AB <- as.matrix(assayDataElement(object, "N.AB"))[i, J, ...]
44
-			  N.BB <- as.matrix(assayDataElement(object, "N.BB"))[i, J, ...]
45
-		  }
46
-		  if(!missing(i) & missing(j)){
47
-			  N.AA <- as.matrix(assayDataElement(object, "N.AA"))[i, , ...]
48
-			  N.AB <- as.matrix(assayDataElement(object, "N.AB"))[i, , ...]
49
-			  N.BB <- as.matrix(assayDataElement(object, "N.BB"))[i, , ...]
50
-		  }
51 27
 		  res[, "AA", ] <- N.AA
52 28
 		  res[, "AB", ] <- N.AB
53 29
 		  res[, "BB", ] <- N.BB
... ...
@@ -79,30 +55,6 @@ setMethod("corr", signature(object="AssayData"),
79 55
 		  res <- array(NA, dim=c(nrow(corrAA), 3, ncol(corrAA)))
80 56
 		  dimnames(res)[[2]] <- c("AA", "AB", "BB")
81 57
 		  dimnames(res)[[3]] <- batchnames
82
-		  if(missing(i) & missing(j)){
83
-			  corrAA <- as.matrix(assayDataElement(object, "corrAA"))
84
-			  corrAB <- as.matrix(assayDataElement(object, "corrAB"))
85
-			  corrBB <- as.matrix(assayDataElement(object, "corrBB"))
86
-		  }
87
-		  if(missing(i) & !missing(j)){
88
-			  J <- match(batchnames, batchNames(object))
89
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
90
-			  corrAA <- as.matrix(assayDataElement(object, "corrAA"))[, J, ...]
91
-			  corrAB <- as.matrix(assayDataElement(object, "corrAB"))[, J, ...]
92
-			  corrBB <- as.matrix(assayDataElement(object, "corrBB"))[, J, ...]
93
-		  }
94
-		  if(!missing(i) & !missing(j)){
95
-			  J <- match(batchnames, batchNames(object))
96
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
97
-			  corrAA <- as.matrix(assayDataElement(object, "corrAA"))[i, J, ...]
98
-			  corrAB <- as.matrix(assayDataElement(object, "corrAB"))[i, J, ...]
99
-			  corrBB <- as.matrix(assayDataElement(object, "corrBB"))[i, J, ...]
100
-		  }
101
-		  if(!missing(i) & missing(j)){
102
-			  corrAA <- as.matrix(assayDataElement(object, "corrAA"))[i, , ...]
103
-			  corrAB <- as.matrix(assayDataElement(object, "corrAB"))[i, , ...]
104
-			  corrBB <- as.matrix(assayDataElement(object, "corrBB"))[i, , ...]
105
-		  }
106 58
 		  res[, "AA", ] <- corrAA
107 59
 		  res[, "AB", ] <- corrAB
108 60
 		  res[, "BB", ] <- corrBB
... ...
@@ -128,43 +80,6 @@ setMethod("medians", signature(object="AssayData"),
128 80
 		  dimnames(res)[[2]] <- c("A", "B")
129 81
 		  dimnames(res)[[3]] <- c("AA", "AB", "BB")
130 82
 		  dimnames(res)[[4]] <- batchnames
131
-		  if(missing(i) & missing(j)){
132
-			  medianA.AA <- as.matrix(assayDataElement(object, "medianA.AA"))
133
-			  medianA.AB <- as.matrix(assayDataElement(object, "medianA.AB"))
134
-			  medianA.BB <- as.matrix(assayDataElement(object, "medianA.BB"))
135
-			  medianB.AA <- as.matrix(assayDataElement(object, "medianB.AA"))
136
-			  medianB.AB <- as.matrix(assayDataElement(object, "medianB.AB"))
137
-			  medianB.BB <- as.matrix(assayDataElement(object, "medianB.BB"))
138
-		  }
139
-		  if(missing(i) & !missing(j)){
140
-			  J <- match(batchnames, batchNames(object))
141
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
142
-			  medianA.AA <- as.matrix(assayDataElement(object, "medianA.AA"))[, J, ...]
143
-			  medianA.AB <- as.matrix(assayDataElement(object, "medianA.AB"))[, J, ...]
144
-			  medianA.BB <- as.matrix(assayDataElement(object, "medianA.BB"))[, J, ...]
145
-			  medianB.AA <- as.matrix(assayDataElement(object, "medianB.AA"))[, J, ...]
146
-			  medianB.AB <- as.matrix(assayDataElement(object, "medianB.AB"))[, J, ...]
147
-			  medianB.BB <- as.matrix(assayDataElement(object, "medianB.BB"))[, J, ...]
148
-
149
-		  }
150
-		  if(!missing(i) & !missing(j)){
151
-			  J <- match(batchnames, batchNames(object))
152
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
153
-			  medianA.AA <- as.matrix(assayDataElement(object, "medianA.AA"))[i, J, ...]
154
-			  medianA.AB <- as.matrix(assayDataElement(object, "medianA.AB"))[i, J, ...]
155
-			  medianA.BB <- as.matrix(assayDataElement(object, "medianA.BB"))[i, J, ...]
156
-			  medianB.AA <- as.matrix(assayDataElement(object, "medianB.AA"))[i, J, ...]
157
-			  medianB.AB <- as.matrix(assayDataElement(object, "medianB.AB"))[i, J, ...]
158
-			  medianB.BB <- as.matrix(assayDataElement(object, "medianB.BB"))[i, J, ...]
159
-		  }
160
-		  if(!missing(i) & missing(j)){
161
-			  medianA.AA <- as.matrix(assayDataElement(object, "medianA.AA"))[i, ...]
162
-			  medianA.AB <- as.matrix(assayDataElement(object, "medianA.AB"))[i, ...]
163
-			  medianA.BB <- as.matrix(assayDataElement(object, "medianA.BB"))[i, ...]
164
-			  medianB.AA <- as.matrix(assayDataElement(object, "medianB.AA"))[i, ...]
165
-			  medianB.AB <- as.matrix(assayDataElement(object, "medianB.AB"))[i, ...]
166
-			  medianB.BB <- as.matrix(assayDataElement(object, "medianB.BB"))[i, ...]
167
-		  }
168 83
 		  res[, "A", "AA", ] <- medianA.AA
169 84
 		  res[, "A", "AB", ] <- medianA.AB
170 85
 		  res[, "A", "BB", ] <- medianA.BB
... ...
@@ -193,43 +108,6 @@ setMethod("mads", signature(object="AssayData"),
193 108
 		  dimnames(res)[[2]] <- c("A", "B")
194 109
 		  dimnames(res)[[3]] <- c("AA", "AB", "BB")
195 110
 		  dimnames(res)[[4]] <- batchnames
196
-		  if(missing(i) & missing(j)){
197
-			  madA.AA <- as.matrix(assayDataElement(object, "madA.AA"))
198
-			  madA.AB <- as.matrix(assayDataElement(object, "madA.AB"))
199
-			  madA.BB <- as.matrix(assayDataElement(object, "madA.BB"))
200
-			  madB.AA <- as.matrix(assayDataElement(object, "madB.AA"))
201
-			  madB.AB <- as.matrix(assayDataElement(object, "madB.AB"))
202
-			  madB.BB <- as.matrix(assayDataElement(object, "madB.BB"))
203
-		  }
204
-		  if(missing(i) & !missing(j)){
205
-			  J <- match(batchnames, batchNames(object))
206
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
207
-			  madA.AA <- as.matrix(assayDataElement(object, "madA.AA"))[, J, ...]
208
-			  madA.AB <- as.matrix(assayDataElement(object, "madA.AB"))[, J, ...]
209
-			  madA.BB <- as.matrix(assayDataElement(object, "madA.BB"))[, J, ...]
210
-			  madB.AA <- as.matrix(assayDataElement(object, "madB.AA"))[, J, ...]
211
-			  madB.AB <- as.matrix(assayDataElement(object, "madB.AB"))[, J, ...]
212
-			  madB.BB <- as.matrix(assayDataElement(object, "madB.BB"))[, J, ...]
213
-
214
-		  }
215
-		  if(!missing(i) & !missing(j)){
216
-			  J <- match(batchnames, batchNames(object))
217
-			  stopifnot(length(J) > 0 & !all(is.na(J)))
218
-			  madA.AA <- as.matrix(assayDataElement(object, "madA.AA"))[i, J, ...]
219
-			  madA.AB <- as.matrix(assayDataElement(object, "madA.AB"))[i, J, ...]
220
-			  madA.BB <- as.matrix(assayDataElement(object, "madA.BB"))[i, J, ...]
221
-			  madB.AA <- as.matrix(assayDataElement(object, "madB.AA"))[i, J, ...]
222
-			  madB.AB <- as.matrix(assayDataElement(object, "madB.AB"))[i, J, ...]
223
-			  madB.BB <- as.matrix(assayDataElement(object, "madB.BB"))[i, J, ...]
224
-		  }
225
-		  if(!missing(i) & missing(j)){
226
-			  madA.AA <- as.matrix(assayDataElement(object, "madA.AA"))[i, ...]
227
-			  madA.AB <- as.matrix(assayDataElement(object, "madA.AB"))[i, ...]
228
-			  madA.BB <- as.matrix(assayDataElement(object, "madA.BB"))[i, ...]
229
-			  madB.AA <- as.matrix(assayDataElement(object, "madB.AA"))[i, ...]
230
-			  madB.AB <- as.matrix(assayDataElement(object, "madB.AB"))[i, ...]
231
-			  madB.BB <- as.matrix(assayDataElement(object, "madB.BB"))[i, ...]
232
-		  }
233 111
 		  res[, "A", "AA", ] <- madA.AA
234 112
 		  res[, "A", "AB", ] <- madA.AB
235 113
 		  res[, "A", "BB", ] <- madA.BB