distanceBetweenTrajectories: Get distances between trajectories.

View source: R/TrajectoryGeometry.R

distanceBetweenTrajectoriesR Documentation

Get distances between trajectories.

Description

This function compares two single cell trajectories (representative of different lineages within the same dataset), and finds the minimum euclidean distance between the first and the second trajectory at each point in pseudotime. Please note, attributes can either be values for single cells, or attributes which have been smoothed over pseudotime. Likewise the pseudotime values should be for single cells, or for smoothed attributes over pseudotime

Usage

distanceBetweenTrajectories(attributes1, pseudotime1, attributes2)

Arguments

attributes1

- An n x d (cell x attribute) matrix of numeric attributes for the first single cell trajectory.

pseudotime1

- A named numeric vector of pseudotime values for the first single cell trajectory, names should match rownames of atrributes1.

attributes2

- An n x d (cell x attribute) matrix of numeric attributes for the sencond single cell trajectory.

Value

results - a dataframe containing pseudotime values (for the first trajectory), and distances (the minimimum euclidian distance between the two trajectories at that point in pseudotime).

Examples

distances = distanceBetweenTrajectories(chol_attributes,
                                 chol_pseudo_time[!is.na(chol_pseudo_time)],
                                 hep_attributes)

AnnaLaddach/TrajectoryGeometry documentation built on Feb. 23, 2024, 2:24 p.m.