Browse code

Add ABpanel help file and add fill argument

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

Rob Scharp authored on 01/10/2011 04:47:42
Showing3 changed files

... ...
@@ -1,7 +1,7 @@
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
-Version: 1.11.16
4
+Version: 1.11.18
5 5
 Date: 2010-12-10
6 6
 Author: Benilton S Carvalho <Benilton.Carvalho@cancer.org.uk>, Robert Scharpf <rscharpf@jhsph.edu>, Matt Ritchie <mritchie@wehi.edu.au>, Ingo Ruczinski <iruczins@jhsph.edu>, Rafael A Irizarry
7 7
 Maintainer: Benilton S Carvalho <Benilton.Carvalho@cancer.org.uk>, Robert Scharpf <rscharpf@jhsph.edu>, Matt Ritchie <mritchie@wehi.EDU.AU>
... ...
@@ -10,7 +10,7 @@ License: Artistic-2.0
10 10
 Depends: R (>= 2.13.0),
11 11
          methods,
12 12
          Biobase (>= 2.11.9),
13
-         oligoClasses (>= 1.13.22)
13
+         oligoClasses (>= 1.15.31)
14 14
 Imports: affyio (>= 1.19.2),
15 15
          ellipse,
16 16
          ff (>= 2.2-1),
... ...
@@ -2702,24 +2702,16 @@ dbvn <- function(x, mu, Sigma){
2702 2702
 
2703 2703
 ABpanel <- function(x, y, predictRegion,
2704 2704
 		    copyNumber=0:4,
2705
-		    object,
2706
-##		    x.axis,
2707
-##		    line.col,
2708
-##		    line.lwd,
2709
-##		    shades,
2705
+		    fill,
2710 2706
 		    ...,
2711 2707
 		    subscripts){
2712
-##		    data.last=FALSE,
2713
-##		    highlight.index=NULL){
2714
-	##if(length(scale.sd)==1) scale.sd <- rep(scale.sd,3)
2715 2708
 	panel.grid(h=5, v=5)
2716
-	panel.xyplot(x, y, ...)
2717
-##	if(!is.null(highlight.index)){
2718
-##		##ii <- subscripts[highlight.index]
2719
-##		ii <- highlight.index
2720
-##		lpoints(x[ii], y[ii], pch="X", cex=1.5, col="black")
2721
-##	}
2722
-	i <- panel.number()
2709
+	if(!missing(fill)){
2710
+		panel.xyplot(x, y, fill=fill[subscripts], ...)
2711
+	} else {
2712
+		panel.xyplot(x, y, ...)
2713
+	}
2714
+	pn <- panel.number()
2723 2715
 	for(CN in copyNumber){
2724 2716
 		gts <- genotypes(CN)
2725 2717
 		index <- match(gts, names(predictRegion))
... ...
@@ -2727,65 +2719,15 @@ ABpanel <- function(x, y, predictRegion,
2727 2719
 		for(i in seq_along(pr)){
2728 2720
 			## scale?
2729 2721
 			pr2 <- pr[[i]]
2730
-			mu <- pr2$mu
2731
-			Sigma <- pr2$cov
2722
+			mu <- pr2$mu[pn, , , drop=FALSE] ## pn=panel number
2723
+			Sigma <- pr2$cov[pn, , ,drop=FALSE]
2732 2724
 			for(j in seq_len(dim(mu)[3])){
2733 2725
 				dat.ellipse <- ellipse(x=Sigma[, 2, j],
2734
-						       centre=mu[, , j],
2735
-						       scale=c(sqrt(Sigma[,1,j]),
2726
+						       centre=mu[ , , j],
2727
+						       scale=c(sqrt(Sigma[ , 1, j]),
2736 2728
 						       sqrt(Sigma[, 3, j])))
2737 2729
 				lpolygon(dat.ellipse[,1], dat.ellipse[,2], ...)
2738 2730
 			}
2739
-##			} else {
2740
-##				dat.ellipse <- ellipse(x=rho, centre=c(log2(nuB+CB*phB), log2(nuA+CA*phA)), scale=rev(scale))
2741
-##			}
2742
-##			lpolygon(dat.ellipse[, 1], dat.ellipse[, 2], border=line.col[k], col=shades[k], ...)
2743 2731
 		}
2744 2732
 	}
2745
-##	nuB <- as.numeric(nu(object, "B"))[i]
2746
-##	phB <- as.numeric(phi(object, "B"))[i]
2747
-##	nuA <- as.numeric(nu(object, "A"))[i]
2748
-##	phA <- as.numeric(phi(object, "A"))[i]
2749
-##	taus <- tau2(object, i=i)[, , , 1]
2750
-##	cors <- corr(object, i=i)[, , 1]
2751
-##	t2A <- taus["A", "BB"]
2752
-##	t2B <- taus["B", "AA"]
2753
-##	s2A <- taus["A", "AA"]
2754
-##	s2B <- taus["B", "BB"]
2755
-##	corrAB <- cors["AB"]
2756
-##	corrAA <- cors["AA"]
2757
-##	corrBB <- cors["BB"]
2758
-##	k <- 1
2759
-##	for(CN in copynumber){
2760
-##		for(CA in 0:CN){
2761
-##			CB <- CN-CA
2762
-##			A.scale <- sqrt(t2A*(CA==0) + s2A*(CA > 0))
2763
-##			B.scale <- sqrt(t2B*(CB==0) + s2B*(CB > 0))
2764
-##			if(CA == 0 | CB == 0){
2765
-##				A.scale <- A.scale*scale.sd[1]
2766
-##				B.scale <- B.scale*scale.sd[1]
2767
-##			} else { ## both greater than zero
2768
-##				A.scale <- A.scale*scale.sd[2]
2769
-##				B.scale <- B.scale*scale.sd[2]
2770
-##			}
2771
-##			scale <- c(A.scale, B.scale)
2772
-##			if(CA == 0 & CB > 0) rho <- corrBB
2773
-##			if(CA > 0 & CB == 0) rho <- corrAA
2774
-##			if(CA > 0 & CB > 0) rho <- corrAB
2775
-##			if(CA == 0 & CB == 0) rho <- 0
2776
-##			if(x.axis=="A"){
2777
-##				dat.ellipse <- ellipse(x=rho, centre=c(log2(nuA+CA*phA), log2(nuB+CB*phB)), scale=scale)
2778
-##			} else {
2779
-##				dat.ellipse <- ellipse(x=rho, centre=c(log2(nuB+CB*phB), log2(nuA+CA*phA)), scale=rev(scale))
2780
-##			}
2781
-##			lpolygon(dat.ellipse[, 1], dat.ellipse[, 2], border=line.col[k], col=shades[k], ...)
2782
-##		}
2783
-##		k <- k+1
2784
-##	}
2785
-##	if(data.last) {
2786
-##		panel.xyplot(x, y, ...)
2787
-##		if(!is.null(highlight.index)){
2788
-##			lpoints(x[ii], y[ii], pch="X", cex=1.5, col="black")
2789
-##		}
2790
-##	}
2791 2733
 }
2792 2734
new file mode 100644
... ...
@@ -0,0 +1,64 @@
1
+\name{ABpanel}
2
+\alias{ABpanel}
3
+\title{A panel function for plotting prediction regions and
4
+  log-normalized intensities
5
+}
6
+\description{
7
+  A panel function for plotting prediction regions and
8
+  log-normalized intensities
9
+}
10
+\usage{
11
+ABpanel(x, y, predictRegion, copyNumber = 0:4, fill, ..., subscripts)
12
+}
13
+%- maybe also 'usage' for other objects documented here.
14
+\arguments{
15
+  \item{x}{
16
+    log-normalized intensities for the A or B allele
17
+}
18
+\item{y}{
19
+      log-normalized intensities for the A or B allele
20
+}
21
+  \item{predictRegion}{
22
+    A \code{list}. See \code{predictionRegion}.
23
+}
24
+  \item{copyNumber}{
25
+    Integer vector.  Indicates which prediction regions are drawn.
26
+}
27
+  \item{fill}{
28
+    Character or integer vector for coloring the points.  Only valid for
29
+    certain point symbols.  See \code{points}.
30
+}
31
+  \item{\dots}{
32
+    Additional arguments to \code{panel.xyplot} and \code{\lpolygon}.
33
+}
34
+  \item{subscripts}{
35
+    See \code{xyplot} in the \pkg{lattice} package.
36
+}
37
+}
38
+\details{
39
+%%  ~~ If necessary, more details than the description above ~~
40
+}
41
+\value{
42
+  Not applicable
43
+}
44
+
45
+\note{
46
+
47
+  \code{ABpanel} can be passed as the argument to panel in the
48
+  \code{xyplot} method for \code{CNSet} objects.  See the examples in
49
+  \code{xyplot}.
50
+
51
+}
52
+
53
+\author{
54
+R. Scharpf
55
+}
56
+
57
+\seealso{
58
+  \code{\link[lattice]{xyplot}},   \code{\link[lattice]{panel.xyplot}}
59
+  \code{\link[lattice]{lpolygon}}
60
+}
61
+
62
+% Add one or more standard keywords, see file 'KEYWORDS' in the
63
+% R documentation directory.
64
+\keyword{aplot}
0 65
\ No newline at end of file