Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Table spec proposal #64
Table spec proposal #64
Changes from 9 commits
4559ce5
c9148a7
d3330a2
957555f
f8f2fd0
83c9491
8d2d64e
d715323
98be5fa
bc72166
f4a13c6
ffdd046
0d5636e
1d59ca4
d91da64
4ad6a90
fac5855
e3f779c
75fb5e1
00e85c1
5d0b5b4
fe2cfad
692464f
cc83a82
b2de201
283d21b
bf81797
4b46882
f3e960b
ad48296
55fb1a8
337971b
e9f707b
22844a4
ea8a622
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really cool to see, and it'd be really important to have this flexibility of having tables both in root and in image/labels group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Points haven't been defined yet.
Also, I'm not completley sure what this means given the bioformats2raw layout and the fact we can now put the tables group on its own. Maybe we should remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I removed the references to points and changed it to say that the tables group may be in root or another group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where
obsm_0
is referenced in the parent.zattrs
?How do we know to load the
obsm_0
data (if we can'tls
the directories belowobsm
)?The
obs/.zattrs
has"column-order"
which lists columns, but there isn't an equivalent forobsm/.zattrs
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue exists for
obsp
,varm
andvarp
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've basically assumed that you can
ls
, and not maintained order for these.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that's not the case if you're loading data over
https
(or for somes3
backends), so we've avoided making that assumption elsewhere on the spec to allow web-based accessing of OME-NGFF.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for the locations of everything in the hierarchy being either computable (implementations know how to figure it out) or explicitly listed in the metadata.
FWIW, the OME2022 zarr-java discussion today touched on exactly this point and the need to perhaps bubble this requirement up to the zarr spec itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's consider the 2 issues separately, since I think the cost/benefit of consolidated metadata are different...
For the top-level
image.zarr/tables/.zattrs
it is very easy to manually add the metadata to list the child tables as in kevinyamauchi/ome-ngff-tables-prototype#12. This should be a requirement (MUST) in the spec so all readers can rely on it (without needing to try consolidated metadata).However, in the other case, I don't know how easy it is to adopt a similar approach for the
obsm, obsp, layers, raw and uns
groups? I'm not very familiar with AnnData and haven't dug into the creation of these groups.Using a naive approach, I tried simply listing the sub-directories of these groups, and adding those names to the
.zattrs
of each group.E.g. add this to
write_table_regions()
from theome-ngff-tables-prototype
:E.g.
obsm/.zattrs
now looks like this:This approach feels a bit hacky, and would need to be recursive in some cases (e.g. uns).
I don't have a strong preference for this compared with
consolidate_metadata()
.These sets of metadata aren't the core matrix data for the ann-data table. They're not even displayed in napari (in the screenshot) so it's less critical than listing the tables above.
If a client relies on
consolidate_metadata()
and it's not available, then they simply wouldn't display this metadata.A client wouldn't need to always try with and without consolidated metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick side note on the viewer, the new
napari-spatialdata
, that we haven't involved in the discussion since atm it needs some bugfix and its scope is beyond displaying annotated tables (it experiments with points and polygons as well), shows by default all those entries (obsm
,obs
, etc), with the exception ofuns
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having data disappear because of something that did or did not get called in the python code and is otherwise not recorded doesn't feel great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshmoore So you prefer the
# write group names into .zattrs
approach above (like a manual consolidate metadata)? Or another alternative?The presence or absence of everything in the viewers is always depends on whether the creating code did or did not add something. That's the choice that the code has when the spec says
SHOULD
orMAY
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other things being equal, I prefer that all details & members of a fileset are either well-known beforehand (i.e. static in the spec) or can be determined from the metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivirshup, do you think we should provide more detail on what should be in
data
,indices
, andindptr
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indices and indptr must be ints.
Were you thinking of more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point regarding indices and indptr, @ivirshup.
I was also wondering if there is a spec we should reference or if saying csc/csr sparse matrix is enough for people to know what to put in data/indicies/indptr (I don't work with sparse matrices a ton myself)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just seeing I didn't respond here!
We could link out to wikipedia for a definition?
I think it would be hard to have a concise description that would explain it for someone who's totally unfamiliar, and a full description would be kinda long.
Maybe:
data
: array containing values of the non-zero entriesindices
column/ row indices of the non-zero entries (for CSR/ CSC respectively)indptr
cumulative offsets for row/ columns indices (CSR/ CSC respectively)