earmingol / cell2cell

User-friendly tool to infer cell-cell interactions and communication from gene expression of interacting proteins
BSD 3-Clause "New" or "Revised" License
53 stars 11 forks source link

c2c.analysis.run_tensor_cell2cell_pipeline #58

Open Iammaai opened 3 weeks ago

Iammaai commented 3 weeks ago

Hello, When I used your tool to analyze my data, I found that the graph of tensor decomposition I ran out had no legend, so I couldn't get which color represented which cell. How did you get the legend then?

Hope to get your answer!

Thanks !

earmingol commented 3 weeks ago

Hi! It could be due to the version of matplotlib you are using. Which version are you using?

I recommend using v.3.7.3. Also, if you are using plotnine in combination with matplotlib (for example when using LIANA), I know that importing plotnine also messes up the plots from tensor-cell2cell.

Iammaai commented 3 weeks ago

Hi!Thank you very much for your answer!

The version of matplotlib I used was 3.7.2.After I changed the version of matplotlib to 3.7.3 as you said, the result is still the same as before.I'm also wondering why?

I have one more question.When I installed the new version, there was a problem that my version of pandas was too low to install the matplotlib dependency package, because my version of pandas was 1.3.5, and he needed the version of pandas to be higher than 1.5.0.Before, there was no result in the process of tensor decomposition. After reading some questions on GitHub, you answered that the pandas version is 1.3.5. After I modified the pandas version to 1.3.5, the result was indeed produced.I don't know if the relationship between the matplotlib dependency package and the pandas version will affect the result of my drawing.

In addition,plotnine you mentioned may affect the result of tensor-cellcell. I have uninstalled plotnine, but the result is still without legend.

The results without legend that I obtained using your COVID-19 data are attached. BALF-TensorFactorization

Thanks!

earmingol commented 3 weeks ago

Hi! Quick question, which python version and cell2cell version are you using? You might need creating a new environment with proper versions I think. This could be a good starting point: https://github.com/saezlab/ccc_protocols/tree/main/env_setup

Iammaai commented 2 weeks ago

Hi! Quick question, which python version and cell2cell version are you using? You might need creating a new environment with proper versions I think. This could be a good starting point: https://github.com/saezlab/ccc_protocols/tree/main/env_setup

Hi!Thank you for your reply!My python version is 3.9, and my cell2cell version is 0.6.4.

I have seen that python is 3.10 on this website, and the versions of some other packages have been updated. I am trying the new environment, because the GPU I use has some problems when installing cuda, and I am trying to solve the problem to see if it can be successful.

earmingol commented 2 weeks ago

I think before trying a new environment you should try updating cell2cell to the latest version (0.7.4), the legend issue was solved in v0.7.0 (see notes here). I think you are having this issue because your version is v0.6.4

Iammaai commented 2 weeks ago

I think before trying a new environment you should try updating cell2cell to the latest version (0.7.4), the legend issue was solved in v0.7.0 (see notes here). I think you are having this issue because your version is v0.6.4

Hi!Thank you very much for your answer, this legend problem has been solved!

However, I still have a small problem. When I installed cell2cell version 0.7.4, the pands version showed that it should be automatically updated to the new version, but when I ran your example at the beginning, there was a tensor decomposition error. Then I read your answer and set pands version to 1.3.5 to solve this problem. But now if I use cell2cell as the new version, does the pands version need to be updated?

Looking forward to your reply!

earmingol commented 2 weeks ago

Can you show me what error you get with the new pandas version? I could generate a quick fix for that to allow compatibility. Anyways, I don't think you need to update pandas if you don't want to do it.

Also, pandas 1.5.1 could be a newer and safer version to use.

Iammaai commented 2 weeks ago

Can you show me what error you get with the new pandas version? I could generate a quick fix for that to allow compatibility. Anyways, I don't think you need to update pandas if you don't want to do it.

The mistake was:TypeError:Passing a set as an indexer is not supported.Use a list instead. 微信图片_20240614230422

At that time, the problem was very puzzling to me, and I tried many methods but failed to solve it. Then I saw that others had the same problem, and you replied that you should change the pandas version to 1.3.5, and I solved the problem after modifying the version.Now I don't know if the problem will occur again in the version update, so I dare not update the pandas version.

earmingol commented 2 weeks ago

Oh this issue shouldn't happen with the latest version of cell2cell, it was already fixed :) so feel free to update pandas if you want

Iammaai commented 2 weeks ago

Oh this issue shouldn't happen with the latest version of cell2cell, it was already fixed :) so feel free to update pandas if you want

Thank you very much for your answer, which is very helpful to me!