Open vivek-verma202 opened 4 years ago
Just an update, I tried running the same using testDA_GLMM(), which requires using calcCounts(), which needs running generateClusters(). However,
> sce <- generateClusters(sce)
Error: Argument 'exprs' must be numeric matrix with colnames attribute set
> typeof(sce@assays@data@listData[["exprs"]])
[1] "double"
> dim(sce@assays@data@listData[["exprs"]])
[1] 14 15257202
> sce@assays@data@listData[["exprs"]] <- as.matrix(sce@assays@data@listData[["exprs"]])
> typeof(sce@assays@data@listData[["exprs"]])
[1] "double"
> dim(sce@assays@data@listData[["exprs"]])
[1] 14 15257202
> sce <- generateClusters(sce)
Error: Argument 'exprs' must be numeric matrix with colnames attribute set
Tried with normalize = T:
> da_res1 <- diffcyt(sce,
+ formula = da_formula1, contrast = contrast,
+ analysis_type = "DA", method_DA = "diffcyt-DA-GLMM",
+ normalize = T, norm_factors = "TMM",
+ clustering_to_use = "meta20", verbose = T
+ )
using SingleCellExperiment object from CATALYST as input
using cluster IDs from clustering stored in column 'meta20' of 'cluster_codes' data frame in 'metadata' of SingleCellExperiment object from CATALYST
calculating features...
calculating DA tests using method 'diffcyt-DA-GLMM'...
There were 20 warnings (use warnings() to see them)
> topTable(da_res1, format_vals = T)
DataFrame with 20 rows and 3 columns
cluster_id p_val p_adj
<factor> <numeric> <numeric>
1 1 0 0
2 2 0 0
3 3 0 0
4 4 0 0
5 5 0 0
... ... ... ...
19 19 0.00e+00 0.00e+00
20 20 0.00e+00 0.00e+00
14 14 1.20e-13 1.33e-13
18 18 7.59e-09 7.99e-09
10 10 1.09e-02 1.09e-02
> warnings()
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
Identical warning message for 20 times.
Using the most minimalistic model didn't help either:
> da_formula1 <- createFormula(ei,
+ cols_fixed = c("condition"),
+ cols_random = "date"
+ )
> contrast <- createContrast(c(0, 1))
> da_res1 <- diffcyt(sce,
+ formula = da_formula1, contrast = contrast,
+ analysis_type = "DA", method_DA = "diffcyt-DA-GLMM",
+ normalize = T, norm_factors = "TMM",
+ clustering_to_use = "meta20", verbose = T
+ )
using SingleCellExperiment object from CATALYST as input
using cluster IDs from clustering stored in column 'meta20' of 'cluster_codes' data frame in 'metadata' of SingleCellExperiment object from CATALYST
calculating features...
calculating DA tests using method 'diffcyt-DA-GLMM'...
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
> topTable(da_res1, format_vals = T)
DataFrame with 20 rows and 3 columns
cluster_id p_val p_adj
<factor> <numeric> <numeric>
1 1 0 0
2 2 0 0
3 3 0 0
4 4 0 0
5 5 0 0
... ... ... ...
17 17 0.00e+00 0.00e+00
19 19 0.00e+00 0.00e+00
20 20 0.00e+00 0.00e+00
18 18 5.02e-05 5.28e-05
10 10 7.44e-04 7.44e-04
Hello Lukas, Thank-you for Diffcyt. I had a quick question about setting up contrast matrix for mixed model. I hypothesize that the cell cluster proportions depend on the condition (case-status, binary) when corrected for age and sex (fixed effect), and the date of batch processing (categorical, 4 values, random effect)
Either I am about to publish a Science / Nature paper or I messed up (the probability of latter is close to 1). Could you please let me know where am I messing up? Also, like Toptable, is there a quick & easy way to check the effect size? Thanks a lot! Vivek