Spot size
I am using CosMx for my analysis and it is not entirely clear to me what is the spot size. The documentation states:
tol: the tolerance factor to increase the robustness when comparing the center-to-center distance against the interaction.range. This can be the half value of cell/spot size in the unit of um. If the cell/spot size is not known, we provide a function computeCellDistance to compute the cell center-to-center distance. tol can be the the half value of the minimum center-to-center distance. Of note, CellChat does not need an accurate tolerance factor, which is used for determining whether considering the cell-pair as spatially proximal if their distance is greater than interaction.range but smaller than “interaction.range + tol”.
What is the spot size exactly? CosMx, in the metadata, provides the width and height of every cell, can these be used to decide the tolerance value? E.g. tol = min(height, width)/2
@AlbertoFabbri93 When I work on the CosMx data, I use the following setting. But I think your setting of tol = min(height, width)/2 is also fine.
d = computeCellDistance(spatial.locs, ratio = 1) spot.size = min(d$d.spatial@x)*conversion.factor spatial.factors = list(ratio = conversion.factor, tol = spot.size/2)