-
Notifications
You must be signed in to change notification settings - Fork 67
Table spec proposal #64
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
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
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -175,7 +175,174 @@ For this example we assume an image with 5 dimensions and axes called `t,c,z,y,x | |||||
| └── n | ||||||
| </pre> | ||||||
|
|
||||||
| Tables {#table-layout} | ||||||
| ---------------------- | ||||||
| The following describes the expected layout for tabular data. OME-NGFF tables are a compatible subset of the [AnnData model](https://github.com/theislab/anndata). OME-NGFF tables implement the X (central dense matrix), the obs table (annotations on the rows of X) and the var table (annotations on the columns of X). | ||||||
|
|
||||||
| <pre> | ||||||
| . # Root folder, potentially in S3, | ||||||
| │ # with a flat list of images by image ID. | ||||||
|
will-moore marked this conversation as resolved.
Outdated
|
||||||
| │ | ||||||
| └── 123.zarr | ||||||
| └── table # The table group is a container which holds a table that is compatible with a subset of AnnData. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| │ # The table group MAY be in the root of the zarr file. | ||||||
| ├── .zgroup # The table group MAY be in an image, labels, or points group. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
| ├── .zattrs | ||||||
| │ | ||||||
| ├── X # You MAY add an zarr array `X`. | ||||||
| │ │ # `X` MUST not be a complex type (i.e., MUST be a single type) | ||||||
| │ │ # `X` MAY be chunked as the user desires. | ||||||
| │ ├── .zarray | ||||||
| │ ├── 0.0 | ||||||
| │ │ ... | ||||||
| │ └── n.m | ||||||
| | | ||||||
| ├── layers # You MAY add a `layers` group, which contains dense matrices with the same shape as X. | ||||||
| │ │ | ||||||
| │ ├── .zgroup | ||||||
| │ ├── .zattrs | ||||||
| │ │ | ||||||
| │ └── layer_0 # You MAY add a zarr array for each layer | ||||||
| | | # Each layer array MUST have the same shape as X | ||||||
| | | # Each layer array SHOULD be chunked the same as X | ||||||
| | ├── 0.0 | ||||||
| │ │ ... | ||||||
| │ └── n.m | ||||||
| │ | ||||||
| ├── obs # You MAY add an obs group container. The obs group holds a table of annotations on the rows in X. | ||||||
| │ │ # The rows in obs MUST be index-matched to the rows in X. | ||||||
| │ ├── .zgroup | ||||||
| │ │ | ||||||
| │ ├── .zattrs # `.zattrs` MUST contain `"_index"`, which is the name of the column in obs to be used as the index. | ||||||
| │ │ # `.zattrs` MUST contain `"column-order"`, which is a list of the order of the non-_index columns. | ||||||
| │ │ # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. | ||||||
| │ │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| │ │ | ||||||
| │ └── col_0 # Each column in the obs table is a 1D zarr array. The rows can be chunked as the user desires. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| │ ├── .zarray # However, the obs columns SHOULD be chunked in the same way as the rows in X (if present). | ||||||
| │ │ | ||||||
| │ └─ 0 | ||||||
| ├── var # You MAY add a var group container. The var group holds a table of annotations on the columns in X. | ||||||
| | │ # The rows in var MUST be index-matched to the columns in X (if present). | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MUST contain `"_index"`, which is the name of the column in obs to be used as the index. | ||||||
| | │ # `.zattrs` MUST contain `"column-order"`, which is a list of the order of the non-_index columns. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | │ | ||||||
| | └── col_0 # Each column in the var table is a 1D zarr array. The rows can be chunked as the user desires. | ||||||
| | ├── .zarray # However, the var columns SHOULD be chunked in the same way as the columns in X. | ||||||
| | │ | ||||||
| | └─ 0 | ||||||
| | | ||||||
| ├── obsm # You MAY add a obsm group comtainer. The obsm group contains arrays that annotate the rows in X. | ||||||
| | │ # The rows in each array MUST be index-matched to the rows in X (if present). | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dict"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | │ | ||||||
| │ └── obsm_0 # You MAY add a zarr array for each obsm matrix. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see where
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue exists for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've basically assumed that you can
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately that's not the case if you're loading data over
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 However, in the other case, I don't know how easy it is to adopt a similar approach for the Using a naive approach, I tried simply listing the sub-directories of these groups, and adding those names to the E.g. add this to E.g. This approach feels a bit hacky, and would need to be recursive in some cases (e.g. uns). If a client relies on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a quick side note on the viewer, the new
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joshmoore So you prefer the 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
| | | # Each obsm array MUST have the same number of rows as X. | ||||||
| | | # The rows in each obsm array SHOULD be chunked the same as the rows in X. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| | ├── 0.0 | ||||||
| │ │ ... | ||||||
| │ └── n.m | ||||||
| | | ||||||
| ├── varm # You MAY add a varm group comtainer. The varm group contains arrays that annotate the columns in X. | ||||||
| | │ # The rows in each array MUST be index-matched to the columns in X (if present). | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dict"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| | │ | ||||||
| │ └── varm_0 # You MAY add a zarr array for each varm matrix. | ||||||
| | | # Each varmm array MUST have the same number of rows as columns in X. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| | | # The rows in each obsm array SHOULD be chunked the same as the columns in X. | ||||||
| | ├── 0.0 | ||||||
| │ │ ... | ||||||
| │ └── n.m | ||||||
| | | ||||||
| ├── obsp # You MAY add a obsp group comtainer. The obsp group contains sparse arrays that annotate the rows in X. | ||||||
| | │ # The rows in each array MUST be index-matched to the columns in X (if present). | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dict"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | │ | ||||||
| │ └── obsp_0 # You MAY add a zarr group for each obsp array. | ||||||
| | | # Each obsp array MUST have the same number of rows as rows in X. | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | | # `.zattrs` MAY contain `"shape"` which is an array giving the shape of the densified array. | ||||||
| | | | ||||||
| | ├── data # You MUST add a one-dimensional zarr array named "data". | ||||||
| | | | # `data` MAY be chunked as the user desires. | ||||||
| | | | | ||||||
| | | ├── 0 | ||||||
| │ │ | ... | ||||||
| │ | └── n | ||||||
| | | | ||||||
| | ├── indices # You MUST add a one-dimensional zarr array named "indices". | ||||||
| | | | # `indices` MAY be chunked as the user desires. | ||||||
| | | | | ||||||
| | | ├── 0 | ||||||
| │ │ | ... | ||||||
| │ | └── n | ||||||
| | | | ||||||
| | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indices and indptr must be ints. Were you thinking of more?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
|
||||||
| | | # `indptr` MAY be chunked as the user desires. | ||||||
| | | | ||||||
| | ├── 0 | ||||||
| │ | ... | ||||||
| │ └── n | ||||||
| | | ||||||
| ├── varp # You MAY add a varp group comtainer. The varp group contains sparse arrays that annotate the columns in X. | ||||||
| | │ # The rows in each array MUST be index-matched to the columns in X (if present). | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"dict"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | │ | ||||||
| │ └── varp_0 # You MAY add a zarr group for each varp array. | ||||||
| | | # Each varp array MUST have the same number of rows as columns in X. | ||||||
| | | | ||||||
| │ ├── .zgroup | ||||||
| | | | ||||||
| | ├── .zattrs # `.zattrs` MAY contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. | ||||||
| | │ # `.zattrs` MAY contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ||||||
| | | # `.zattrs` MAY contain `"shape"` which is an array giving the shape of the densified array. | ||||||
| | | | ||||||
| | ├── data # You MUST add a one-dimensional zarr array named "data". | ||||||
| | | | # `data` MAY be chunked as the user desires. | ||||||
| | | | | ||||||
| | | ├── 0 | ||||||
| │ │ | ... | ||||||
| │ | └── n | ||||||
| | | | ||||||
| | ├── indices # You MUST add a one-dimensional zarr array named "indices". | ||||||
| | | | # `indices` MAY be chunked as the user desires. | ||||||
| | | | | ||||||
| | | ├── 0 | ||||||
| │ │ | ... | ||||||
| │ | └── n | ||||||
| | | | ||||||
| | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | ||||||
| | | # `indptr` MAY be chunked as the user desires. | ||||||
| | | | ||||||
| | ├── 0 | ||||||
| │ | ... | ||||||
| │ └── n | ||||||
| └── uns | ||||||
|
kevinyamauchi marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| </pre> | ||||||
|
|
||||||
| High-content screening {#hcs-layout} | ||||||
| ------------------------------------ | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.