fitDynamic {CellTrails} | R Documentation

## Fit expression dynamic

### Description

Fits feature expression as a function of pseudotime along a defined trail.

### Usage

    fitDynamic(sce, feature_name, trail_name)

### Arguments

`sce` | A `SingleCellExperiment` object
`feature_name` | Name of feature
`trail_name` | Name of trail

### Details

A trail is an induced subgraph of the trajectory graph. A trajectory graph is composed of samples (nodes) that are connected (by weighted edges) if they are chronologically related. A trail has to be defined by the user using `addTrail`. A pseudotime vector is extracted by computing the geodesic distance for each sample from the trail's start node. To infer the expression level of a feature as a function of pseudotime, CellTrails used generalized additive models with a single smoothing term with four basis dimensions. Here, for each feature CellTrails introduces prior weights for each observation to lower the confounding effect of drop-outs to the maximum-likelihood-based fitting process as follows. Each non-detect of feature j in state h is weighted by the relative fraction of non-detects of feature j in state h; detected values are always assigned weight = 1.

### Value

An object of type `list` with the following components

`pseudotime`

  The pseudotime along the trail

`expression`

  The fitted expression values for each value of pseudotime

`gam`

  A object of class `gamObject`

### Author(s)

Daniel C. Ellwanger

### See Also

`addTrail` `gamObject`

### Examples

    # Example data
    data(exSCE)

    # Fit dynamic
    fit <- fitDynamic(exSCE, feature_name="feature_3", trail_name="Tr1")

    summary(fit)

[Package CellTrails version 1.0.1 Index]