rfcorrect: Random Forests-based Reclassification

View source: R/RaceID.R

rfcorrectR Documentation

Random Forests-based Reclassification

Description

This functions applies random forests-based reclassification of cell clusters to enhance robustness of the final clusters.

Usage

rfcorrect(
  object,
  rfseed = 12345,
  nbtree = NULL,
  final = TRUE,
  nbfactor = 5,
  ...
)

Arguments

object

SCseq class object.

rfseed

Seed for enforcing reproducible results. Default is 12345.

nbtree

Number of trees to be built. Default is NULL and the number of tree is given by the number of cells times nbfactor.

final

logical. If TRUE, then reclassification of cell types using out-of-bag analysis is performed based on the final clusters after outlier identification. If FALSE, then the cluster partition prior to outlier idenitifcation is used for reclassification.

nbfactor

Positive integer number. See nbtree.

...

additional input arguments to the randomForest function of the randomForest package.

Value

The function returns an updated SCseq object with random forests votes written to slot out$rfvotes. The clustering partition prior or post outlier identification (slot cluster$kpart or cpart, if parameter final equals FALSE or TRUE, respectively) is overwritten with the partition derived from the reclassification.

Examples

sc <- SCseq(intestinalDataSmall)
sc <- filterdata(sc)
sc <- compdist(sc)
sc <- clustexp(sc)
sc <- findoutliers(sc)
sc <- rfcorrect(sc)

RaceID documentation built on Sept. 28, 2023, 5:06 p.m.