cnPredictionPanel: Plot bivariate normal prediction regions on a lattice panel

Description Usage Arguments Value Author(s) See Also Examples

View source: R/functions.R

Description

Bivariate normal prediction regions are added to a lattice panel.

Usage

1
2
cnPredictionPanel(x, y, ..., object, copynumber, x.axis, line.col,
line.lwd, shades, subscripts, data.last =FALSE, highlight.index = NULL, scale.sd = rep(1, 2))

Arguments

x

passed to panel.xyplot

y

passed to panel.xyplot

...

passed to panel.xyplot

object

object of class CNSet

copynumber

Integer vector. Which prediction regions to plot.

x.axis

valid entries are 'A' or 'B', indicating whether the A or B allele is to be plotted on the x-axis.

line.col

the color for the border of the prediction regions

line.lwd

currently ignored

shades

the fill color for the prediction regions

subscripts

passed to panel.xyplot

data.last

whether to plot the data before or after plotting the prediction regions

highlight.index

an integer vector. If not missing, this vector can be used to highlight the position of some samples in the A vs B scatterplot. These samples will be plotted with an 'X' instead of an 'o'.

scale.sd

whether to scale the A and B standard deviations to provide a sample specific prediction region. This is experimental and defaults to 1 (no scaling)

Value

a lattice object

Author(s)

R. Scharpf

See Also

panel.xyplot, CNSet-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
library("crlmm")
library("crlmmCompendium")


###################################################
### chunk number 27: loadObject-exampleData1
###################################################
#line 1164 "manuscript.Rnw"
data(exampleData1)


###################################################
### chunk number 30: defineLatticeObjects
###################################################
#line 1223 "manuscript.Rnw"
ldat <- prePredictPanel(exampleData1)
shades <- makeTransparent(brewer.pal(6, "BrBG"), alpha=0.6)[c(1,2,3,5,6)]
##replace the middle color (white) with something else
mykey <- simpleKey(as.character(0:4), points=FALSE, rectangles=TRUE, col="black", space="right", cex=0.7)
mykey$rectangles[["col"]] <- shades
fig2 <- xyplot(A~B|snp, ldat, cex=0.3, panel=cnPredictionPanel, object=exampleData1,
	       x.axis="B", copynumber=0:4, line.col=shades, line.lwd=1.5,
	       shades=shades, ylab=expression(log[2](I[A])), xlab=expression(log[2](I[B])),
	       par.strip.text=list(lines=0.9, cex=0.6),
	       key=mykey)


###################################################
### chunk number 31: ABscatterplots
###################################################
#line 1237 "manuscript.Rnw"
pars <- trellis.par.get()
pars$axis.text$cex <- 0.3
pars$xlab.text$cex <- 0.8
trellis.par.set("axis.text", pars$axis.text)
trellis.par.set("axis.text", pars$xlab.text)
print(fig2)

rscharpf/crlmmCompendium documentation built on May 28, 2019, 3:31 a.m.