Skip to content

WNN step error: 'Fewer than 20 cells with Jaccard sim > 0' in COSMOS #3

Description

@Zhihong-Lin

Thank you for developing and open-sourcing COSMOS. It has been very helpful for our spatial multi-omics analysis. But when training reaches the WNN stage (w == 1), the program exits with the following error:

Fewer than 20 cells with Jacard sim > 0

Dataset summary

  • Modalities: RNA + CODEX
  • Number of cells: ~264,000
  • RNA features: ~6,000 genes
  • CODEX features: 16 protein markers
  • Spatial coordinates available for all cells

Workflow

cosmos_comb = cosmos.Cosmos(adata1=adata1, adata2=adata2)
cosmos_comb.preprocessing_data(n_neighbors=10)

cosmos_comb.train(
    spatial_regularization_strength=0.05,
    z_dim=10,
    lr=1e-3,
    wnn_epoch=500,
    total_epoch=1000,
    random_seed=seed,
    gpu=0
)

I tested different settings (e.g. z_dim from 50 to 10, n_neighbors from 10 to 60 ), but the error persists whenever WNN is executed.

I am wondering whether this behavior could be related to the large difference in feature dimensionality between the two modalities (RNA with ~6,000 genes versus CODEX with 16 protein markers). In large-scale datasets, could this imbalance lead to very sparse KNN overlap during the WNN step, and thus trigger the Jaccard-based bandwidth estimation error?

Thank you very much for your time and for making COSMOS publicly available. I look forward to your insights.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions