diffcyt icon indicating copy to clipboard operation
diffcyt copied to clipboard

Diffcyt on SCE - Error in glmFit.default()

Open sudu87 opened this issue 5 years ago • 0 comments

Hello, I have been using CATALYST for my SCE experiment, which are discussed in these issues (please see for experimental details). https://github.com/HelenaLC/CATALYST/issues/119 https://github.com/HelenaLC/CATALYST/issues/121

Dimensionality reduction with 4000 cells per sample. NOTE: I have a lot more than this. However, my decently powerful Mac works overnight if I use all cells.

set.seed(123)
sce <- runDR(sce, dr = "UMAP",cells = 4000, features = "type")

Checking reduced dimensions

reducedDimNames(sce)
 ##  [1] "UMAP"
head(reducedDim(sce, "UMAP"))
 ##       [,1] [,2]
##  [1,]   NA   NA
##  [2,]   NA   NA
##  [3,]   NA   NA
tail(reducedDim(sce, "UMAP"))
##                [,1]      [,2]
##  [578650,] 1.430724 0.2447781
##  [578651,]       NA        NA
##  [578652,]       NA        NA
## Differential testing with diffcyt

### create design & contrast matrix
```r
design <- createDesignMatrix(ei(sce), cols_design = "condition")
contrast <- createContrast(c(0, 1))

test for

- differential abundance (DA) of clusters

- differential states (DS) within clusters

res_DA <- diffcyt(sce, clustering_to_use = "meta10",
    analysis_type = "DA", method_DA = "diffcyt-DA-edgeR",
    design = design, contrast = contrast, verbose = FALSE)
res_DS <- diffcyt(sce, clustering_to_use = "meta10",
    analysis_type = "DS", method_DS = "diffcyt-DS-limma",
    design = design, contrast = contrast, verbose = FALSE)

Error in glmFit.default(y = y$counts, design = design, dispersion = dispersion, : NA dispersions not allowed

I am guessing this is due to all the NAs. If yes then why does this happen and how to get rid of NAs here ?

sudu87 avatar Jun 24 '20 07:06 sudu87