analyzeStepPairs: Find Distances and Angles for all Pairs of Steps

View source: R/angle-functions.R

analyzeStepPairsR Documentation

Find Distances and Angles for all Pairs of Steps

Description

Find cell indices and timepoints where these cells both have a step, then return angles and distances for each pair of steps.

Usage

analyzeStepPairs(
  X,
  filter.steps = NULL,
  searchRadius = Inf,
  quietly = FALSE,
  ...
)

Arguments

X

a tracks object

filter.steps

optional: a function used to filter steps on. See examples.

searchRadius

if specified, only return analysis for pairs of steps that start within distance searchRadius from each other

quietly

(default FALSE) if TRUE, suppress warnings

...

further arguments passed on to angleSteps

Details

Analyzing step angles at different distances can be useful to detect directional bias or local crowding effects; see (Beltman et al, 2009).

Internally, the function uses stepPairs, angleSteps, and distanceSteps.

Value

A dataframe with five columns: two for the indices of cellpairs that share a step, one for the timepoint at which they do so, one for the distance between them, and one for their angle.

References

Joost B. Beltman, Athanasius F.M. Maree and Rob. J. de Boer (2009), Analysing immune cell migration. Nature Reviews Immunology 9, 789–798. doi:10.1038/nri2638

See Also

analyzeCellPairs to do something similar for entire tracks rather than single steps.

Examples

## Plot distance versus angle for all step pairs, filtering for those that
## displace at least 2 microns. Sample dataset in this example for speed.
pairs <- analyzeStepPairs( sample( TCells, 100), filter.steps = function(t) displacement(t) > 2 )
scatter.smooth( pairs$dist, pairs$angle )

celltrackR documentation built on March 21, 2022, 5:06 p.m.