fateBias {FateID} | R Documentation |
Computation of fate bias
Description
This function computes fate biases for single cells based on expression data from a single cell sequencing experiment. It requires a clustering partition and a target cluster representing a commited state for each trajectory.
Usage
fateBias(
x,
y,
tar,
z = NULL,
minnr = NULL,
minnrh = NULL,
adapt = TRUE,
confidence = 0.75,
nbfactor = 5,
use.dist = FALSE,
seed = NULL,
nbtree = NULL,
verbose = FALSE,
...
)
Arguments
x |
expression data frame with genes as rows and cells as columns. Gene IDs should be given as row names and cell IDs should be given as column names. This can be a reduced expression table only including the features (genes) to be used in the analysis. |
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. |
tar |
vector of integers representing target cluster numbers. Each element of |
z |
Matrix containing cell-to-cell distances to be used in the fate bias computation. Default is |
minnr |
integer number of cells per target cluster to be selected for classification (test set) in each iteration. For each target cluster, the |
minnrh |
integer number of cells from the training set used for classification. From each training set, the |
adapt |
logical. If |
confidence |
real number between 0 and 1. See |
nbfactor |
positive integer number. Determines the number of trees grown for each random forest. The number of trees is given by the number of columns of th training set multiplied by |
use.dist |
logical value. If |
seed |
integer seed for initialization. If equal to |
nbtree |
integer value. If given, it specifies the number of trees for each random forest explicitely. Default is |
verbose |
logical. If |
... |
additional arguments to be passed to the low level function |
Details
The bias is computed as the ratio of the number of random forest 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. Cells are assigned to a trajectory if they exhibit a significant bias >1 for this trajectory.
Value
A list with the following three components:
probs |
a data frame with the fraction of random forest votes for each cell. Columns represent the target clusters. Column names are given by a concatenation of |
votes |
a data frame with the number of random forest votes for each cell. Columns represent the target clusters. Column names are given by a concatenation of |
tr |
list of vectors. Each component contains the IDs of all cells on the trajectory to a given target cluster. Component names are given by a concatenation of |
rfl |
list of randomForest objects for each iteration of the classification. |
trall |
vector of cell ids ordered by the random forest iteration in which they have been classified into one of the target clusters. |
Examples
x <- intestine$x
y <- intestine$y
tar <- c(6,9,13)
fb <- fateBias(x,y,tar,minnr=5,minnrh=20,adapt=TRUE,confidence=0.75,nbfactor=5)
head(fb$probs)