pairsByTime: Distance between pairs of tracks at every timepoint

View source: R/angle-functions.R

pairsByTimeR Documentation

Distance between pairs of tracks at every timepoint

Description

For every timepoint in the dataset, compute pairwise distances between coordinates.

Usage

pairsByTime(X, searchRadius = Inf, times = timePoints(X), quietly = FALSE)

Arguments

X

a tracks object

searchRadius

if specified, return only pairs that are within this distance of each other. Defaults to Inf, so if left unspecified, all pairs are returned.

times

(optional) a vector of timePoints to check pairs at; by default this is just everything.

quietly

(default FALSE) if TRUE, suppress warnings when there are no tracks with overlapping timepoints and an empty dataframe is returned.

Value

a dataframe with the following columns:

cell1

the id of the track to which the first coordinate belongs

cell2

the id of the track to which the second coordinate belongs

t

the time point at which their distance is assessed

dist

the distance between the coordinates at this time

Examples

## compute find timepoints where two t cells are within 1 micron of each other.
pairsByTime( TCells, searchRadius = 1 )

## indeed, the following two cells nearly touch:
plot( TCells[ c("24","9258") ] )

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