Skip to content

Compare cell proportions across samples #53

Open

Description

@xi11

Hi,

Thanks for the great tool, it's very useful!

We have been using spaCET for a project with 10 Visium samples, running per sample. I just want to double check if the cell% could be compared across samples. From what I've understood, as malignant% and major lineage cell% (including unidentified%) are added up to 100, then these cell% represent absolute value, thus deconvolved cell proportions can be comparable across samples. Am I understanding correctly?

Best,
Xiaoxi

Activity

  1. beibeiru commented on Aug 8, 2025

    @beibeiru
    Collaborator

    Hi @xi11,

    When using the in-house reference, we do not recommend comparing inferred cell proportions across samples, as the malignant prediction is based on relative values within each individual sample.

    Best,
    Beibei

  2. beibeiru commented on Aug 8, 2025

    @beibeiru
    Collaborator

    I recommend analyzing each sample individually using SpaCET, and then summarizing the results by calculating the mean (or other statistics) across all samples.

    Best,
    Beibei

  3. xi11 commented on Aug 8, 2025

    @xi11
    Author

    I see. we did apply SpaCET to each sample individually.

    1. so as long as I took/compare inferred cell proportions within each sample for downstream analysis, it should be fine right?
    2. if I have tumor cell% derived from H&E image per spot, then I should be able to rescale TME cell proportions inferred from SpaCET to absolute mode, something like TME_abs = TME_spacet/(1-Malignant) * (1-tumor_cell_proportion_h&e)? Then cell proportions should be comparable across samples.

    Xiaoxi

  4. beibeiru commented on Aug 12, 2025

    @beibeiru
    Collaborator
    1. Yes.
    2. I am not sure, as I currently do not have the benchmark data to verify it.

    Best,
    Beibei

  5. shiyuzhang0522 commented on Feb 10, 2026

    @shiyuzhang0522

    @beibeiru

    Hi, and thank you for this brilliant tool — it has been extremely helpful for our spatial analyses.

    I’m interested in comparing overall immune cell abundance across multiple samples as well. I understand that malignant cell abundance in SpaCET is estimated using sample-specific transcriptomic profiles, so directly comparing raw cell-type proportions between samples may be misleading.

    To address this, I’m considering computing a relative immune abundance per sample, defined as:

    Image

    In other words, an RNA-weighted immune-to-malignant ratio at the sample level.

    Would this be a reasonable way to normalize across samples, or is there a more appropriate approach you would recommend for cross-sample comparison of immune abundance using SpaCET outputs?

    Many thanks,
    Shiyu

  6. beibeiru commented on Feb 10, 2026

    @beibeiru
    Collaborator

    Hi @shiyuzhang0522 ,

    Thank you for your kind words — I’m very glad to hear that SpaCET has been helpful for your spatial analyses.

    Let me first briefly clarify how SpaCET estimates cell fractions, and then address your question about cross-sample comparison and the immune-to-malignant ratio.

    SpaCET works in two main steps.
    First, it estimates the malignant cell fraction for each spot based on the spot-level transcriptomic profile and a malignant gene signature. This malignant score ranges from 0 to 1, where 0 indicates either none (situation 1 below) or relatively low (situation 2 below) malignant abundance and 1 indicates high malignant abundance within the context of the analyzed tissue.

    Second, SpaCET estimates the non-malignant cell-type fractions, which are constrained to sum to (1 − malignant fraction) for each spot.

    Regarding cross-sample comparison:
    Situation 1: If your Visium samples contain both tumor and adjacent normal regions, the inferred malignant fractions are generally comparable across samples, because the model can anchor malignant versus non-malignant states using internal transcriptomic contrasts. In this case, comparing immune abundance across samples (with appropriate aggregation and statistical modeling) is reasonable.

    Situation 2: However, if your samples contain tumor regions only, the malignant fraction is still a relative measure within each sample. In this setting, a value close to 0 does not imply absence of malignant cells, but rather lower malignant abundance relative to other spots in the same sample. As a result, direct comparison of raw cell-type proportions — or ratios involving malignant fractions — across samples should be interpreted with caution.

    If your data corresponds to Situation 1 or you input a customized single-cell reference by SpaCET.deconvolution.matched.scRNAseq, no additional correction is required for cross-sample comparison.

    Please feel free to reach out if you have any further questions.

    Best,
    Beibei

  7. shiyuzhang0522 commented on Feb 11, 2026

    @shiyuzhang0522

    @beibeiru

    Hi Beibei, thank you again for your helpful clarification!

    Now I understand that the malignant cell fraction for each spot is normalized across spots within a dataset (scaled to 0–1 based on the distribution of correlation coefficients). Therefore, additional weighting (e.g., by UMI counts) is not required for normalization purposes at the spot level. Please let me know if this interpretation is correct.

    For sample-level immune abundance, would it be appropriate to aggregate immune cell proportions across all spots (e.g., summing or averaging) to represent overall immune presence in a sample and then compare this metric across samples? I understand from your explanation that this approach would be reasonable when tumor and adjacent normal regions coexist within samples (so that malignant fractions are anchored internally), but may be less reliable for tumor-only samples due to the relative scaling of malignant fractions.

    I would appreciate your thoughts on whether this aggregation strategy is appropriate under these conditions.

    Best regards,
    Shiyu

  8. beibeiru commented on Feb 11, 2026

    @beibeiru
    Collaborator
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