exvar.point.density: Constructs an explanatory variable representing density of a...

View source: R/CSIDE_utils.R

exvar.point.densityR Documentation

Constructs an explanatory variable representing density of a set of points

Description

This explanatory variable can be used with CSIDE to detect DE in the proximity of these points. Density is computing using an exponentially-decaying filter.

Usage

exvar.point.density(myRCTD, barcodes, points, radius = 50)

Arguments

myRCTD

an RCTD object with annotated cell types e.g. from the run.RCTD function.

barcodes

the barcodes, or pixel names, of the SpatialRNA for which to evaluate the explanatory variable. These would be the pixels used in the C-SIDE model.

points

a N by 2 matrix containing the locations of the points to be used for computing density. The first column should be the x coordinates while the second column should be the y coordinate.

radius

(default 50) the radius of the exponential filter. Approximately, the distance considered to be a relevant interaction.

Value

explanatory.variable a named numeric vector representing the explanatory variable used for explaining differential expression in CSIDE. Names of the variable are the SpatialRNA pixel names, and values are standardized between 0 and 1. This variable represents density of the given point set.


dmcable/RCTD documentation built on Feb. 24, 2024, 11:03 p.m.