Browse code

Edits to construct function. phenoData is instantiated prior to initializing the CNSetLM object.

protocolData and phenoData are assigned the same sample names

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

Rob Scharp authored on 02/08/2010 08:51:50
Showing1 changed files

... ...
@@ -68,21 +68,26 @@ construct <- function(filenames, cdfName, copynumber=FALSE,
68 68
 	rownames(pData(protocolData)) <- sns
69 69
 	featureData <- getFeatureData.Affy(cdfName, copynumber=copynumber)
70 70
 	nr <- nrow(featureData); nc <- length(filenames)
71
+	ffObjects <- list(alleleA=initializeBigMatrix(name="A", nr, nc),
72
+			  alleleB=initializeBigMatrix(name="B", nr, nc),
73
+			  call=initializeBigMatrix(name="call", nr, nc),
74
+			  callProbability=initializeBigMatrix(name="callPr", nr,nc),
75
+			  CA=initializeBigMatrix(name="CA", nr, nc),
76
+			  CB=initializeBigMatrix(name="CB", nr, nc))
77
+	pd <- data.frame(matrix(NA, nc, 3), row.names=sns)
78
+	colnames(pd)=c("SKW", "SNR", "gender")
79
+	phenoData <- new("AnnotatedDataFrame", data=pd)
71 80
 	callSet <- new("CNSetLM", 
72
-		       alleleA=initializeBigMatrix(name="A", nr, nc),
73
-		       alleleB=initializeBigMatrix(name="B", nr, nc),
74
-		       call=initializeBigMatrix(name="call", nr, nc),
75
-		       callProbability=initializeBigMatrix(name="callPr", nr,nc),
76
-		       CA=initializeBigMatrix(name="CA", nr, nc),
77
-		       CB=initializeBigMatrix(name="CB", nr, nc),
81
+		       alleleA=ffObjects[["alleleA"]],
82
+		       alleleB=ffObjects[["alleleB"]],
83
+		       call=ffObjects[["call"]],
84
+		       callProbability=ffObjects[["callProbability"]],
85
+		       CA=ffObjects[["CA"]],
86
+		       CB=ffObjects[["CB"]],
78 87
 		       protocolData=protocolData,
88
+		       phenoData=phenoData,
79 89
 		       featureData=featureData,
80 90
 		       annotation=cdfName)
81
-	pd <- data.frame(matrix(NA, nc, 3), row.names=sns)
82
-	colnames(pd)=c("SKW", "SNR", "gender")
83
-	phenoData(callSet) <- new("AnnotatedDataFrame", data=pd)
84
-	rownames(pData(callSet)) <- NULL
85
-	phenoData(callSet)$sampleNames <- sns
86 91
 	return(callSet)
87 92
 }
88 93