Description Usage Arguments Details Value See Also Examples
Add labels to identify the data in the plot
1 |
karyoplot |
a |
labels |
(character) the text on the labels |
label.margin |
(numeric) the additional the margin between the labels the first base of the chromosome. In plot coordinates. Usual value might be 0.05. Can be negative. (defaults to 0.01) |
side |
("left" or "right") The side of the plot where to plot the labels. (defaults to "left") |
pos |
(numeric) The standard graphical parameter. See |
offset |
(numeric) The standard graphical parameter. See |
r0 |
(numeric) r0 and r1 define the vertical range of the data panel to be used to position the label. 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 position the label. 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) |
data.panel |
(numeric) The identifier of the data panel where the labels are to be added. The available data panels depend on the plot type selected in the call to |
... |
any additional parameter to be passed to the text plotting. All R base graphics params are passed along. |
Given a KaryoPlot object, plot labels on the side of the data panels to help identify the different types of data plotted
invisibly returns the given karyoplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | plot.params <- getDefaultPlotParams(plot.type=2)
plot.params$leftmargin <- 0.2
plot.params$rightmargin <- 0.2
kp <- plotKaryotype("hg19", chromosomes=c("chr1", "chr2"), plot.type=2, plot.params = plot.params)
#data panel 1
kpDataBackground(kp, r0=0, r1=0.5, col="#FFDDDD")
kpDataBackground(kp, r0=0.5, r1=1, col="#DDFFDD")
kpAddLabels(kp, "Everything", label.margin = 0.12, srt=90, pos=3, cex=0.8)
kpAddLabels(kp, "Red", r0=0, r1=0.5, cex=0.6)
kpAddLabels(kp, "Green", r0=0.5, r1=1, cex=0.6)
#data panel 2
kpDataBackground(kp, col="#DDDDFF", data.panel = 2)
kpAddLabels(kp, "BLUE", data.panel=2)
#Plot on the right
#data panel 1
kpAddLabels(kp, "Everything", label.margin = 0.12, srt=90, pos=1, cex=0.8, side="right")
kpAddLabels(kp, "Red", r0=0, r1=0.5, cex=0.6, side="right")
kpAddLabels(kp, "Green", r0=0.5, r1=1, cex=0.6, side="right")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.