-
Notifications
You must be signed in to change notification settings - Fork 21
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
Handle AnnData regions tables #85
Comments
Very cool to see this update coming to A few comments on the procedure you described. In You can see this in action by 1) cloning spatialdata-sandbox and the The relevant parts of the code are here (matching the |
Another comment on using the table to store other types of geometries: I think that storing points, circles, etc in tables should be considered still as in a prototype phase. In the ome-ngff-tables-prototype repo we tried to use the table to store points, circles and even (in a hacky way) polygons, as showed in the merfish example, even if the NGFF Table specs doesn't say anything about how to store coordinates in a table, but after these tests, we decided to use tables (in spatialdata) only for storing annotations but not spatial coordinates/geometries. We still use table to annotate features on circles, polygons (so that in a downstream analysis it doesn't matter if, say, cells, are represented as polygons or labels), but we don't allow tables to be in a coordinate system. We instead save the coordinates in In the future we should all share our gained experiences when discussing how to store coordinates, geometries and ROIs in term of future NGFF specs. |
Hi Luca, I just tried the
I have the following versions:
Previously before I updated to latest
when at commit:
Any idea what branch/commit I need to use here for all those repos? |
@LucaMarconato I don't know if you've seen ome/ngff#178 which discusses other table formats as part (or NOT) of the NGFF spec, including @kkyoda is using NGFF AnnData tables to store tracks (e.g. see openssbd/bdz#2) and I have been looking to handle that in napari-ome-zarr to display tracks in napari - see #81 But if you prefer to store points & tracks in parquet then we're already seeing divergence on this and it would be good to converge so we don't waste time on different solutions. What are the advantages with parquet for that data, compared with AnnData? |
Hi, I think the problem is due to the fact that the version in Additionally, please mind the following two points:
|
Initially we drafted the table specification to also specify how to store points and other geometries ome/ngff#64 (comment). But later we decided to simplify it and focus solely on how to use tables to store annotations for labels ome/ngff@f8f2fd0. This is because otherwise the table specification would have required to define transformation and coordinate systems for the coordinates, but the transforms specs are still being discussed, so we wanted to be decoupled from it and rather iterate later on. As a result of not specifying how to store geometries in the table specification, we selected the storage method that best suited development and runtime efficiency. Currently, we use After the first iteration of development is complete, and the transformation specification is finalized, we would like to re-discuss how to store points and shapes, agree on a representation and change our io APIs. |
I'm not installing anything via pypi. https://github.com/scverse/napari-spatialdata/tree/spatialdata (2716a40 ) So I get:
I'm on this branch of spatialdata-sandbox: I still see:
I get the same import Error from a different location if I try:
Strangely, looking at the local code for |
OK - so I created a new conda env and reinstalled everything... The installed versions look the same as above, but the import is working this time!
|
But...
|
Solved via chat, it was a typo in the info showed in |
Trying that...
|
Can you please do
tries to override the editable installation even if it is there. |
Ah! There was a problem introduced by a recent pr. I will fix it. Please notice that (at least on my machine), running the commands described in #85 (comment) will reinstall
|
Yes, I had already found that I needed to re-install from source! Strange... |
Great that it works! One extra info, we uploaded (and we are keeping up-to-date) the various datasets already converted to NGFF in a S3 storage; you can find the URLs here. We haven't tested loading the data from the cloud yet (I think we have to fix the consolidated metadata). I'll keep you posted, but if you want to also experiment, any feedback would be appreciated 😊 |
With ome/ome-zarr-py#256 (work in progress) we hope to have AnnData tables available to
napari-ome-zarr
.I've been using this to read "points" tables and display as tracks:
#81
So now I also want to handle "regions" tables in napari.
I've been looking at the https://github.com/kevinyamauchi/ome-ngff-tables-prototype/blob/main/examples/save_load_squidpy_segment.py example.
The logic as I follow it goes:
X and var
) and combine it with theobs
to give "features_table"cell_id
column, and check if we're missing any label valuescell_id
so that ALL label values have a corresponding row in the tablecell_id
, so that the order of rows matches the order of label values in the label layerThen you can use https://www.napari-hub.org/plugins/napari-properties-viewer to show a table of features for each label:
In this screenshot, I edited the code to use
cell_id
for color rather than a random column:I was thinking of doing something similar in
napari-ome-zarr
with the following differences:labels
layer. Just add table info to a single labels layer.cell_id
OR possibly use a dictionary for features withcell_id
as key instead of a dataframe (might be less performant)?obs
data. Either just pickcell_id
as above, or not add color at-all.cc @kevinyamauchi @LucaMarconato @giovp
The text was updated successfully, but these errors were encountered: