minFragCart2Polar: Calculate the nearest feature in polar coordinates given...

Description Usage Arguments Details Value Author(s) Examples

Description

Calculates the nearest feature in polar coordinates given cartesian coordinates

Usage

1
minFragCart2Polar(x, y, degreeOfFeatures)

Arguments

x

cartesian x coordinate

y

cartesian y coordinate

degreeOfFeatures

list of positions of features

Details

minFragCart2Polar is employed to find the feature with the smallest distance from given cartesian coordinates.

Value

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.

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## load binnedMSP
data("binnedMSP", package = "MetCirc")
## use only a selection 
binnedMSP <- binnedMSP[c(1:20, 29:48, 113:132, 240:259),]
simM <- createSimilarityMatrix(binnedMSP)
groupname <- rownames(simM)
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)

PlantDefenseMetabolism/MetCirc documentation built on May 8, 2019, 2:52 p.m.