-
Notifications
You must be signed in to change notification settings - Fork 31
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
Added ISS support of Sanger data format #75
Conversation
…ys to maximize flexibility
for more information, see https://pre-commit.ci
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
==========================================
+ Coverage 41.92% 42.00% +0.07%
==========================================
Files 16 17 +1
Lines 854 900 +46
==========================================
+ Hits 358 378 +20
- Misses 496 522 +26
|
Thank for the PR! @giovp the PR enables the support for ISS data. ISS data doesn't come as a commercial format or as the output of a pipeline. I discussed with Tong about supporting readers for non-standard techs, and I think that even if this reader would not be guaranteed to work out-of-the-box like for the other techs, I can see it being helpful for the users as a starting point to build a customize reader for the data. Wdyt, do you think it could be merged (maybe after some generalization via extra parameters) or should be keep the repository strict to documented techs and maybe ask to move this as a notebook or example code, like for the docs? |
Yeah looks good to me! I honestly don't have strong opinion, I guess an idea would be to add it to a separate module called something like "experimental" or so but maybe we don't need to do that yet, and just go with this for now? |
|
Hi @BioinfoTongLI, getting back to this, sorry quite some time passed. I have added my review.
A few additional quick comments, after this we could merge. If you can share the data I can also quickly cover the following tasks.
Thanks! |
@LucaMarconato What is the status? |
Checking this today. @BioinfoTongLI is it ok if I rehost the data that you gave me? The data has a T channel (in the screenshot I show the labels). We currently don't support T, so I need to remove it to be able to test the reader. I would upload the data for T=0. Also, in the future it will be useful to parse the dims directly from the omero metadata when available. It's something that we want to do and when done this reader would benefit from it by become more general. |
@BioinfoTongLI there is a problem with the data you shared. These is the
And these are the unique IDs from the labels object.
Therefore the table is not annotating the labels. I will merge the PR anyway, but please when you have time it would be convenient if you could point to/share some public data (or data that I can upload to our public S3 storage) with correct table <> labels matching, so that in the future we can keep testing the dataset. |
Tested and ready to merge, @BioinfoTongLI thanks for the PR! (my comment above is still valid, please check it if you have time). |
Hi @LucaMarconato , sorry for being silent for a while. I've uploaded another similar dataset onto Zenodo. I've checked the label image and the h5ad is matching this time. Hope that's what you're expecting? |
Thanks for sharing the new data. I have tried the reader with the new data and noticed that some small fixes were required in the reader (already merged here #164). I think the reader works correctly. I have used this code to read and visualize the data: ##
from spatialdata_io.experimental import iss
f = '/Users/macbook/Downloads/10887810'
sdata = iss(f, raw_relative_path='raw.ome.tif', labels_relative_path='label.ome.tif', h5ad_relative_path='iss.h5ad')
from napari_spatialdata import Interactive
Interactive(sdata) This is the plot that I get in napari (I am showing the The black parts of the plot are the background, while the gray areas indicate pixels that have no corresponding annotation in the table (maybe cells that have been filtered out). Precisely, we have that this code from spatialdata import get_element_instances
labels_ids = get_element_instances(sdata['region_labels_image'])
table_ids = sdata['table'].obs['instance_id']
assert set(table_ids).issubset(set(labels_ids))
print(set(labels_ids).difference(set(table_ids))) gives this:
Do you expect some cells not to be annotated by the table? (In any case, the reader seems to work correctly). |
Yes, those are the cells been discarded in the single-cell processing steps. I forgot to mention that! Very nice! Thanks for checking! |
Added ISS support of Sanger data format
No description provided.