saezlab / liana

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

Integrated Cytotalk method error: non-numeric argument to numeric function #66

Closed AltayYuzeir closed 1 year ago

AltayYuzeir commented 1 year ago

Hello, I have been working with this Seurat data file, included in the link, it is not very big - https://uni-bonn.sciebo.de/f/1980218563. I have run it through the liana_wrap() function, and all integrated methods (natmi, sca, cellphonedb, logfc, connectome) work, but when I run it with the integrated cellchat method, I get an error, which I cannot understand.

error

dbdimitrov commented 1 year ago

Hey @AltayYuzeir,

I'll try to find some time this week to check this and come back to you. Must say though that I would suggest on focusing on the aggregate of the default methods.

Daniel

Smilenone commented 1 year ago

I also met the same error.

dbdimitrov commented 1 year ago

Hi @AltayYuzeir,

I've been trying to access the file, but I keep getting the same message, and sciebo seems to work otherwise: image

AltayYuzeir commented 1 year ago

hey, So i think our university client sciebo uni-bonn.sciebo.de is undergoing maintenance I will host it in google drive now

AltayYuzeir commented 1 year ago

nvm, I have lost this file, sciebo is the only place I have it I think

dbdimitrov commented 1 year ago

@AltayYuzeir no worries, can wait, once online I'll try to reproduce and fix the error for LIANA's next update :)

AltayYuzeir commented 1 year ago

The original link is working now

dbdimitrov commented 1 year ago

Hi @AltayYuzeir not for me, it requires a username and password

AltayYuzeir commented 1 year ago

try this one https://uni-bonn.sciebo.de/s/7QhKl6XbYLyusR8

dbdimitrov commented 1 year ago

Hi @AltayYuzeir,

I noticed that you have cell types with 1 cell and this is what was breaking CytoTalk's crosstalk scores. Although, the other methods would run regardless of this, I would still advise not to infer interactions for cell types with less than 5-10 cells.

To liana's latest version, I added a parameter to liana_wrap that will automatically remove any such cell types.

Hope this helps

AltayYuzeir commented 1 year ago

I see, thanks for looking into this. I want to ask about few things about the general concepts behind liana.

  1. How can we use cytotalk crosstalk scores and the logfc comb for magnitude and specificity in liana_dotplot() - directly or after some scaling. And liana_wrap() lacks cellphobedb's mean values column, as described in the liana_dotplot() help section.
  2. I interpret the expression magnitude of the liana_dotplot() to be the amount of ligand produced by the source and interaction specificity to be the amount of receptors produced by the target cells. Is this interpretation correct? Thanks a lot!
dbdimitrov commented 1 year ago

Hi @AltayYuzeir

  1. liana_wrap does not lack cellphonedb's columns, they would be available in the cellphonedb element provided by liana_wrap before running liana_aggregate. So, one could easily join those with a left_join on the ligand-receptor-source-target fields.

  2. Roughly yes, but more as the how highly expressed the ligand and receptor genes are :)

Smilenone commented 1 year ago

Can I say that the smaller the aggregate_rank is, the more important the L-R pairs are (since it can be interpreted as p-values)?

AltayYuzeir commented 1 year ago

Yes I see now. And what about the cytototalk crosstalk scores and the logfc combined parameter. Can they be used in the dotplot and how?

dbdimitrov commented 1 year ago

Hi @Smilenone yes :), the more likely they are to be highly ranked across the different methods

dbdimitrov commented 1 year ago

Hi @AltayYuzeir you could plot anything technically, you just need to provide the relevant column names, though I'm not sure why choose logFC and the crosstalk scores.

Smilenone commented 1 year ago

Hi @Smilenone yes :), the more likely they are to be highly ranked across the different methods

Thanks for your answer~

AltayYuzeir commented 1 year ago

I see, in my analysis I try to give information to the wet lab people on what interactions to concentrate on. So I would like to get a type of consensus between the different specificity and magnitude methods to strengthen my suggestion. Thanks anyway, closing the issue now.

dbdimitrov commented 1 year ago

@AltayYuzeir by default, liana as in the basic tutorial will provide both. For example, the dotplot there I plot magnitude using SingleCellSignalR's LRscore and the aggregate_rank. You could supplement the latter by e.g. natmi's edge weight for specificity or logFC, etc

dbdimitrov commented 1 year ago

I plan to clarify these points in future updates.