Browse code

fix dimension of a.np in calculateRBaf

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

Rob Scharp authored on 29/11/2011 20:01:20
Showing1 changed files

... ...
@@ -592,9 +592,11 @@ setMethod("calculateRBaf", signature(object="CNSet"),
592 592
 		  r.expected[grBB] <- r.bb[grBB]
593 593
 
594 594
 		  index.np <- which(is.np)
595
-		  a.np <- A(object)[index.np, ]
596
-		  meds <- rowMedians(a.np, na.rm=TRUE)
597
-		  r.expected[index.np, ] <- matrix(meds, length(index.np), ncol(a.np))
595
+		  if(length(index.np) > 0){
596
+			  a.np <- A(object)[index.np, J]
597
+			  meds <- rowMedians(a.np, na.rm=TRUE)
598
+			  r.expected[index.np, ] <- matrix(meds, length(index.np), ncol(a.np))
599
+		  }
598 600
 		  lrr <- log2(obs.r/r.expected)
599 601
 
600 602
 		  dimnames(bf) <- dimnames(lrr) <- dns