scale_S_neib: Scale the neighbourhood size

Description Usage Arguments Value Examples

View source: R/scale-neighborhood-size.R

Description

scales the number of neighbors (neighbourhood size) depending on the local sample density. keeps increasing K until the distance to the furthest of the K neighbors is above the dmin threshold

Usage

1
scale_S_neib(input_dat, n, K_init, Dist, dmin)

Arguments

input_dat:

data frame of input data with rows=samles and cols=dimensions

n:

position (row) of the sample, in the input_dat data frame

K_init:

initial number of nearest neighbors that needs to be scaled

Dist:

distance matrix of all samples

dmin:

distance threshold (to the furthest neighbor) to be reached

Value

Kscaled: the scaled neighbourhood size

Examples

1
2
3
4
5
data(scdata.3lines.simulated6genes)
Dist <- compute_all_distances(scdata.3lines.simulated6genes)

#find the 5 nearest neighbours of the second sample
neibs <- find_K_nearest(n = 2, K = 5, Dist = Dist)

theislab/kbranches documentation built on Feb. 27, 2020, 11:01 a.m.