Description Usage Arguments Details Note Author(s) See Also Examples
View source: R/panel-functions.R
A panel function for xyplot
for plotting copy number versus physical position.
1 2 3 |
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
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 38 39 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.