Skip to content

computeCommunProb does not account for separate samples when calculating spatial distances for multi-ROI / multi-sample data #16

Description

@lh12565

Hi, I am using SpatialCellChat to analyze cell-cell communication in a Xenium dataset that contains multiple distinct Regions of Interest (ROIs) / samples within a single file.
My understanding is that for a standard CellChat (v2) object with multiple samples, the computeCommunProb function uses the samples column in the metadata to correctly calculate communication probabilities separately for each sample, preventing the calculation of interactions between cells from physically distinct samples (e.g., computeRegionDistance considers sample information)
However, when using SpatialCellChat, the computeCommunProb and computeRegionDistance functions do not appear to incorporate this samples information for spatial distance calculations. This means that the algorithm may consider cells from different, physically separated ROIs as being spatially proximal, leading to incorrect communication probabilities.
Is it currently possible to achieve this sample-aware spatial distance calculation directly within SpatialCellChat? If not, is the only workaround to create separate SpatialCellChat objects for each ROI and then compare the results? For large datasets with many ROIs, this becomes quite cumbersome.
Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions