positionParms: Deriving Position-based Parameters

Description Usage Arguments Value

View source: R/derivedParameter_functions.R

Description

Calculate the position-based derived parameters for cell-level data to aid population heterogenaity studies.

Usage

1
2
positionParms(DT, densityRadius = 160, outerThresh = 0.2, wedges = 18,
  sparseThresh = 0.8)

Arguments

DT

A cell level data.table with plate-level x,y coordinates

densityRadius

The radius of the circle around each nuclei defining its neighborhood.

outerThresh

A quantile value between 0 and 1 used to threshold RadialPosition. The returned logical in the Outer column will be TRUE for cells with RadialPosition values in quantiles greater than outerThresh.

wedges

A numeric value for the number of wedge-shaped bins for grouping the theta values.

sparseThresh

A numeric value used to threshold the Density values. The returned logical in the Sparse column will be TRUE for cells with Density values greater than sparseThresh.

Value

A cell level data.table of length nrow(DT) with columns of XLocal (numeric), YLocal (numeric), RadialPostion (numeric), Theta (numeric), Outer (logical), Density (numeric), Sparse (logical) and Perimeter (logical) values. XLocal and YLocal are cartesian coordinates of each nuclei with the origin at the median X and median Y of each spot. RadialPosition and Theta are polar coordinates for XLocal and YLocal. Outer is a logical for cells in quantiles greater that outerThresh. Density is a scaled value that represents the number of nuclei centers within a densityRadius of each cell. Sparse is a logical for whether each cell is in a neighborhood with a Density value less than sparseThresh. Perimeter is a logical for the cell meeting the following criteria: Outer, furthest from the origin in their wedge and not Sparse.

Theta values function is from Roland on Stack Overflow http://stackoverflow.com/questions/23018056/convert-cartesian-angles-to-polar-compass-cardinal-angles-in-r


kdaily/MEMA documentation built on May 20, 2019, 8:28 a.m.