xypanel {SNPchip} | R Documentation |
A panel function for xyplot
for plotting copy number versus physical position.
xypanel(x, y, gt, is.snp, range, col.hom = "grey20", fill.hom = "lightblue", col.het = "grey20", fill.het = "salmon", col.np = "grey20", fill.np = "grey60", show.state=TRUE, state.cex=1, col.state="blue", ..., subscripts)
x |
Physical position in megabases. |
y |
Copy number estimates. |
gt |
Genotype calls. |
is.snp |
Logical. Whether the marker is polymorphic. |
range |
A |
col.hom |
A specification for the color of plotting symbols for homozygous genotypes. |
fill.hom |
A specification for the fill color of plotting symbols for homozygous genotypes. |
col.het |
A specification for the color of plotting symbols for heterozygous genotypes. |
fill.het |
A specification for the fill color of plotting symbols for heterozygous genotypes. |
col.np |
A specification for the color of plotting symbols for nonpolymorphic markers. |
fill.np |
A specification for the fill color of plotting symbols for nonpolymorphic genotypes. |
show.state |
Logical. Whether to display the predicted state in each panel. |
state.cex |
Numeric. |
col.state |
Character. color for state label. Ignored if
|
... |
Additional arguments passed to lattice functions |
subscripts |
See the panel functions in lattice for more information. |
The order of plotting is (1) nonpolymorphic markers, (2), homozygous SNPs, and (3) heterozygous SNPs. Stretches of homozygosity should appear as blue using the default color scheme.
To make the drawing of the range
object border invisible, one can use border="white".
R. Scharpf
## Not run: if(require("crlmm") && require("VanillaICE") && require("IRanges")){ library(lattice) library(oligoClasses) data(oligoSetExample, package="oligoClasses") oligoSet <- oligoSet[chromosome(oligoSet) == 1, ] cn <- copyNumber(oligoSet)/100 cn <- log2((2^cn)/2) gt <- calls(oligoSet)[,] ## simulate BAFs bf <- rep(NA, length(gt)) u <- runif(length(gt)) bf[gt==1 & u > 0.5] <- runif(sum(gt==1 & u > 0.5), 0, 0.05) bf[gt==1 & u <= 0.5] <- runif(sum(gt==1 & u <= 0.5), 0.95, 1) bf[gt==2] <- runif(sum(gt==2), 0.45, 0.55) bf[900:1200] <- runif(length(900:1200), 0, 0.03) gr <- GRanges(paste0("chr", chromosome(featureData(oligoSet))), IRanges(position(oligoSet), width=1)) cn <- as.matrix(cn) bf <- as.matrix(bf) dimnames(cn) <- dimnames(bf) <- list(featureNames(oligoSet), sampleNames(oligoSet)) se <- SnpArrayExperiment(cn=cn, baf=bf, rowRanges=gr, isSnp=rep(TRUE, length(gr))) fit <- hmm2(se) g <- as(segs(fit), "GRanges") xyplot(cn ~ x | range, data=oligoSet, range=g[2], ##range=fit2[1:10, ], frame=2e6, panel=xypanel, cex=0.3, pch=21, border="blue", scales=list(x="free"), col.hom="lightblue", col.het="salmon", col.np="grey60", fill.np="grey60", xlab="Mb") ## if xyplot method is masked by lattice, do ##xyplot <- VanillaICE:::xyplot } ## End(Not run)