saeyslab / multinichenetr

MultiNicheNet: a flexible framework for differential cell-cell communication analysis from multi-sample multi-condition single-cell transcriptomics data
GNU General Public License v3.0
107 stars 14 forks source link

perform_muscat_de_analysis errored #55

Closed vanessadisela closed 4 months ago

vanessadisela commented 7 months ago

Hi,

thanks for this nice tool. I am experiencing an error when running the MIS-C pairwise comparison concerning the muscat_de_analysis for all cell types of my dataset. I subset the cell types before reading them in a SingleCellExperiment and every group has over 100 cells whilst my min_cells threshold is at 5.

The error message reads:

subscript out of bounds <subscriptOutOfBoundsError in x[[1]]: subscript out of bounds> perform_muscat_de_analysis errored for celltype: X Error in dplyr::group_by(): ! Must group by variables found in .data. Column contrast is not found. Column cluster_id is not found.

"filterByExpr.min.count = 0" and "filterByExpr.min.total.count = 0" did not solve the problem, unfortunately.

Do you have any ideas/suggestions how to solve this issue? Thanks so much in advance!

browaeysrobin commented 7 months ago

Hi @vanessadisela

1) Do you get this error on the data in the vignette/tutorial or only on your data? 2) if you only get this on your data, can you provide the cell type abundance plots and all relevant information regarding your setup (contrasts_oi, contrast_tbl, bach/covariate information, ...)

I also do not understand what you mean by "I subset the cell types before reading them in a SingleCellExperiment"

vanessadisela commented 6 months ago

Hi @browaeysrobin ,

to 1. running the tutorial on the sce_subset_misc.rds worked out without any errors, but I indeed got the error on my own dataset. As recommended I did subset the two cell types from my dataset (seurat file), I want to look at previous to converting them to a sce.

  1. sure:

    cell_type species Freq 1 celltype_1 species_1 227 2 celltype_2 species_1 155 3 celltype_1 species_2 161 4 celltype_2 species_2 110

contrasts_oi = c("'species_1- species_2','species_1- species_2'")

contrast_tbl = tibble( contrast = c("species_1- species_2","species_1- species_2"), group = c("species_1","species_2"))

covariates = NA batches = NA

browaeysrobin commented 6 months ago

Hi @vanessadisela

Adding the cell type abundances vs sample plot would be more helpful. Now I am not sure whether you don't have multiple samples per condition ("species") in your case or you do have multiple samples but you did just summarize them yourself.