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
117 stars 14 forks source link

Error with cell type names containing spaces #18

Closed koelschnj closed 1 year ago

koelschnj commented 1 year ago

I ran an analysis set up to view "T cells" as a receiver against all other cells as senders in my single nuclei RNA-seq data, and when I try to view prioritization tables of top interactions for T cells as senders it generates the following message:

prioritized_tbl_oi_PostT_50 = get_top_n_lr_pairs(multinichenet_output$prioritization_tables, 50, groups_oi = group_oi, senders_oi = "T cell")

plot_oi = make_sample_lr_prod_activity_plots(multinichenet_output$prioritization_tables, prioritized_tbl_oi_PostT_50) Warning messages: 1: In max(.) : no non-missing arguments to max; returning -Inf 2: In max(., na.rm = TRUE) : no non-missing arguments to max; returning -Inf 3: In max(.) : no non-missing arguments to max; returning -Inf 4: In min(.) : no non-missing arguments to min; returning Inf

After renaming all of my annotated cells such as "T cells", "B cells", "Dendritic cells", etc. to nomenclature without spaces ("Tcell", "DC", etc.) I had no issues viewing the prioritization tables or other data points.

Unsure if this is a bug or not, but after some trial and error this fixed my issues.

browaeysrobin commented 1 year ago

Hi @koelschnj

This is not a bug, and should normally be described in each vignette.

Important: the column names of group, sample, cell type, batches and covariates should be syntactically valid (make.names) Important: All group, sample, cell type, batch and covariate names should be syntactically valid as well (make.names)

It's not ideal either, but some of the functions used under the hood require this.