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

Are logcounts required in sce object? #13

Closed catsargent closed 1 year ago

catsargent commented 1 year ago

Hi,

Please can you confirm whether the count data needs to be log normalized or not in the sce object? In step-by-step mode, when I run get_DE_info on my data it gives an error about not finding logcounts in the assay slot.

However, when I run the wrapper function on that same data, the DE analysis part works (it later fails when reaching the "Combine all the information in prioritization tables" section (I created an issue on github for this). I just wanted to check with you why the wrapper function does not fail if there are not logcounts in the assay slot. Are these somehow generated if using the wrapper script?

Thanks, Catherine

browaeysrobin commented 1 year ago

Hi @catsargent

Only raw counts are necessary if you run the DE analysis and wrapper with default parameters (assay_oi_pb = counts).

Can you provide your exact error message when running get_DE_info if you don't have a logcounts assay? On other datasets, this ran just fine with only the counts assay.

About the wrapper: one of the functions in the wrapper get_abundance_expression_info (and in the step-by-step vignette) will calculate logcounts in case they were absent.

catsargent commented 1 year ago

Hi,

Sorry for the delay in responding - I was on holiday.

This is the error I obtain when run get_DE_info using the step-wise approach and my object does not contain log normalized counts. But from your previous message, it sounds like I would need to have log normalized counts in the object and therefore the error would be expected if they are not found?

Thanks, Catherine

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'pairwiseTTests': 'assay(<SingleCellExperiment>, i="character", ...)' invalid subscript 'i'
'logcounts' not in names(assays(<SingleCellExperiment>))
browaeysrobin commented 1 year ago

Hi @catsargent Is it possible you are running get_DE_info(findMarkers = TRUE) instead of the default? (or have changed some default parameters otherwise? Your error message seems to indicate that you are not using the recommended default parameters (being: assay_oi_pb = "counts", fun_oi_pb = "sum", de_method_oi = "edgeR", findMarkers = FALSE)

catsargent commented 1 year ago

You're right - you had suggested using that option when troubleshooting the error in another issue (https://github.com/saeyslab/multinichenetr/issues/7) and I did not change it back. Thank you!

browaeysrobin commented 1 year ago

OK, thanks for letting me know. I will close this issue and another issue and open a new issue myself indicating there is a bug when using findMarkers = TRUE. Since fixing this is low priority because we don't recommend using it, it will take some time until we will fix this.