View source: R/angle-functions.R
analyzeStepPairs | R Documentation |
Find cell indices and timepoints where these cells both have a step, then return angles and distances for each pair of steps.
analyzeStepPairs(
X,
filter.steps = NULL,
searchRadius = Inf,
quietly = FALSE,
...
)
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 |
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
.
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.
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
analyzeCellPairs
to do something similar for entire tracks
rather than single steps.
## 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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.