outlierByAssay | R Documentation |
Compute outlier score for each sample in each assay using outlier()
run on the top principal components. Mahalanobis distance is used for outlier detect and multivariate normal assumption is used to compute p-values
outlierByAssay(object, assays = names(object), nPC = 2, robust = FALSE, ...)
object |
|
assays |
assays / cell types to analyze |
nPC |
number of PCs to uses for outlier score with |
robust |
use robust covariance method, defaults to |
... |
arguments passed to |
ID
:sample identifier
assay
:specify assay
PCs
:principal components
chisq
:mahalanobis distance that is distributed as chisq(k) k = nPC if the data is multivariate gaussian
z
:z-score corresponding to the chisq distance
outlier()
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# voom-style normalization
res.proc <- processAssays(pb, ~group_id)
# Compute PCs and outlier scores
outlierByAssay( res.proc, c("B cells", "CD14+ Monocytes"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.