getLineageCurves: Get lineage curves

Description Usage Arguments Details References

Description

This code is adapted from the 'getCurves' method in the R package 'slingshot', modified to allow soft memberships.

Usage

1
2
3
4
getLineageCurves(expr.ld, lineages, centers, membership, shrink = TRUE,
  smoother = "smooth.spline", extend = "y", drop.multi = TRUE,
  reweight = TRUE, shrink.method = "cosine", stretch = 2,
  thresh = 0.001, maxit = 15)

Arguments

expr.ld

The n-by-p' data matrix, usually projected to a low-dimensional space with a small p'

lineages

A list of vectors, one per lineage, each containing the ordered cluster labels along the lineage

centers

K-by-p' matrix of cluster centers in the low-dimensional space. The row names are the cluster labels, which should to be consistent with the names in 'lineages'.

shrink

(optional) logical or numeric between 0 and 1, determines whether and how much to shrink branching lineages toward their average prior to the split.

smoother

(optional) choice of scatter plot smoother. Same as principal.curve, but "lowess" option is replaced with "loess" for additional flexibility.

extend

character, how to handle root and leaf clusters of lineages when constructing the initial, piece-wise linear curve. Accepted values are 'y' (default) and 'n'. See 'Details' for more.

drop.multi

logical, whether to drop shared cells from lineages which do not fit them well. If TRUE, shared cells with a distance to one lineage above the 90th percentile and another below the 50th will be dropped from the further lineage.

reweight

logical, whether to allow cells shared between lineages to be reweighted during curve-fitting. If TRUE, cells shared between lineages will be weighted by: distance to nearest curve / distance to curve.

shrink.method

character denoting how to determine the appropriate amount of shrinkage for a branching lineage. Accepted values are the same as for kernel in density (default is "cosine"), as well as "tricube" and "density". See 'Details' for more.

maxit

(optional) maximum iteration

Details

When there is only a single lineage, the curve-fitting algorithm is nearly identical to that of principal.curve. When there are multiple lineages and shrink == TRUE, an additional step is added to the iterative procedure, forcing curves to be similar in the neighborhood of shared points (ie., before they branch).

The extend argument determines how to construct the piece-wise linear curve used to initiate the recursive algorithm. The initial curve is always based on the lines between cluster centers and if extend = 'n', this curve will terminate at the center of the endpoint clusters. Setting extend = 'y' will allow the first and last segments to extend beyond the cluster center to the orthogonal projection of the furthest point. These options typically have little to no impact on the final curve, but can occasionally help with stability issues.

When shink == TRUE, we compute a shrinkage curve, w_l(t), for each lineage, a non-increasing function of pseudotime that determines how much that lineage should be shrunk toward a shared average curve. We set w_l(0) = 1, so that the curves will perfectly overlap the average curve at pseudotime 0. The weighting curve decreases from 1 to 0 over the non-outlying pseudotime values of shared cells (where outliers are defined by the 1.5*IQR rule). The exact shape of the curve in this region is controlled by shrink.method, and can follow the shape of any standard kernel function's cumulative density curve (or more precisely, survival curve, since we require a decreasing function). Different choices of shrink.method seem to have little impact on the final curves, in most cases.

References

Hastie, T., and Stuetzle, W. (1989). "Principal Curves." Journal of the American Statistical Association, 84:502–516.

Street K, Risso D, Fletcher RB, et al. (2017). "Slingshot: Cell lineage and pseudotime inference for single-cell transcriptomics." bioRxiv. 10.1101/128843


lingxuez/SOUP documentation built on May 28, 2019, 3:38 p.m.