View source: R/plottingFunctions.R
plotCircos | R Documentation |
Circular plot to visualize similarity.
plotCircos(
groupname,
linkDf,
initialize = c(TRUE, FALSE),
featureNames = c(TRUE, FALSE),
cexFeatureNames = 0.3,
groupSector = c(TRUE, FALSE),
groupName = c(TRUE, FALSE),
links = c(TRUE, FALSE),
highlight = c(TRUE, FALSE),
colour = NULL,
transparency = 0.2
)
groupname |
|
linkDf |
|
initialize |
|
featureNames |
|
cexFeatureNames |
|
groupSector |
|
groupName |
|
links |
|
highlight |
|
colour |
|
transparency |
|
Internal use for shinyCircos
or used outside of
shinyCircos
to reproduce figure
The function will initialize a circlize plot and/or will plot features of a circlize plot.
Thomas Naake, thomasnaake@googlemail.com
library("MsCoreUtils")
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]
## order similarityMat according to retentionTime
simM <- orderSimilarityMatrix(similarityMat, sps = sps_tissue[1:10],
type = "retentionTime")
## create link data.frame
linkDf <- createLinkDf(similarityMatrix = simM, sps = sps_tissue,
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")
## set circlize paramters
circos.clear()
circos.par(gap.degree = 0, cell.padding = c(0.0, 0, 0.0, 0),
track.margin = c(0.0, 0))
groupname <- c(as.character(linkDf_cut[, "spectrum1"]),
as.character(linkDf_cut[, "spectrum2"]))
groupname <- unique(groupname)
## actual plotting
plotCircos(groupname, linkDf_cut, initialize = TRUE,
featureNames = TRUE, cexFeatureNames = 0.3, groupSector = TRUE,
groupName = FALSE, links = FALSE, highlight = FALSE, colour = NULL,
transparency = 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.