scverse / scverse/spatialdata-io

ENHANCEMENT: to_legacy_anndata support with region > 1

Open
#318 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
103
Forks
65
Avg merge
1h 8m
Merged PRs (30d)
3

Description

Hi all,

I managed to reproduce this notebook you also presented in the 2024 SpatialData paper, regarding Visium slide integration on a prostate from a unique patient. My main intention was to test SpaTrack, a spatially-aware trajectory inference tool, on multiple slides at once instead of on individual slides, since those multiple slides belong to the same tumoral focus and hence a unique trajectory is highly desirable instead of one per Visium dataset.

However, SpaTrack queries the AnnData object, so I tried to use to_legacy_anndata with the integrated coordinate_system, and encountered this (expected) error:

ValueError: The table needs to annotate exactly one element. Found 3.

I think it would be nice to have a full retrocompatibility also for this (IMHO) very interesting use case. What do you think about it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the linked lundeberg.ipynb workflow and tracing to_legacy_anndata with the integrated coordinate_system until the "exactly one element" error occurs. Clarify the expected legacy AnnData representation for multiple regions, then verify that the proposed behavior remains compatible with the SpaTrack use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.