Browse code

Commented CA<- CB<- assigments in fit.lm3 function (chr X polymorphic markers)

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

Rob Scharp authored on 21/08/2010 02:47:54
Showing 1 changed files

... ...
@@ -836,7 +836,7 @@ fit.lm1 <- function(idxBatch,
836 836
 	flags <- nuA <- nuB <- phiA <- phiB <- corrAB
837 837
 
838 838
 	normal.snps <- normal[snps, ]
839
-	cB <- cA <- matrix(NA, length(snps), ncol(object))
839
+	##cB <- cA <- matrix(NA, length(snps), ncol(object))
840 840
 	GG <- as.matrix(calls(object)[snps, ])
841 841
 	CP <- as.matrix(snpCallProbability(object)[snps, ])
842 842
 	AA <- as.matrix(A(object)[snps, ])
... ...
@@ -1044,8 +1044,7 @@ fit.lm2 <- function(idxBatch,
1044 1044
 	open(snpflags)
1045 1045
 	open(normal)
1046 1046
 
1047
-	
1048
-	cA <- matrix(NA, length(snps), ncol(object))
1047
+##	cA <- matrix(NA, length(snps), ncol(object))
1049 1048
 	ii <- isSnp(object) & chromosome(object) < 23 & !is.na(chromosome(object))
1050 1049
 	flags <- as.matrix(snpflags[,])  
1051 1050
 	noflags <- rowSums(flags, na.rm=TRUE) == 0  ##NA's for unevaluated batches
... ...
@@ -1158,7 +1157,7 @@ fit.lm3 <- function(idxBatch,
1158 1157
 	corrAB <- corrBB <- corrAA <- sig2B <- sig2A <- tau2B <- tau2A <- matrix(NA, length(snps), length(unique(batch(object))))
1159 1158
 	phiA2 <- phiB2 <- tau2A
1160 1159
 	flags <- nuA <- nuB <- phiA <- phiB <- corrAB
1161
-	cB <- cA <- matrix(NA, length(snps), ncol(object))
1160
+##	cB <- cA <- matrix(NA, length(snps), ncol(object))
1162 1161
 	gender <- object$gender
1163 1162
 	IX <- matrix(gender, length(snps), ncol(object))
1164 1163
 	NORM <- normal[snps,]
... ...
@@ -1298,28 +1297,27 @@ fit.lm3 <- function(idxBatch,
1298 1297
 			phiB2[phiB2[, J] < MIN.PHI, J] <- MIN.PHI
1299 1298
 		}
1300 1299
 		phistar <- phiB2[, J]/phiA[, J]
1301
-		tmp <- (B-nuB[, J] - phistar*A + phistar*nuA[, J])/phiB[, J]
1302
-		cB[, k] <- tmp/(1-phistar*phiA2[, J]/phiB[, J])
1303
-		cA[, k] <- (A-nuA[, J]-phiA2[, J]*cB[, k])/phiA[, J]
1300
+##		tmp <- (B-nuB[, J] - phistar*A + phistar*nuA[, J])/phiB[, J]
1301
+##		cB[, k] <- tmp/(1-phistar*phiA2[, J]/phiB[, J])
1302
+##		cA[, k] <- (A-nuA[, J]-phiA2[, J]*cB[, k])/phiA[, J]
1304 1303
 		##some of the snps are called for the men, but not the women
1305 1304
 		rm(YA, YB, wA, wB, res, tmp, phistar, A, B, G, index)
1306 1305
 		gc()
1307 1306
 	}
1308
-
1309
-	cA[cA < 0.05] <- 0.05
1310
-	cB[cB < 0.05] <- 0.05
1311
-	cA[cA > 5] <-  5
1312
-	cB[cB > 5] <- 5
1307
+##	cA[cA < 0.05] <- 0.05
1308
+##	cB[cB < 0.05] <- 0.05
1309
+##	cA[cA > 5] <-  5
1310
+##	cB[cB > 5] <- 5
1313 1311
 	
1314 1312
 	##--------------------------------------------------
1315 1313
 	##RS: need to fix.  why are there NA's by coercion
1316
-	cA <- matrix(as.integer(cA*100), nrow(cA), ncol(cA))
1314
+##	cA <- matrix(as.integer(cA*100), nrow(cA), ncol(cA))
1317 1315
 	##--------------------------------------------------
1318 1316
 	##ii <- rowSums(is.na(cA)) > 0
1319 1317
 	##these often arise at SNPs with low confidence scores
1320
-	cB <- matrix(as.integer(cB*100), nrow(cB), ncol(cB))
1321
-	CA(object)[snps, ] <- cA
1322
-	CB(object)[snps, ] <- cB
1318
+##	cB <- matrix(as.integer(cB*100), nrow(cB), ncol(cB))
1319
+##	CA(object)[snps, ] <- cA
1320
+##	CB(object)[snps, ] <- cB
1323 1321
 	snpflags[snps, ] <- flags
1324 1322
 	tmp <- physical(lM(object))$tau2A
1325 1323
 	tmp[snps, ] <- tau2A