jinworks / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics
GNU General Public License v3.0
245 stars 35 forks source link

The parameter "scale.distance" for "computeCommunProb". #27

Open zzz1314520 opened 9 months ago

zzz1314520 commented 9 months ago

Hello, thank you for your excellent package and excellent work. However, I have a question about the "scale.distance" parameter in "computeCommunProb". I'm not quite sure about the meaning of this parameter.

In your description of "computeCommunProb",We choose this values such that the minimum value of the scaled distances is in [1,2].

When I run computeCommunProb, the following message appears:

[1] ">>> Run CellChat on spatial transcriptomics data using distances as constraints of the computed communication probability <<< [2023-12-01 17:02:49.796026]"
The suggested minimum value of scaled distances is in [1,2], and the calculated value here is  55.2037 

And when I look at your tutorial, it says

 [1] ">>> Run CellChat on spatial transcriptomics data using distances as constraints of the computed communication probability <<< [2023-11-26 22:42:03.590081]"
#> The suggested minimum value of scaled distances is in [1,2], and the calculated value here is  1.30553 

But my calculated value is 55, while yours is 1.3, which is a significant difference. Can you please confirm if this is correct? ps:my date is from stereo-seq Looking forward to your reply

sqjin commented 9 months ago

@zzz1314520 You can decrease the parameterscale.distance or simply set distance.use = FALSE. Do you use the bin-based or cell-based methods?

zzz1314520 commented 9 months ago

Thank you for your answer. before Professor suye0620 answered stereo-seq's“So you can set scale.factors = list(spot.diameter = 25, spot = 50) or scale.factors = list(spot.diameter = 25, spot = 1) with the parameter interaction.length = 200 in computeCommunProb function.“ So we set scale.distance = 200.

I wonder what effect does the size of this parameter have? ps:We use bin50 for analysis Looking forward to your reply