trajResiduals {CellTrails} | R Documentation

## GET trajectory fitting residuals

### Description

Returns trajectory fitting residuals from `SingleCellExperiment` object

### Usage

    trajResiduals(object)

### Arguments

`object` | A `SingleCellExperiment` object

### Details

The trajectory fitting deviation is defined as the vector rejection from a sample in the latent space to the trajectory backbone. The trajectory backbone is defined by a tree spanning all relevant states. Samples get orthogonally projected onto straight lines connecting related states. This function quantifies the distance between the actual positon of a sample in the latent space and its projectd position on the trajectory backbone. In other words, the higher the distance, the higher its deviation (residual) from the trajectory fit. This function returns all residuals for each projected sample. Residuals of samples which were exluded for trajectory reconstruction are `NA`.

### Value

A `numeric` vector

### Author(s)

Daniel C. Ellwanger

### See Also

`fitTrajectory` `trajSampleNames`

### Examples

    # Example data
    data(exSCE)

    trajResiduals(exSCE)[seq_len(5)]

[Package CellTrails version 1.0.1 Index]