analyseSingleCellTrajectory: Analyse a single cell trajectory.

Description Usage Arguments Value Examples

View source: R/TrajectoryGeometry.R

Description

This function analyses a single cell trajectory by sampling multiple paths and comparing each path to random paths. It takes vector of pseudotime values, and a matrix of attribute values (cell x attribute). It also optionally takes the number of pseudotime windows to sample a single cell from. This defaults to 10. The function returns a list of Answers for each comparison of a sampled path to a random path.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
analyseSingleCellTrajectory(
attributes,
pseudotime,
randomizationParams,
statistic,
nSamples = 1000,
nWindows = 10,
d = ncol(attributes),
N = 1000
)

Arguments

attributes

- An n x d (cell x attribute) matrix of numeric attributes for single cell data. Rownames should be cell names.

pseudotime

- A named numeric vector of pseudotime values for cells.

randomizationParams

- A character vector which is used to control the production of randomized paths for comparison.

statistic

- Allowable values are 'median', 'mean' or 'max'.

nSamples

- The number of sampled paths to generate (default 1000).

nWindows

- The number of windows pseudotime should be split into to sample cells from (defaults to 10).

d

- The dimension under consideration. This defaults to ncol(attributes).

N

- The number of random paths to generated for statistical comparison to the given path (defaults to 1000).

Value

This returns a list, where each entry is itself a list containing information comparing a sampled path to random paths. These entries consist of: pValue - the p-value for the path and statistic in question; sphericalData - a list containing the projections of the path to the sphere, the center of that sphere and the statistic for distance to that center; randomDistances - the corresponding distances for randomly chosen; paths; randomizationParams - the choice of randomization parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
chol_answers = analyseSingleCellTrajectory(chol_attributes[,seq_len(3)],
                                        chol_pseudo_time_normalised,
                                        nSamples = 10,
                                        randomizationParams =
                                                    c('byPermutation',
                                                'permuteWithinColumns'),
                                        statistic = "mean",
                                        N = 1)
hep_answers = analyseSingleCellTrajectory(hep_attributes[,seq_len(3)],
                                        hep_pseudo_time_normalised,
                                        nSamples = 10,
                                        randomizationParams =
                                                c('byPermutation',
                                                'permuteWithinColumns'),
                                        statistic = "mean",
                                        N = 1)

AnnaLaddach/TrajectoryGeometry documentation built on Jan. 28, 2021, 10:41 a.m.