Open darcymi opened 2 years ago
Hi darcymi,
sorry for the delayed response. I was traveling last week and didn't check my emails.
First of all, thank you for opening the issue; it's always important to hear when things don't work. I tried to run the example that you were referencing, but I cannot reproduce the error:
library(glmGamPoi)
sce <- muscData::Kang18_8vs8()
#> snapshotDate(): 2021-05-18
#> see ?muscData and browseVignettes('muscData') for documentation
#> loading from cache
set.seed(1)
# Take highly expressed genes and proper cells:
sce_subset <- sce[rowSums(counts(sce)) > 100,
sample(which(sce$multiplets == "singlet" &
! is.na(sce$cell) &
sce$cell %in% c("CD4 T cells", "B cells", "NK cells")),
1000)]
# Convert counts to dense matrix
counts(sce_subset) <- as.matrix(counts(sce_subset))
# Remove empty levels because glm_gp() will complain otherwise
sce_subset$cell <- droplevels(sce_subset$cell)
fit <- glm_gp(sce_subset, design = ~ cell + stim + stim:cell - 1,
reference_level = "NK cells")
de_res <- test_de(fit, contrast = `stimstim` + `cellCD4 T cells:stimstim`,
pseudobulk_by = paste0(stim, "-", ind))
head(de_res)
#> name pval adj_pval f_statistic df1 df2 lfc
#> 1 LINC00115 9.488240e-01 1.00000000 4.158485e-03 1 53.36198 -0.5418114
#> 2 NOC2L 5.827811e-01 1.00000000 3.054703e-01 1 53.36198 -0.7664476
#> 3 PLEKHN1 9.999228e-01 1.00000000 9.461520e-09 1 53.36198 31.3439440
#> 4 HES4 1.333351e-01 0.93055719 2.323538e+00 1 53.36198 -3.8056793
#> 5 ISG15 6.650242e-05 0.04620493 1.873020e+01 1 53.36198 3.3361152
#> 6 TNFRSF18 5.992403e-01 1.00000000 2.794707e-01 1 53.36198 -0.7194761
Created on 2022-11-14 by the reprex package (v2.0.1)
Could you run the same code (preferably through reprex) and post the output so that we can figure out why the error occurs for you?
Best, Constantin
Hi,
I was having issues with my own dataset, so tried running the one given in the vignette and ran into the same problem.
In the vignette, starting in section 3.2 I ran the code from
sce <- muscData::Kang18_8vs8()
tode_res <- test_de(fit, contrast =
stimstim+
cellCD4 T cells:stimstim, pseudobulk_by = paste0(stim, "-", ind))
This last command resulted in the following error: Error in value[3L] : Object 'stim' not found. Allowed variables are:
There are no allowed variables listed after the colon. Is there a way to get it to recognize the colData columns? I am running glmGamPoi version 1.8.0.
Thanks for your help!