Hi folks,
I want to use MAST for DGE analysis on dataset processed with Seurat
. I wrote a small function to convert seurat
dataset to sca
:
seu2sca <- function(seu_obj, freq_expressed = 0.2, group, level_group){
sce <- SingleCellExperiment(list(counts = GetAssayData(seu_obj, slot = "counts", assay = "RNA")),
colData = seu_obj@meta.data)
logcounts(sce) <- log2(counts(sce) + 1)
sca <- SceToSingleCellAssay(sce)
expressed_genes <- freq(sca) > freq_expressed
sca <- sca[expressed_genes,]
cdr <-colSums(assay(sca)>0)
sca@colData[["cngeneson"]] <- scale(cdr)
cond <-factor(colData(sca)[[group]])
cond <-relevel(cond,level_group)
sca@colData[["cond"]] <- cond
sca
}
However, I am not sure about following statement from the vignette:
... MAST assumes that log-transformed approximately scale-normalized data is provided.
In the function above raw counts are log transformed, but im not sure what is meant by "approximately scale-normalized". Can you please help me.
Kind regards, Amel
Thank you very much ATpoint, the repository is pretty useful.
Regards, Amel