detectCellOutlier {singleCellTK} | R Documentation |
A wrapper function for isOutlier. Identify outliers from numeric vectors stored in the SingleCellExperiment object.
detectCellOutlier( inSCE, slotName, itemName, sample = NULL, nmads = 3, type = "both", overwrite = TRUE )
inSCE |
A SingleCellExperiment object. |
slotName |
Desired slot of SingleCellExperiment used for plotting. Possible options: "assays", "colData", "metadata", "reducedDims". Required. |
itemName |
Desired vector within the slot used for plotting. Required. |
sample |
A single character specifying a name that can be found in
|
nmads |
Integer. Number of median absolute deviation. Parameter may be adjusted for more lenient or stringent outlier cutoff. Default 3. |
type |
Character. Type/direction of outlier detection; whether the lower/higher outliers should be detected, or both. Options are "both", "lower", "higher". |
overwrite |
Boolean. If TRUE, and this function has previously generated an outlier decision on the same itemName, the outlier decision will be overwritten. Default TRUE. |
A SingleCellExperiment object with ” added to the colData slot. Additionally, the decontaminated counts will be added as an assay called 'decontXCounts'.
data(scExample, package = "singleCellTK") sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'") sce <- runDecontX(sce[,sample(ncol(sce),20)]) sce <- detectCellOutlier(sce, slotName = "colData", sample = sce$sample, nmads = 4, itemName = "decontX_contamination", type = "both")