Description Usage Arguments Details Value See Also Examples
A variable width ribbon
1 |
karyoplot |
(a |
data |
(a |
chr |
(a charecter vector) A vector of chromosome names specifying the chromosomes of the data points. If |
x0 |
(a numeric vector) A numeric vector of x left positions (in base pairs). If |
x1 |
(a numeric vector) A numeric vector of x right positions (in base pairs). If |
y0 |
(a numeric vector) A numeric vector of y bottom positions. If |
y1 |
(a numeric vector) A numeric vector of y top positions. If |
ymin |
(numeric) The minimum value of |
ymax |
(numeric) The maximum value of |
data.panel |
(numeric) The identifier of the data panel where the data is to be plotted. The available data panels depend on the plot type selected in the call to |
r0 |
(numeric) r0 and r1 define the vertical range of the data panel to be used to draw this plot. They can be used to split the data panel in different vertical ranges (similar to tracks in a genome browser) to plot differents data. If NULL, they are set to the min and max of the data panel, it is, to use all the available space. (defaults to NULL) |
r1 |
(numeric) r0 and r1 define the vertical range of the data panel to be used to draw this plot. They can be used to split the data panel in different vertical ranges (similar to tracks in a genome browser) to plot differents data. If NULL, they are set to the min and max of the data panel, it is, to use all the available space. (defaults to NULL) |
col |
(color) The background color to plot. If NULL, it will be a lighter version of 'border' or 'black' if border is null. (Defaults to "gray80") |
border |
(color) The color to use to plot the borders of the bars. If NULL, it will be a darker version of 'col'. If NA, no border will be plotted. (Defaults to NULL) |
clipping |
(boolean) Only used if zooming is active. If TRUE, the data representation will be not drawn out of the drawing area (i.e. in margins, etc) even if the data overflows the drawing area. If FALSE, the data representation may overflow into the margins of the plot. (defaults to TRUE) |
... |
The ellipsis operator can be used to specify any additional graphical parameters. Any additional parameter will be passed to the internal calls to the R base plotting functions. |
kpPlotRibbon
plots a variable witdh ribbon along the genome. It can be used,
for example, to plot the sd region around a line representing a mean. It can also
be used as a replacement for kpBars
creating a smoother plot without
the the actual individual bars. kpPlotRibbon
has three additional parameters
controlling the smoothing of the lines and their colors.
Returns the original karyoplot object, unchanged.
plotKaryotype
, kpBars
, kpLines
1 2 3 4 5 6 7 8 9 10 11 | set.seed(1000)
data <- toGRanges(data.frame(chr="chr1", start=1e6*(0:239), end=1e6*(1:240)))
y <- ((sin(start(data))/5 + rnorm(n=24, mean=0, sd=0.1))/5)+0.5
kp <- plotKaryotype("hg19", plot.type=2, chromosomes="chr1")
kpPlotRibbon(kp, data, y0=y-0.3, y1=y+0.3, border="red", col=lighter("red"))
kpPlotRibbon(kp, data, y0=y-0.1, y1=y+0.1, border="blue", col=lighter("blue"))
kpLines(kp, data, y=y, col="green")
kpPlotRibbon(kp, data, y0=0.5+(y-min(y)), y1=0.5-(y-min(y)), data.panel=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.