prcurve: Computation of a principal curve for a given dimensional...

View source: R/FateID_functions.R

prcurveR Documentation

Computation of a principal curve for a given dimensional reduction representation

Description

This function computes a principal curve for a given dimensional reduction representation which is specified by component names of an object returned by compdr using the princurve package.

Usage

prcurve(y, fb, dr, k = 2, m = "cmd", trthr = NULL, start = NULL, ...)

Arguments

y

clustering partition. A vector with an integer cluster number for each cell. The order of the cells has to be the same as for the columns of x.

fb

fateBias object returned by the function fateBias.

dr

list of dimensional reduction representations returned by the function compdr.

k

integer number for the dimension to be used. This dimension has to be present in dr. Default value is 2.

m

name of the dimensional reduction algorithms to be used for the principal curve computation. One of cmd, dm, tsne, umap. Default value is cmd. Has to be a component of dr, i.e. previously computed by compdr.

trthr

real value representing the threshold of the fraction of random forest votes required for the inclusion of a given cell for the computation of the principal curve. If NULL then only cells with a significant bias >1 are included for each trajectory. The bias is computed as the ratio of the number of votes for a trajectory and the number of votes for the trajectory with the second largest number of votes. By this means only the trajectory with the largest number of votes will receive a bias >1. The siginifcance is computed based on counting statistics on the difference in the number of votes. A significant bias requires a p-value < 0.05. Default value is NULL.

start

integer number representing a specified starting cluster number for all trajectories, i. e. a common progenitor cluster. The argument is optional. Default value is NULL.

...

additional arguments to be passed to the low level function principal_curve.

Details

The function computes a principal curve for each differentiation trajectory by considering only cells that are assigned to the trajectory with a significant fate bias >1 or at least trthr of the random forest votes, respectively.

For simulateneous computation and plotting of the principal curve, see function plotFateMap.

Value

A list of the following two components:

pr

A list of principal curve objects produced by the principal_curve function from the princurve package. Each component corresponds to one differentiation trajectory giving rise to one of the target clusters from the fb object.

trc

A list of ordered cell IDs for each trajectory in pr.

Examples


x <- intestine$x
y <- intestine$y
tar <- c(6,9,13)
fb <- fateBias(x,y,tar,z=NULL,minnr=5,minnrh=10,nbfactor=5,use.dist=FALSE,seed=NULL,nbtree=NULL)
dr <- compdr(x,z=NULL,m="cmd",k=2,tsne.perplexity=30)
pr <- prcurve(y,fb,dr,k=2,m="cmd",trthr=0.25,start=NULL)


FateID documentation built on June 14, 2022, 5:06 p.m.