View source: R/plottingFunctions.R
circosLegend | R Documentation |
circosLegend
plots a legend for circos plot using group names.
circosLegend(groupname, highlight = TRUE, colour = NULL, cex = 1)
groupname |
|
highlight |
|
colour |
|
cex |
|
Internal use in shinyCircos
or outside of shinyCircos
to reproduce figures.
The function will open a new plot and display colours together with labels.
Thomas Naake, thomasnaake@googlemail.com
data("spectra", package = "MetCirc")
## create similarity matrix
similarityMat <- Spectra::compareSpectra(sps_tissue[1:10],
FUN = MsCoreUtils::ndotproduct, ppm = 20, m = 0.5, n = 2)
rownames(similarityMat) <- colnames(similarityMat) <- sps_tissue$name[1:10]
linkDf <- createLinkDf(similarityMatrix = similarityMat,
sps = sps_tissue[1:10],
condition = c("SPL", "LIM", "ANT", "STY"), lower = 0.01, upper = 1)
## cut link data.frame (here: only display links between groups)
linkDf_cut <- cutLinkDf(linkDf, type = "inter")
groupname <- c(as.character(linkDf_cut[, "spectrum1"]),
as.character(linkDf_cut[, "spectrum2"]))
groupname <- unique(groupname)
## plot legend
circosLegend(groupname, highlight = TRUE, colour = NULL, cex = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.