Last data update: 2014.03.03

R: Plot prediction regions and normalized intensities.
xyplotR Documentation

Plot prediction regions and normalized intensities.

Description

Plot prediction regions for integer copy number and normalized intensities.

Usage

xyplot(x, data, ...)

Arguments

x

A formula.

data

A CNSet object.

...

Additional arguments passed to xyplot function in lattice.

Value

A trellis object.

Author(s)

R. Scharpf

See Also

xyplot, ABpanel

Examples

library(oligoClasses)
data(cnSetExample2)
table(batch(cnSetExample2))
sample.index <- which(batch(cnSetExample2) == "CUPID")
## A single SNP
pr <- predictionRegion(cnSetExample2[1:4, sample.index], copyNumber=0:4)
gt <- calls(cnSetExample2[1:4, sample.index])
lim <- c(6,13)
xyplot(B~A|snpid, data=cnSetExample2[1:4, sample.index],
       predictRegion=pr,
       panel=ABpanel,
       pch=21,
       fill=c("red", "blue", "green3")[gt],
       xlim=lim, ylim=lim)

## multiple SNPs, prediction regions for 3 batches
## Not run: 
	tab <- table(batch(cnSetExample2))
	bns <- names(tab)[tab > 50]
	sample.index <- which(batch(cnSetExample2) 
	pr <- predictionRegion(cnSetExample2[1:10, sample.index], copyNumber=0:4)
	gt <- as.integer(calls(cnSetExample2[1:10, sample.index]))
	xyplot(B~A|snpid, data=cnSetExample2[1:10, sample.index],
	       predictRegion=pr,
	       panel=ABpanel,
	       pch=21,
	       fill=c("red", "blue", "green3")[gt],
	       xlim=c(6,12), ylim=c(6,12))

	## nonpolymorphic markers
	data(cnSetExample2)
	tab <- table(batch(cnSetExample2))
	bns <- names(tab)[tab > 50]
	sample.index <- which(batch(cnSetExample2)
	np.index <- which(!isSnp(cnSetExample2))[1:10]
	taus <- tau2(cnSetExample)[np.index, , , ]
	pr <- predictionRegion(cnSetExample2[np.index, sample.index],
			       copyNumber=0:4)
	pp <- posteriorProbability(cnSetExample2[np.index, sample.index],
				   predictRegion=pr,
				   copyNumber=0:4)

## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(crlmm)
Loading required package: oligoClasses
Welcome to oligoClasses version 1.34.0
Loading required package: preprocessCore
Welcome to crlmm version 1.30.0
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/crlmm/xyplot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: xyplot
> ### Title: Plot prediction regions and normalized intensities.
> ### Aliases: xyplot xyplot,formula,CNSet-method
> ### Keywords: dplot hplot
> 
> ### ** Examples
> 
> library(oligoClasses)
> data(cnSetExample2)
> table(batch(cnSetExample2))

CHEAP CORER CUPID DINGO EPODE GIGAS HOMOS HUFFS HUSKS IONIC LOVED NIGHS PICUL 
    8     8    77    73    89    92    63    81    19    85    72    81    85 
POSIT SAKES SCALE SHELF SLOTH TESLA 
   83    85    85    91    78     3 
> sample.index <- which(batch(cnSetExample2) == "CUPID")
> ## A single SNP
> pr <- predictionRegion(cnSetExample2[1:4, sample.index], copyNumber=0:4)
> gt <- calls(cnSetExample2[1:4, sample.index])
> lim <- c(6,13)
> xyplot(B~A|snpid, data=cnSetExample2[1:4, sample.index],
+        predictRegion=pr,
+        panel=ABpanel,
+        pch=21,
+        fill=c("red", "blue", "green3")[gt],
+        xlim=lim, ylim=lim)
> 
> ## multiple SNPs, prediction regions for 3 batches
> ## Not run: 
> ##D 	tab <- table(batch(cnSetExample2))
> ##D 	bns <- names(tab)[tab > 50]
> ##D 	sample.index <- which(batch(cnSetExample2) ##D 
> ##D 	pr <- predictionRegion(cnSetExample2[1:10, sample.index], copyNumber=0:4)
> ##D 	gt <- as.integer(calls(cnSetExample2[1:10, sample.index]))
> ##D 	xyplot(B~A|snpid, data=cnSetExample2[1:10, sample.index],
> ##D 	       predictRegion=pr,
> ##D 	       panel=ABpanel,
> ##D 	       pch=21,
> ##D 	       fill=c("red", "blue", "green3")[gt],
> ##D 	       xlim=c(6,12), ylim=c(6,12))
> ##D 
> ##D 	## nonpolymorphic markers
> ##D 	data(cnSetExample2)
> ##D 	tab <- table(batch(cnSetExample2))
> ##D 	bns <- names(tab)[tab > 50]
> ##D 	sample.index <- which(batch(cnSetExample2)##D 
> ##D 	np.index <- which(!isSnp(cnSetExample2))[1:10]
> ##D 	taus <- tau2(cnSetExample)[np.index, , , ]
> ##D 	pr <- predictionRegion(cnSetExample2[np.index, sample.index],
> ##D 			       copyNumber=0:4)
> ##D 	pp <- posteriorProbability(cnSetExample2[np.index, sample.index],
> ##D 				   predictRegion=pr,
> ##D 				   copyNumber=0:4)
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>