scverse / scverse/spatialdata-io

Read `cell_feature_matrix` in market format

Open
#287 4 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

Some Xenium datasets deposited in GEO lack h5 file format and instead decided to upload market format. For example: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM8253804

Of course it is possible to ask the authors to update the record. But maybe it is useful and better for other cases like this to add the ability to read the file in market format? Perhaps also then it is possible to add support for zarr in case someone decides to upload that one instead?

For now, I have tried to workaround this but the only solution was to avoid reading the AnnData entirely, read the file with scanpy and then assign it to sadata.tables. Following this code:

sdata = io.xenium(".", cells_table=False, cells_as_circles=False, cells_boundaries=False, nucleus_boundaries=False)
adata = sc.read_10x_mtx("cell_feature_matrix")
sdata.tables["mydata"] = adata

But of course this causes a lot of information to be missing and this may cause other problems. Is there any other way to work around this issue?

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 with the io.xenium entry point and inspect how it currently reads cell_feature_matrix. Compare that path with the scanpy read_10x_mtx workaround and the assignment to sdata.tables['mydata']. Done means Xenium data in market format can be loaded through the reader without losing the information currently missing from the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.