SMOLR_KDE: 2D kernel density estimation from a single molecule dataset

View source: R/smolr_kde.R

SMOLR_KDER Documentation

2D kernel density estimation from a single molecule dataset

Description

Fits a 2D kernel density estimation to single molecule localization data based on bkde2de from the kernsmooth package

Usage

SMOLR_KDE(x, y, ch, prec, bandwidth, input_xsize, input_ysize, px, threshold, fit, file, output)

Arguments

x

X coordinates in nm, a localizations data.frame or a list of data.frames.

y

Y coordinates in nm

ch

Channel number (default=1)

prec

Precision in nm (default=20)

bandwidth

Bandwidth of the kernel used to fit, typically a bandwidth of around the precision is used. The bandwidth is a vector containing an x and a y size. (default = c(20,20))

xlim

Vector with the upper and lower limit of x axis (x coordinates outside limits will be discarded if fit=TRUE)

ylim

Vector with the upper and lower limit of y axis (y coordinates outside limits will be discarded if fit=TRUE)

px

Pixelsize in nm

threshold

Threshold for the kde in localizations per squared nm, used to create binary image of the single molecule data

fit

If fit=TRUE all coordinates that lie outside of indicated xlim and ylim values are discarded

file

Path and name of file to save tif to (i.e. file="D:/test.tif", will return the files test_kde.tif and test_kde_bin.tif)

output

Set output to "tiff" to output tiff files of the KDE

Value

kde

Array containing the kernel density estimation

kde_binary

Array containing the binary thresholded image

parameters

Parameters of the input

int

list of intensities from the kde per localization, unique feature id per localization

inputs

list of values that were the input in the function, for reference

Author(s)

Optical Imaging Centre ErasmusMC Rotterdam

References

Kernel density estimation uses the bkde2D algorithm from the kernsmooth package

See Also

bkde2D

Examples

test_kde <- SMOLR_KDE(smolrdata)
plot(test_kde)
plot(test_kde)
plot(test_kde,contrast = 2,saturate = 0.05,brightness = 0)
SMOLR_PLOT(smolrdata,color=SMOLR_KDE(smolrdata)[[4]][,2],split_ch=TRUE)

ErasmusOIC/SMoLR documentation built on Aug. 20, 2024, 8:50 p.m.