impGenes: Extract genes with high importance values for random forest...

View source: R/FateID_functions.R

impGenesR Documentation

Extract genes with high importance values for random forest classification

Description

This function extracts all genes with an importance value for classifying cells into a given target cluster exceeding a given threshold for at least one of the random forest iterationns.

Usage

impGenes(fb, tn, ithr = 0.02, zthr = 2)

Arguments

fb

fateBias object returned by the function fateBias. If fb is provided, then a principal curve is computed and shown in the plot. Default value is NULL. The curve is only displayed if g equal NULL.

tn

name of a target cluster, i. e. concatenation of a t and the number of a target cluster. Has to correspond to a column name of fb$probs.

ithr

positive real number. Threshold for the required importance measure (mean decrease in accuracy of classification upon removal, see randomForest) to include a gene into the output as important feature for classying cells in tn. Default value is 0.02.

zthr

positive real number. Threshold for the required z-score of the importance measure (importance divided by the standard deviation of importance) to include a gene into the output as important feature for classying cells in tn. Default value is 2.

Value

The function returns a list of two elements.

d

a data frame with mean importance values for all genes surviving the filtering by ithr and zthr. Columns correspond to random forest iterations, starting from the initial target cluster.

d

a data frame with the standard deviation of importance values for all genes surviving the filtering by ithr and zthr. Columns correspond to random forest iterations, starting from the initial target cluster.

The function produces a heatmap of d with hierarchical clustering of the rows using the function pheatmap from the pheatmap package.

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)
k <- impGenes(fb,"t6",ithr=.02,zthr=2)

dgrun/FateID documentation built on June 20, 2022, 12:57 p.m.