saezlab / liana

LIANA: a LIgand-receptor ANalysis frAmework
https://saezlab.github.io/liana/
GNU General Public License v3.0
160 stars 28 forks source link

liana_tensor_c2c batch effects #139

Open daymecita opened 5 months ago

daymecita commented 5 months ago

I just recently tested tensor-cell2cell with LIANA following the R tutorial from here: https://saezlab.github.io/liana/articles/liana_cc2tensor.html. I have 10 samples, 7 disease and 3 healthy. I had integrated all of them using Seurat and next annotated the cell types.
I first ran liana_bysample using the sca method. Then I ran liana_tensor_c2c. My sce (converted from Seurat) object doesn't have corrected counts. I did log normalized the counts, though. The issue is that I am getting only one signicant factor (factor 2) that seems to be capturing batch effects, since the samples PsA6 and 7 were processed along with the HD 1,2, and 3 and they cluster together according to the loadings (see image below). Do we need to use corrected counts in tensor-c2c? How does it account for batch effects?

Contexts_heatmap_tensor

This is my code:

sce <- liana_bysample(sce = sce, sample_col = "context", idents_col = "CellID_l1", method = "sca", # we use SingleCellSignalR's score alone expr_prop = 0, # expression proportion threshold inplace=TRUE, # saves inplace to sce return_all = FALSE # whether to return non-expressed interactions ) sce <- liana_tensor_c2c(sce = sce, score_col = 'LRscore', rank = 7, # set to None to estimate for you data! how='outer', # defines how the tensor is built conda_env = NULL, # used to pass an existing conda env with cell2cell use_available = FALSE # detect & load cell2cell if available )

dbdimitrov commented 5 months ago

Hi @daymecita,

You could perform batch correction with e.g. scVI or COMBAT prior to running LIANA+ on the normalised counts. Though, it is also possible that these approaches might also remove some of the biological signal.

We (@hmbaghdassarian) showcase scVI in this supplementary note: https://ccc-protocols.readthedocs.io/en/latest/notebooks/ccc_R/S1_Batch_Correction.html; along with a series of detailed workflows detailing LIANA and Tensor-cell2cell.