Learn R Programming

SNPchip (version 2.18.0)

xyplot: Plot copy number and physical position for a set of genomic intervals.

Description

Plot copy number and physical position given by a CNSet object for a set of genomic intervals stored in a RangedDataCVN object.

Usage

xyplot2(x, data, range, frame=50e3L, ...)

Arguments

x
A formula. Currently, the formula must be one of cn~x, cn ~ x | id or cn ~ x | range when data is a CNSet. If data is a BeadStudioSet, the formula has the form lrr ~ x| range or baf ~ x | range.
data
A CNSet, BeadStudioSet, or SnpSet object.
...
A RangedDataCNV object must be passed by the name 'range'. Arguments for xyplot are passed to xyplot2. Additional arguments are passed to xypanel and panel.xyplot.
range
A RangedDataCNV object.
frame
The genomic distance (basepairs) to the left and right of the start and stop coordinates in the range object.

Value

An object of class trellis.

Details

These functions plot copy number estimates versus physical position. The function is particularly useful for multi-panel displays in which the copy number estimates for a single range of a GRanges object appears in one panel. The size of the multi-panel display depends on the number of ranges (rows) in the GRanges object.

See Also

xyplot, xypanel

To modify the plot appearance from the default, additional arguments can be passed to panel.xyplot, lpoints, and lrect.

Examples

Run this code
  ## simulated data
  library(oligoClasses)
  library(IRanges)
  library(VanillaICE)
  data(oligoSetExample, package="oligoClasses")
  ## The oligoSnpSet class will likely be deprecated and made defunct
  ## in a future release.  Instead, we favor
  ## RangedSummarizedExperiment-derived classes defined in VanillaICE
  oligoSet <- oligoSet[chromosome(oligoSet) == 1, ]
  grl <- hmm(oligoSet, p.hom=0, TAUP=1e10, is.log=FALSE)
  g <- grl[[1]]

  ## To visualize each range in it's own panel surrounded by a
  ## frame of 2,000,000 bases:
  ## (here the frames are overlapping, but the method could be
  ## applied more generally to a collection of ranges from
  ## different chromsomes and samples)
  xyplot2(cn~x | range, data=oligoSet,
	       range=g,
	       frame=2e6, panel=xypanel,
	       cex=2,
	       pch=".",
	       col.het="salmon",
	       fill.het="salmon",
	       col.hom="royalblue",
	       fill.hom="royalblue",
	       state.cex=0.5,
	       border="orange", scales=list(x="free"),
	       par.strip.text=list(cex=0.5),
	       xlab="Mb", ylab=expression(log[2]("copy number")))

Run the code above in your browser using DataLab