Open giulialopatriello95 opened 9 months ago
I think you need a number that will put 0.03135... into the range [1, 2]. For you, setting scale.distance to 32 should work. While this should get the function working I'm not sure what the implications of the error are. I had a similar issue with Visium replicates that were mapped onto a single graph space using Spiral and I needed to set scale.distance to 134. This is obviously very far from the suggested values so I guess interpret with caution until the author or someone else that understands the how the function works can chime in here.
@der4005 I am not clear how Spiral aligns the spatial locations. But for each replicate before alignment, when you run the code below `spot.size = 65 # the theoretical spot size (um) in 10X Visium conversion.factor = spot.size/scalefactors$spot_diameter_fullres spatial.factors = data.frame(ratio = conversion.factor, tol = spot.size/2)
d.spatial2 <- CellChat::computeCellDistance(coordinates = w10x@images$slice1@coordinates[, c("imagerow", "imagecol")], interaction.range = NULL, ratio = spatial.factors$ratio, tol = spatial.factors$tol) min(d.spatial2[d.spatial2!=0])`
you should get a minimum distance around 100um. You can also check if this holds for the aligned coordinates.
@giulialopatriello95 Hi Giulia, I am wondering if you have worked it out? If you re-install CellChat package, you can get a suggested value of scale.distance
. In addition, we changed seurat_object$slices
to seurat_object$samples
in the new version.
Hi there!
I would like to apply Cellchat spatial analysis on CosMX data.
In computeCommunProb step, I am getting this type of error:
which is not resolving if i am changing the parameter to the suggested values. I've succedeed to process the data if I am setting distance.use=FALSE but I would like to process the analysis with this parameter setted as true.
Best regards, Giulia