Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add macsima reader #224

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

add macsima reader #224

wants to merge 4 commits into from

Conversation

berombau
Copy link

Redo of previous work in #156.

This tries to solve #155.

Lung_adc_demo

from spatialdata_io import macsima
sdata = macsima('./Lung_adc_demo', subset=1000)
sdata

Note that now the cycle information is added to a table and that the coordinate systems are named after the dataset.

SpatialData object
├── Images
│     └── 'Lung_adc_demo_image': DataTree[cyx] (116, 1000, 1000), (116, 500, 500)
└── Tables
      └── 'Lung_adc_demo_table': AnnData (0, 116)
with coordinate systems:
    ▸ 'Lung_adc_demo', with elements:
        Lung_adc_demo_image (Images)

For the LiverCellAtlas data, it stores all middle cycle nuclei channels in a different image and table.

SpatialData object
├── Images
│     ├── 'HumanLiverH36_image': DataTree[cyx] (102, 5772, 6621), (102, 2886, 3310), (102, 1443, 1655), (102, 721, 827)
│     └── 'HumanLiverH36_nuclei_image': DataTree[cyx] (50, 5772, 6621), (50, 2886, 3310), (50, 1443, 1655), (50, 721, 827)
└── Tables
      ├── 'HumanLiverH36_nuclei_table': AnnData (0, 50)
      └── 'HumanLiverH36_table': AnnData (0, 102)
with coordinate systems:
    ▸ 'HumanLiverH36', with elements:
        HumanLiverH36_image (Images), HumanLiverH36_nuclei_image (Images)

Parsing of raw data should be another PR. It differs in the handling of metadata for channels and cycles from https://gustaveroussy.github.io/sopa/api/io/#sopa.io.macsima @quentinblampey.

The channel naming is different (R{cycle} {marker} instead of {marker}{ (duplicate_number if duplicate markers)). I like both styles, so I'll try to add later style as well and add a parameter.

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 26.60550% with 160 lines in your changes missing coverage. Please review.

Project coverage is 43.76%. Comparing base (cff4896) to head (47d651d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_io/readers/macsima.py 28.41% 131 Missing ⚠️
src/spatialdata_io/readers/_utils/_utils.py 17.14% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
- Coverage   45.50%   43.76%   -1.75%     
==========================================
  Files          22       23       +1     
  Lines        2149     2367     +218     
==========================================
+ Hits          978     1036      +58     
- Misses       1171     1331     +160     
Files with missing lines Coverage Δ
src/spatialdata_io/readers/_utils/_utils.py 33.33% <17.14%> (-9.29%) ⬇️
src/spatialdata_io/readers/macsima.py 28.41% <28.41%> (ø)

@berombau berombau changed the title [WIP] add macsima reader add macsima reader Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants