Browse code

fix bug in construction of NChannelSet

- thanks to Alex Baras for finding and supplying patch

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

Rob Scharp authored on 31/10/2013 01:45:34
Showing2 changed files

... ...
@@ -1,8 +1,13 @@
1 1
 Package: crlmm
2 2
 Type: Package
3 3
 Title: Genotype Calling (CRLMM) and Copy Number Analysis tool for Affymetrix SNP 5.0 and 6.0 and Illumina arrays.
4
+<<<<<<< HEAD
4 5
 Version: 1.21.0
5 6
 Date: Wed Oct 30 21:27:01 EDT 2013
7
+=======
8
+Version: 1.19.9
9
+Date: Fri Oct 25 14:00:41 EDT 2013
10
+>>>>>>> 9a92fa5d0719c007647a5b14c24201d277db3f1b
6 11
 Author: Benilton S Carvalho, Robert Scharpf, Matt Ritchie, Ingo Ruczinski, Rafael A Irizarry
7 12
 Maintainer: Benilton S Carvalho <Benilton.Carvalho@cancer.org.uk>, Robert Scharpf <rscharpf@jhsph.edu>, Matt Ritchie <mritchie@wehi.EDU.AU>
8 13
 Description: Faster implementation of CRLMM specific to SNP 5.0 and 6.0 arrays, as well as a copy number tool specific to 5.0, 6.0, and Illumina platforms
... ...
@@ -371,12 +371,18 @@ RGtoXY = function(RG, chipType, verbose=TRUE) {
371 371
   bord = match(bids, featureNames(RG)) # and here
372 372
 #  argrg = aids[rrgg]
373 373
 #  brgrg = bids[rrgg]
374
+  xyPhenoData = AnnotatedDataFrame(data=RG@phenoData@data,varMetadata=RG@phenoData@varMetadata)
375
+  levels(xyPhenoData@varMetadata$channel) = c("X","Y","zero","_ALL_")
374 376
   XY <- new("NChannelSet",
375
-	    X=matrix(0, nsnps, narrays),
376
-	    Y=matrix(0, nsnps, narrays),
377
-	    zero=matrix(0, nsnps, narrays),
378
-	    annotation=chipType, phenoData=RG@phenoData,
379
-	    protocolData=RG@protocolData, storage.mode="environment")
377
+        assayDataNew(X=matrix(0, nsnps, narrays),Y=matrix(0, nsnps, narrays),zero=matrix(0, nsnps, narrays)),
378
+        phenoData=xyPhenoData, protocolData=RG@protocolData, annotation=chipType)
379
+   storageMode(XY) = "environment"
380
+#  XY <- new("NChannelSet",
381
+#	    X=matrix(0, nsnps, narrays),
382
+#	    Y=matrix(0, nsnps, narrays),
383
+#	    zero=matrix(0, nsnps, narrays),
384
+#	    annotation=chipType, phenoData=RG@phenoData,
385
+#	    protocolData=RG@protocolData, storage.mode="environment")
380 386
   featureNames(XY) = ids
381 387
   sampleNames(XY) = sampleNames(RG)
382 388
   ## RS
... ...
@@ -1352,7 +1358,7 @@ processIDAT <- function(stratum, sampleBatches, sampleSheet=NULL,
1352 1358
 			A, B,
1353 1359
 			GT,
1354 1360
 			GTP,
1355
-			SKW, SNR, mixtureParams, is.snp) { #, outdir=".") {
1361
+			SKW, SNR, mixtureParams, is.snp) { #, outdir=".") {
1356 1362
 	message("Processing sample stratum ", stratum, " of ", length(sampleBatches))
1357 1363
 	sel <- sampleBatches[[stratum]]
1358 1364
         if(length(path)>= length(sel)) path = path[sel]