Description Usage Arguments Details Value Author(s) Examples
View source: R/plottingFunctions.R
Calculates the nearest feature in polar coordinates given cartesian coordinates.
1 | minFragCart2Polar(x, y, degreeOfFeatures)
|
x |
cartesian x coordinate |
y |
cartesian y coordinate |
degreeOfFeatures |
'list' of positions of features |
'minFragCart2Polar' is employed to find the feature with the smallest distance from given cartesian coordinates.
'minFragCart2Polar' returns the index of the feature that has the smallest distance to the given coordinates. As 'minFragCart2Polar' is used in 'shinyCircos' for the track 1 only polar r coordinates between 0.8 and 1 will be used to find the feature with smallest distance.
Thomas Naake, thomasnaake@googlemail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data("spectra", package = "MetCirc")
similarityMat <- compare_Spectra(spectra_tissue[1:10],
fun = normalizeddotproduct, binSize = 0.01)
linkDf <- createLinkDf(similarityMatrix = similarityMat,
spectra = spectra_tissue[1:10],
condition = c("SPL", "LIM", "ANT", "STY"), lower = 0.5, 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)
## set circlize parameters
circos.clear()
circos.par(gap.degree = 0, cell.padding = c(0.0, 0, 0.0, 0),
track.margin = c(0.0, 0))
plotCircos(groupname, NULL, initialize = TRUE, featureNames = FALSE,
groupName = FALSE, groupSector = FALSE, links = FALSE, highlight = FALSE)
x <- 1
y <- 0
degreeFeatures <- lapply(groupname,
function(x) mean(circlize:::get.sector.data(x)[c("start.degree", "end.degree")]))
minFragCart2Polar(x, y, degreeOfFeatures = degreeFeatures)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.