From 4559ce55dbc5584dbecd32a55fabf777d0d7ab5b Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Fri, 1 Oct 2021 11:19:21 +0200 Subject: [PATCH 01/33] add tables spec draft --- latest/index.bs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/latest/index.bs b/latest/index.bs index e82eee26..da8b1182 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -154,6 +154,53 @@ multiple levels of resolutions and optionally associated labels. │ ... # are supported. └── n ``` +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). + +``` +. # Root folder, potentially in S3, +│ # with a flat list of images by image ID. +│ +└── 123.zarr + └── table # The table group is a container which holds a table that is compatible with a subset of AnnData. + │ # 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. + ├── .zattrs + │ + ├── X # You MAY add an zarr array `X`. This can be chunked as the user desires, + │ │ + │ ├── .zarray + │ ├── 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. + │ ├── .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 obs 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 +``` High-content screening {#hcs-layout} ------------------------------------ From c9148a74d523053643c67b8163e7a26f0f7b99ab Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Fri, 1 Oct 2021 11:48:32 +0200 Subject: [PATCH 02/33] X must be a single dtype --- latest/index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index da8b1182..a75406bf 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -168,8 +168,9 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar ├── .zgroup # The table group MAY be in an image, labels, or points group. ├── .zattrs │ - ├── X # You MAY add an zarr array `X`. This can be chunked as the user desires, - │ │ + ├── 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 │ │ ... From d3330a2dbc52e4056a7dc83e07bf5403f96a4ba6 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Fri, 1 Oct 2021 17:59:01 +0200 Subject: [PATCH 03/33] add points spec draft --- latest/index.bs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index a75406bf..11597af7 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -189,7 +189,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ ├── .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 obs group holds a table of annotations on the columns in X. + └── 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. @@ -203,6 +203,60 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar └─ 0 ``` +Points {#points-layout} +----------------------- +The following describes the expected layout for point annotations in OME-NGFF. Point annotations are tables with some specified columns and layout. + +``` +. # Root folder, potentially in S3, +│ # with a flat list of images by image ID. +│ +└── 123.zarr + └── points # The points group is a container which holds a table that is compatible with a subset of AnnData. + │ # The points group MAY be in the root of the zarr file. + ├── .zgroup # The table group MAY be in an image or labels group. + ├── .zattrs + │ + ├── X # You MUST add an zarr array `X`. + │ │ # `X` MUST contain the coordinates for the points. + │ │ # `X` MAY contain data in addition to the coordinates. + │ │ # `X` MAY be chunked as the user desires. + │ ├── .zarray + │ ├── 0.0 + │ │ ... + │ └── n.m + │ + ├── obs # You MAY add an obs group container. The obs group holds a table of annotations for the points 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. + │ ├── .zarray # However, the obs columns SHOULD be chunked in the same way as the rows in X. + │ │ + │ └─ 0 + └── var # You MUST add a var group container. The var group holds a table of annotations on the columns in X. + | # The var group MUST contain a column called `column_name` that annotates what each column in X contains. + | # The `column_name` column must annotate the columns in X containing coordinates with 0_p, 1_p, ..., n_p. + │ # The rows in var MUST be index-matched to the columns in X. + | + ├── .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 +``` + + High-content screening {#hcs-layout} ------------------------------------ From 957555ff475db9ed1719a76c06b6c45785d724f2 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Wed, 20 Oct 2021 16:48:01 +0200 Subject: [PATCH 04/33] add spec for axis names --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 11597af7..88b22b72 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -218,7 +218,7 @@ The following describes the expected layout for point annotations in OME-NGFF. P ├── .zattrs │ ├── X # You MUST add an zarr array `X`. - │ │ # `X` MUST contain the coordinates for the points. + │ │ # `X` MUST contain the coordinates for the points. The │ │ # `X` MAY contain data in addition to the coordinates. │ │ # `X` MAY be chunked as the user desires. │ ├── .zarray @@ -242,7 +242,7 @@ The following describes the expected layout for point annotations in OME-NGFF. P │ └─ 0 └── var # You MUST add a var group container. The var group holds a table of annotations on the columns in X. | # The var group MUST contain a column called `column_name` that annotates what each column in X contains. - | # The `column_name` column must annotate the columns in X containing coordinates with 0_p, 1_p, ..., n_p. + | # The `column_name` column MUST annotate the columns in X containing coordinates with the axes labels defined in [[#axes-md]]. │ # The rows in var MUST be index-matched to the columns in X. | ├── .zattrs # `.zattrs` MUST contain `"_index"`, which is the name of the column in obs to be used as the index. From f8f2fd0f386d779ed153caa4cebed8535bd5ec71 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 07:32:22 +0200 Subject: [PATCH 05/33] remove points spec --- latest/index.bs | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 88b22b72..22247627 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -202,61 +202,6 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ └─ 0 ``` - -Points {#points-layout} ------------------------ -The following describes the expected layout for point annotations in OME-NGFF. Point annotations are tables with some specified columns and layout. - -``` -. # Root folder, potentially in S3, -│ # with a flat list of images by image ID. -│ -└── 123.zarr - └── points # The points group is a container which holds a table that is compatible with a subset of AnnData. - │ # The points group MAY be in the root of the zarr file. - ├── .zgroup # The table group MAY be in an image or labels group. - ├── .zattrs - │ - ├── X # You MUST add an zarr array `X`. - │ │ # `X` MUST contain the coordinates for the points. The - │ │ # `X` MAY contain data in addition to the coordinates. - │ │ # `X` MAY be chunked as the user desires. - │ ├── .zarray - │ ├── 0.0 - │ │ ... - │ └── n.m - │ - ├── obs # You MAY add an obs group container. The obs group holds a table of annotations for the points 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. - │ ├── .zarray # However, the obs columns SHOULD be chunked in the same way as the rows in X. - │ │ - │ └─ 0 - └── var # You MUST add a var group container. The var group holds a table of annotations on the columns in X. - | # The var group MUST contain a column called `column_name` that annotates what each column in X contains. - | # The `column_name` column MUST annotate the columns in X containing coordinates with the axes labels defined in [[#axes-md]]. - │ # The rows in var MUST be index-matched to the columns in X. - | - ├── .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 -``` - - High-content screening {#hcs-layout} ------------------------------------ From 8d2d64e3af980527e4034b2ac9e7d8b29ed242b2 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 07:46:03 +0200 Subject: [PATCH 06/33] add layers --- latest/index.bs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/latest/index.bs b/latest/index.bs index 66a3bf47..1e41a79b 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -196,6 +196,17 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ ├── 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. From d715323686e84b998b653f75c48a0a338f5c63a0 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 19:30:47 +0200 Subject: [PATCH 07/33] add varm/obsm --- latest/index.bs | 56 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 1e41a79b..888fcb0f 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -221,18 +221,50 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ ├── .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 + ├── 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 layer + | | # 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 + | ├── 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. + | │ + │ └── varm_0 # You MAY add a zarr array for each layer + | | # Each varmm array MUST have the same number of columns as X + | | # The rows in each obsm array SHOULD be chunked the same as the columns in X + | ├── 0.0 + │ │ ... + │ └── n.m + | + High-content screening {#hcs-layout} From 98be5fa29cb32d023225143b81dd904b67cabbfa Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 20:03:01 +0200 Subject: [PATCH 08/33] add obsp/varp --- latest/index.bs | 89 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 888fcb0f..558bacc8 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -196,6 +196,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ ├── 0.0 │ │ ... │ └── n.m + | ├── layers # You MAY add a `layers` group, which contains dense matrices with the same shape as X. │ │ │ ├── .zgroup @@ -242,9 +243,9 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .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 layer - | | # 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 + │ └── obsm_0 # You MAY add a zarr array for each obsm matrix. + | | # 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. | ├── 0.0 │ │ ... │ └── n.m @@ -257,13 +258,89 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .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. | │ - │ └── varm_0 # You MAY add a zarr array for each layer - | | # Each varmm array MUST have the same number of columns as X - | | # The rows in each obsm array SHOULD be chunked the same as the columns in X + │ └── 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. + | | # 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. + | │ # `.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 + | + ├── 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 From bc7216654498e4a0792ec384eeee73051235a1ca Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 20:34:57 +0200 Subject: [PATCH 09/33] add missing .zarray --- latest/index.bs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/latest/index.bs b/latest/index.bs index 558bacc8..78fa0136 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -205,6 +205,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ └── 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 + | ├── .zarray + | | | ├── 0.0 │ │ ... │ └── n.m @@ -246,6 +248,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ └── obsm_0 # You MAY add a zarr array for each obsm matrix. | | # 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. + | ├── .zarray + | | | ├── 0.0 │ │ ... │ └── n.m @@ -261,6 +265,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ └── 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. | | # The rows in each obsm array SHOULD be chunked the same as the columns in X. + | ├── .zarray | ├── 0.0 │ │ ... │ └── n.m @@ -284,6 +289,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── data # You MUST add a one-dimensional zarr array named "data". | | | # `data` MAY be chunked as the user desires. + | | ├── .zarray | | | | | ├── 0 │ │ | ... @@ -291,6 +297,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── indices # You MUST add a one-dimensional zarr array named "indices". | | | # `indices` MAY be chunked as the user desires. + | | ├── .zarray | | | | | ├── 0 │ │ | ... @@ -298,6 +305,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | | # `indptr` MAY be chunked as the user desires. + | ├── .zarray | | | ├── 0 │ | ... @@ -322,6 +330,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── data # You MUST add a one-dimensional zarr array named "data". | | | # `data` MAY be chunked as the user desires. + | | ├── .zarray | | | | | ├── 0 │ │ | ... @@ -329,6 +338,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── indices # You MUST add a one-dimensional zarr array named "indices". | | | # `indices` MAY be chunked as the user desires. + | | ├── .zarray | | | | | ├── 0 │ │ | ... @@ -336,6 +346,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | | # `indptr` MAY be chunked as the user desires. + | ├── .zarray | | | ├── 0 │ | ... From f4a13c6b4976629792167c4402e9517d829c98c3 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sun, 19 Jun 2022 20:42:02 +0200 Subject: [PATCH 10/33] add @type --- latest/index.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index 78fa0136..3212d194 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -187,7 +187,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar └── table # The table group is a container which holds a table that is compatible with a subset of AnnData. │ # 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. - ├── .zattrs + | + ├── .zattrs # `.zattrs` MUST contain "@type", which is set to `"ngff:table"` │ ├── X # You MAY add an zarr array `X`. │ │ # `X` MUST not be a complex type (i.e., MUST be a single type) From ffdd046f393110e1c133425d33d2069b7dccb000 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 13:30:59 +0200 Subject: [PATCH 11/33] Apply suggestions from code review Co-authored-by: Giovanni Palla --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 3212d194..80ac515c 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -177,14 +177,14 @@ For this example we assume an image with 5 dimensions and axes called `t,c,z,y,x 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). +The following describes the expected layout for tabular data. OME-NGFF tables are compatible with the [AnnData model](https://github.com/theislab/anndata).
 .                             # Root folder, potentially in S3,
 │                             # with a flat list of images by image ID.
 │
 └── 123.zarr
-    └── table                 # The table group is a container which holds a table that is compatible with a subset of AnnData.
+    └── table                 # The table group is a container which holds a table that is compatible with AnnData.
         │                     # 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.
         |

From 0d5636e7daadbabb28e9a008c633cf7d098f9155 Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Mon, 20 Jun 2022 13:50:32 +0200
Subject: [PATCH 12/33] update uns

---
 latest/index.bs | 76 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+), 1 deletion(-)

diff --git a/latest/index.bs b/latest/index.bs
index 80ac515c..77f87a2e 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -352,7 +352,81 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar
         |           ├── 0
         │           |   ...
         │           └── n
-        └── uns
+        |
+        └── uns               # You MAY add a uns containter to store unstructured data.
+            |
+            ├── .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.
+            │
+            ├── group         # You MAY add zarr groups.
+            |   |             # `uns` groups MAY contain groups, dataframes, dense arrays, and sparse arrays.
+            |   |
+            |   ├── .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.
+            |   ...
+            |
+            ├── dataframe_0   # You MAY add dataframe group containers.
+            |   |                 # dataframes MAY be in the `uns` group or in a subgroup.
+            |   │
+            |   ├── .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.
+            |       ├── .zarray   # Each columns MUST be chunked the same, but the chunking may be chosen by the user.
+            |       │
+            |       └─ 0
+            |
+            ├── dense_array       # You MAY dense arrays as n n-dimensional zarr arrays.
+            |   │                 # `dense_array` MUST not be a complex type (i.e., MUST be a single type)
+            |   │                 # `dense_array` MAY be chunked as the user desires.
+            |   |                 # `dense array` MAY be in the `uns` group or in a subgroup.
+            |   |
+            |   ├── .zarray
+            |   ├── 0.0
+            |   │   ...
+            |   └── n.m
+            |
+            └── sparse_array  # You MAY add sparse arrays as a zarr group for each sparse array.
+                |             # sparse arrays MAY be in the `uns` group or in a subgroup.
+                |
+                ├── .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.
+                |   ├── .zarray
+                |   |
+                |   ├── 0
+                │   |   ...
+                |   └── n
+                |
+                ├── indices      # You MUST add a one-dimensional zarr array named "indices".
+                |   |            # `indices` MAY be chunked as the user desires.
+                |   ├── .zarray
+                |   |
+                |   ├── 0
+                │   |   ...
+                |   └── n
+                |
+                └── indptr       # You MUST add a one-dimensional zarr array named "indptr".
+                    |            # `indptr` MAY be chunked as the user desires.
+                    ├── .zarray
+                    |
+                    ├── 0
+                    |   ...
+                    └── n
+        
 
 
From 1d59ca4b57264f848329c90073d5390b874be41e Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 13:52:18 +0200 Subject: [PATCH 13/33] add parent --- latest/index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/latest/index.bs b/latest/index.bs index 77f87a2e..4147aee1 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -189,6 +189,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar ├── .zgroup # The table group MAY be in an image, labels, or points group. | ├── .zattrs # `.zattrs` MUST contain "@type", which is set to `"ngff:table"` + | # `.zattrs` MAY contain "parent", which is the relative path to the data the table is annotating. │ ├── X # You MAY add an zarr array `X`. │ │ # `X` MUST not be a complex type (i.e., MUST be a single type) From d91da6481e149490b20d424703fe9f42fb3af81a Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 15:04:38 +0200 Subject: [PATCH 14/33] MAY -> MUST for anndata encoding --- latest/index.bs | 54 ++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 4147aee1..3eab7426 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -219,8 +219,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ │ │ ├── .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. + │ │ # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. + │ │ # `.zattrs` MUST 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. │ ├── .zarray # However, the obs columns SHOULD be chunked in the same way as the rows in X (if present). @@ -231,8 +231,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── .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. + | │ # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. + | │ # `.zattrs` MUST 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. @@ -244,8 +244,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData. + | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | │ │ └── obsm_0 # You MAY add a zarr array for each obsm matrix. | | # Each obsm array MUST have the same number of rows as X. @@ -261,8 +261,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData. + | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | │ │ └── 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. @@ -277,17 +277,17 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData. + | │ # `.zattrs` MUST 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. - | │ # `.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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. + | | # `.zattrs` MUST 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. @@ -318,17 +318,17 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData. + | │ # `.zattrs` MUST 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. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. + | | # `.zattrs` MUST 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. @@ -358,16 +358,16 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .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. + ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData. + │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. │ ├── group # You MAY add zarr groups. | | # `uns` groups MAY contain groups, dataframes, dense arrays, and sparse arrays. | | | ├── .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 # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | ... | ├── dataframe_0 # You MAY add dataframe group containers. @@ -377,8 +377,8 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | │ | ├── .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. + | │ # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. + | │ # `.zattrs` MUST 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. | ├── .zarray # Each columns MUST be chunked the same, but the chunking may be chosen by the user. @@ -400,9 +400,9 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .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. + ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. + | # `.zattrs` MUST 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. From 4ad6a901174fe65714fadfa22e3406deada6d2ac Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 15:10:52 +0200 Subject: [PATCH 15/33] indices, indptr dtype --- latest/index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 3eab7426..f8c02e90 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -299,7 +299,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── indices # You MUST add a one-dimensional zarr array named "indices". | | | # `indices` MAY be chunked as the user desires. - | | ├── .zarray + | | ├── .zarray # `indices` MUST be an `int` dtype. | | | | | ├── 0 │ │ | ... @@ -307,7 +307,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | | # `indptr` MAY be chunked as the user desires. - | ├── .zarray + | ├── .zarray # `indptr` MUST be an `int` dtype. | | | ├── 0 │ | ... @@ -340,7 +340,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | ├── indices # You MUST add a one-dimensional zarr array named "indices". | | | # `indices` MAY be chunked as the user desires. - | | ├── .zarray + | | ├── .zarray # `indices` MUST be an `int` dtype. | | | | | ├── 0 │ │ | ... @@ -348,7 +348,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | | # `indptr` MAY be chunked as the user desires. - | ├── .zarray + | ├── .zarray # `indptr` MUST be an `int` dtype. | | | ├── 0 │ | ... @@ -414,7 +414,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── indices # You MUST add a one-dimensional zarr array named "indices". | | # `indices` MAY be chunked as the user desires. - | ├── .zarray + | ├── .zarray # `indices` MUST be an `int` dtype. | | | ├── 0 │ | ... @@ -422,7 +422,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | └── indptr # You MUST add a one-dimensional zarr array named "indptr". | # `indptr` MAY be chunked as the user desires. - ├── .zarray + ├── .zarray # `indptr` MUST be an `int` dtype. | ├── 0 | ... From fac58558e30f151a81bb3523518e238c27814494 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 15:18:09 +0200 Subject: [PATCH 16/33] csc matrix --- latest/index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index f8c02e90..fd5694e0 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -285,7 +285,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .zgroup | | - | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively. | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | | # `.zattrs` MUST contain `"shape"` which is an array giving the shape of the densified array. | | @@ -326,7 +326,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | | │ ├── .zgroup | | - | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + | ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively. | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | | # `.zattrs` MUST contain `"shape"` which is an array giving the shape of the densified array. | | @@ -400,7 +400,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .zgroup | - ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData. + ├── .zattrs # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively. │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | # `.zattrs` MUST contain `"shape"` which is an array giving the shape of the densified array. | From e3f779cc9b5c53042790fe4caeb67388fc71e946 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 15:36:47 +0200 Subject: [PATCH 17/33] update table metadata --- latest/index.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index fd5694e0..64ff76d9 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -188,8 +188,11 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ # 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. | - ├── .zattrs # `.zattrs` MUST contain "@type", which is set to `"ngff:table"` - | # `.zattrs` MAY contain "parent", which is the relative path to the data the table is annotating. + ├── .zattrs # `.zattrs` MUST contain "@type", which is set to `"ngff:region_table"` + | # `.zattrs` MUST contain "region", which is the path to the data the table is annotating. + | # "region" MUST be a string (single region) or an array of strings (multiple regions). + | # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to. + | # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used. │ ├── X # You MAY add an zarr array `X`. │ │ # `X` MUST not be a complex type (i.e., MUST be a single type) From 75fb5e18d1e75ea1f3b08be3c7df2c898f6563e0 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 15:38:15 +0200 Subject: [PATCH 18/33] Update index.bs --- latest/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index 64ff76d9..10d16645 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -216,7 +216,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ │ ... │ └── n.m │ - ├── obs # You MAY add an obs group container. The obs group holds a table of annotations on the rows in X. + ├── obs # You MUST 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 │ │ From 00e85c1c717afd9cf894eecfe724967cd8d1fd1c Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 19:36:51 +0200 Subject: [PATCH 19/33] Update latest/index.bs Co-authored-by: Isaac Virshup --- latest/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index 10d16645..4ff0b408 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -268,7 +268,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. | │ │ └── 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. + | | # Each varm array MUST have the same number of rows as columns in X. | | # The rows in each obsm array SHOULD be chunked the same as the columns in X. | ├── .zarray | ├── 0.0 From 5d0b5b42654ec679fd7227c719b9552bae5efaf2 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Mon, 20 Jun 2022 19:37:14 +0200 Subject: [PATCH 20/33] Update latest/index.bs Co-authored-by: Isaac Virshup --- latest/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index 4ff0b408..ff47784e 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -223,7 +223,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar │ ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. - │ │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. + │ │ # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.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. │ ├── .zarray # However, the obs columns SHOULD be chunked in the same way as the rows in X (if present). From fe2cfadafe4de01e429a5b6adfe6922780c5e585 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Wed, 29 Jun 2022 17:54:29 +0200 Subject: [PATCH 21/33] update var table --- latest/index.bs | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index ff47784e..93a19e60 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -237,10 +237,36 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | │ # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData. | │ # `.zattrs` MUST 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 + | ├── array_col # Columns in the var table MAY be 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 + | | + | └── cat_col # Columns in the var table MAY categorical + | ├── .zattrs. # `.zattrs` MUST contain `"encoding-type"`, which is set to `"categorical"` by AnnData. + | | # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData. + | | + | ├── categories + | | ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires. + | | | + | | └─ 0 + | ├── codes + | | ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires. + | | | + | | └─ 0 + | | + | ├── null_col # Columns in the var table MAY nullable integer + | ├── .zattrs. # `.zattrs` MUST contain `"encoding-type"`, which is set to `"nullable-integer"` by AnnData. + | | # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData. + | | + | ├── mask + | | ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires. + | | | + | | └─ 0 + | └── values + | ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires. + | | + | └─ 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). From 692464fb65be496055ba64d47cf01f6646281e38 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sat, 8 Oct 2022 10:24:28 +0200 Subject: [PATCH 22/33] update path spec --- latest/index.bs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index 93a19e60..b7107446 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -190,9 +190,13 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | ├── .zattrs # `.zattrs` MUST contain "@type", which is set to `"ngff:region_table"` | # `.zattrs` MUST contain "region", which is the path to the data the table is annotating. - | # "region" MUST be a string (single region) or an array of strings (multiple regions). + | # "region" MUST be a single path (single region) or an array of paths (multiple regions). + | # "region" paths MUST be objects with a key "path" and the path value MUST be a string. | # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to. | # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used. + | # `.zattrs` MAY contain "intensity_image" which is the path to the image used make measurements. + | # "intensity_image" patht MUST be an object with a key "path" and the path value MUST be a string + | # `.zattrs` the "intensity_image" MUST be in the same coordinate system as the label image specified in "region". │ ├── X # You MAY add an zarr array `X`. │ │ # `X` MUST not be a complex type (i.e., MUST be a single type) From cc83a82c716670fb60d2d7f8a89f4f700a17b788 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Sat, 8 Oct 2022 10:25:58 +0200 Subject: [PATCH 23/33] typo --- latest/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest/index.bs b/latest/index.bs index b7107446..8d4fa38b 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -195,7 +195,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar | # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to. | # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used. | # `.zattrs` MAY contain "intensity_image" which is the path to the image used make measurements. - | # "intensity_image" patht MUST be an object with a key "path" and the path value MUST be a string + | # "intensity_image" path MUST be an object with a key "path" and the path value MUST be a string | # `.zattrs` the "intensity_image" MUST be in the same coordinate system as the label image specified in "region". │ ├── X # You MAY add an zarr array `X`. From b2de201d0217bb533705f5ea4d7aca30767ca685 Mon Sep 17 00:00:00 2001 From: Kevin Yamauchi Date: Fri, 28 Oct 2022 07:29:54 +0200 Subject: [PATCH 24/33] Apply suggestions from @ivirshup Co-authored-by: Isaac Virshup --- latest/index.bs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 8d4fa38b..4e2b801b 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -177,7 +177,8 @@ For this example we assume an image with 5 dimensions and axes called `t,c,z,y,x Tables {#table-layout} ---------------------- -The following describes the expected layout for tabular data. OME-NGFF tables are compatible with the [AnnData model](https://github.com/theislab/anndata). +The following describes the expected layout for tabular data. +OME-NGFF tables are compatible with the [AnnData model](https://github.com/scverse/anndata).
 .                             # Root folder, potentially in S3,
@@ -188,7 +189,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar
         │                     # 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.
         |
-        ├── .zattrs           # `.zattrs` MUST contain "@type", which is set to `"ngff:region_table"`
+        ├── .zattrs           # `.zattrs` MUST contain "type", which is set to `"ngff:region_table"`
         |                     # `.zattrs` MUST contain "region", which is the path to the data the table is annotating.
         |                     # "region" MUST be a single path (single region) or an array of paths (multiple regions).
         |                     # "region" paths MUST be objects with a key "path" and the path value MUST be a string.
@@ -239,14 +240,14 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar
         |   ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
         |   │
         |   ├── array_col     # Columns in the var table MAY be 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
         |   |
-        |   └── cat_col       # Columns in the var table MAY categorical
+        |   └── cat_col       # Columns in the var table MAY be categorical
         |       ├── .zattrs.  # `.zattrs` MUST contain `"encoding-type"`, which is set to `"categorical"` by AnnData.
         |       |             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
         |       |
@@ -411,7 +412,7 @@ The following describes the expected layout for tabular data. OME-NGFF tables ar
             |   ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
-            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
             |   │      
             |   └── col_0         # Each column in the obs table is a 1D zarr array.
             |       ├── .zarray   # Each columns MUST be chunked the same, but the chunking may be chosen by the user.

From 283d21bfdd638bdc1362e974de14cca71c5cce51 Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Fri, 28 Oct 2022 07:32:30 +0200
Subject: [PATCH 25/33] clarify allowed locations

---
 latest/index.bs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/latest/index.bs b/latest/index.bs
index 4e2b801b..e8427237 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -187,7 +187,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
 └── 123.zarr
     └── table                 # The table group is a container which holds a table that is compatible with AnnData.
         │                     # 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.
+        ├── .zgroup           # The table group MAY be in root or in another group.
         |
         ├── .zattrs           # `.zattrs` MUST contain "type", which is set to `"ngff:region_table"`
         |                     # `.zattrs` MUST contain "region", which is the path to the data the table is annotating.

From bf817979abccdf4f0af047865bd7e04513cd66b4 Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Fri, 28 Oct 2022 07:35:32 +0200
Subject: [PATCH 26/33] remove intensity image metadata

---
 latest/index.bs | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/latest/index.bs b/latest/index.bs
index e8427237..1ec7220f 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -195,9 +195,6 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         |                     # "region" paths MUST be objects with a key "path" and the path value MUST be a string.
         |                     # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to.
         |                     # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used.
-        |                     # `.zattrs` MAY contain "intensity_image" which is the path to the image used make measurements.
-        |                     # "intensity_image" path MUST be an object with a key "path" and the path value MUST be a string
-        |                     # `.zattrs` the "intensity_image" MUST be in the same coordinate system as the label image specified in "region".
         │
         ├── X                 # You MAY add an zarr array `X`.
         │   │                 # `X` MUST not be a complex type (i.e., MUST be a single type)

From 4b46882de92d03413f781e09c2454d9bf5fe908b Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Tue, 15 Nov 2022 15:35:26 +0100
Subject: [PATCH 27/33] remove reference to image id

---
 latest/index.bs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/latest/index.bs b/latest/index.bs
index 1ec7220f..e00c8262 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -182,7 +182,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
 
 
 .                             # Root folder, potentially in S3,
-│                             # with a flat list of images by image ID.
+│                             # with a flat list of images.
 │
 └── 123.zarr
     └── table                 # The table group is a container which holds a table that is compatible with AnnData.

From f3e960bbc981deed7245a33b5ec86e7efef51b41 Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Sun, 8 Jan 2023 15:21:38 +0400
Subject: [PATCH 28/33] add tables metadata

---
 latest/index.bs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/latest/index.bs b/latest/index.bs
index e00c8262..32cd2dd4 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -185,6 +185,11 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
 │                             # with a flat list of images.
 │
 └── 123.zarr
+    |
+    ├── .zgroup
+    |
+    ├── .zattrs               # `.zattrs` of any group containing a table MUST contain `"tables"`, which is a list with the keys of the subgroubs that are a table.
+    |
     └── table                 # The table group is a container which holds a table that is compatible with AnnData.
         │                     # The table group MAY be in the root of the zarr file.
         ├── .zgroup           # The table group MAY be in root or in another group.

From ad482962a6c5832e4917923aece8f50f370bc4c3 Mon Sep 17 00:00:00 2001
From: Kevin Yamauchi 
Date: Sun, 8 Jan 2023 15:36:16 +0400
Subject: [PATCH 29/33] add list of keys for subgroups

---
 latest/index.bs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/latest/index.bs b/latest/index.bs
index 32cd2dd4..6361e106 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -188,7 +188,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
     |
     ├── .zgroup
     |
-    ├── .zattrs               # `.zattrs` of any group containing a table MUST contain `"tables"`, which is a list with the keys of the subgroubs that are a table.
+    ├── .zattrs               # `.zattrs` of any group containing a table MUST contain `"tables"`, which is an array with the keys of the subgroubs that are a table.
     |
     └── table                 # The table group is a container which holds a table that is compatible with AnnData.
         │                     # The table group MAY be in the root of the zarr file.
@@ -212,7 +212,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         ├── layers            # You MAY add a `layers` group, which contains dense matrices with the same shape as X.
         │   │
         │   ├── .zgroup
-        │   ├── .zattrs
+        │   ├── .zattrs       # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing a `layer`.
         │   │
         │   └── layer_0       # You MAY add a zarr array for each layer
         |       |             # Each layer array MUST have the same shape as X
@@ -282,6 +282,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         |   |
         |   ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
         |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsm` arrays.
         |   │
         │   └── obsm_0        # You MAY add a zarr array for each obsm matrix.
         |       |             # Each obsm array MUST have the same number of rows as X.
@@ -299,6 +300,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         |   |
         |   ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
         |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varm` arrays.
         |   │
         │   └── varm_0        # You MAY add a zarr array for each varm matrix.
         |       |             # Each varm array MUST have the same number of rows as columns in X.
@@ -315,6 +317,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         |   |
         |   ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
         |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsp` arrays.
         |   │
         │   └── 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.
@@ -356,6 +359,7 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
         |   |
         |   ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
         |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varp` arrays.
         |   │
         │   └── 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.

From 55fb1a8be7d923813ec93a63ff179da4b2955a47 Mon Sep 17 00:00:00 2001
From: giovp 
Date: Wed, 22 Feb 2023 18:03:36 +0100
Subject: [PATCH 30/33] add tables

---
 latest/index.bs | 520 ++++++++++++++++++++++++------------------------
 1 file changed, 264 insertions(+), 256 deletions(-)

diff --git a/latest/index.bs b/latest/index.bs
index 6361e106..d22925e3 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -190,283 +190,291 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver
     |
     ├── .zattrs               # `.zattrs` of any group containing a table MUST contain `"tables"`, which is an array with the keys of the subgroubs that are a table.
     |
-    └── table                 # The table group is a container which holds a table that is compatible with AnnData.
-        │                     # The table group MAY be in the root of the zarr file.
-        ├── .zgroup           # The table group MAY be in root or in another group.
+    └── tables                 # The tables group is a container which holds one or multiple tables that are compatible with AnnData.
         |
-        ├── .zattrs           # `.zattrs` MUST contain "type", which is set to `"ngff:region_table"`
-        |                     # `.zattrs` MUST contain "region", which is the path to the data the table is annotating.
-        |                     # "region" MUST be a single path (single region) or an array of paths (multiple regions).
-        |                     # "region" paths MUST be objects with a key "path" and the path value MUST be a string.
-        |                     # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to.
-        |                     # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used.
-        │
-        ├── 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       # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing a `layer`.
-        │   │
-        │   └── 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
-        |       ├── .zarray
-        |       |
-        |       ├── 0.0
-        │       │   ...
-        │       └── n.m
-        │        
-        ├── obs               # You MUST 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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
-        │   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.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.
-        │       ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
-        |   │
-        |   ├── array_col     # Columns in the var table MAY be 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
-        |   |
-        |   └── cat_col       # Columns in the var table MAY be categorical
-        |       ├── .zattrs.  # `.zattrs` MUST contain `"encoding-type"`, which is set to `"categorical"` by AnnData.
-        |       |             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
-        |       |
-        |       ├── categories
-        |       |  ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires.
-        |       |  |
-        |       |  └─ 0
-        |       ├── codes
-        |       |  ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires.
-        |       |  |
-        |       |  └─ 0
-        |       |
-        |       ├── null_col  # Columns in the var table MAY nullable integer
-        |       ├── .zattrs.  # `.zattrs` MUST contain `"encoding-type"`, which is set to `"nullable-integer"` by AnnData.
-        |       |             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |       |
-        |       ├── mask
-        |       |  ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires.
-        |       |  |
-        |       |  └─ 0
-        |       └── values
-        |          ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires.
-        |          |
-        |          └─ 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsm` arrays.
-        |   │
-        │   └── obsm_0        # You MAY add a zarr array for each obsm matrix.
-        |       |             # 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.
-        |       ├── .zarray
-        |       |
-        |       ├── 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varm` arrays.
-        |   │
-        │   └── varm_0        # You MAY add a zarr array for each varm matrix.
-        |       |             # Each varm array MUST have the same number of rows as columns in X.
-        |       |             # The rows in each obsm array SHOULD be chunked the same as the columns in X.
-        |       ├── .zarray
-        |       ├── 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsp` arrays.
-        |   │
-        │   └── 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` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.          
-        |       │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |       |             # `.zattrs` MUST 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.
-        |       |   ├── .zarray
-        |       |   |
-        |       |   ├── 0
-        │       │   |   ...
-        │       |   └── n
-        |       |
-        |       ├── indices   # You MUST add a one-dimensional zarr array named "indices".
-        |       |   |         # `indices` MAY be chunked as the user desires.
-        |       |   ├── .zarray  # `indices` MUST be an `int` dtype.
-        |       |   |
-        |       |   ├── 0
-        │       │   |   ...
-        │       |   └── n
-        |       |
-        |       └── indptr    # You MUST add a one-dimensional zarr array named "indptr".
-        |           |         # `indptr` MAY be chunked as the user desires.
-        |           ├── .zarray  # `indptr` MUST be an `int` dtype.
-        |           |
-        |           ├── 0
-        │           |   ...
-        │           └── n
+        │                     # The tables group MAY be in the root of the zarr file.
+        ├── .zgroup           # The tables group MAY be in root or in another group.
         |
-        ├── 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
-        |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varp` arrays.
-        |   │
-        │   └── 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` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.           
-        |       │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-        |       |             # `.zattrs` MUST 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.
-        |       |   ├── .zarray
-        |       |   |
-        |       |   ├── 0
-        │       │   |   ...
-        │       |   └── n
-        |       |
-        |       ├── indices   # You MUST add a one-dimensional zarr array named "indices".
-        |       |   |         # `indices` MAY be chunked as the user desires.
-        |       |   ├── .zarray  # `indices` MUST be an `int` dtype.
-        |       |   |
-        |       |   ├── 0
-        │       │   |   ...
-        │       |   └── n
-        |       |
-        |       └── indptr    # You MUST add a one-dimensional zarr array named "indptr".
-        |           |         # `indptr` MAY be chunked as the user desires.
-        |           ├── .zarray  # `indptr` MUST be an `int` dtype.
-        |           |
-        |           ├── 0
-        │           |   ...
-        │           └── n
+        ├── .zattrs           # `.zattrs` MUST contain "tables", which lists the keys of the subgroups that are tables. In this case, the only table is "my_table".
+                              # hence `.zattrs` should be equal to `{ "tables": [ "my_table" ] }`.
         |
-        └── uns               # You MAY add a uns containter to store unstructured data.
+        └── my_table
+            │                     # The table group MAY be in the root of the zarr file.
+            ├── .zgroup           # The table group MAY be in root or in another group.
             |
-            ├── .zgroup
-            |
-            ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
-            │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            ├── .zattrs           # `.zattrs` MUST contain "type", which is set to `"ngff:region_table"`
+            |                     # `.zattrs` MUST contain "region", which is the path to the data the table is annotating.
+            |                     # "region" MUST be a single path (single region) or an array of paths (multiple regions).
+            |                     # "region" paths MUST be objects with a key "path" and the path value MUST be a string.
+            |                     # `.zattrs` MUST contain "region_key" if "region" is an array. "region_key" is the key in `obs` denoting which region a given row corresponds to.
+            |                     # `.zattrs` MAY contain "instance_key", which is the key in `obs` that denotes which instance in "region" the row corresponds to. If "instance_key" is not provided, the values from the `obs` `.zattrs` "_index" key is used.
             │
-            ├── group         # You MAY add zarr groups.
-            |   |             # `uns` groups MAY contain groups, dataframes, dense arrays, and sparse arrays.
-            |   |
-            |   ├── .zgroup
-            |   |
-            |   ├── .zattrs   # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData.           
-            |   │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-            |   ...
+            ├── 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
             |
-            ├── dataframe_0   # You MAY add dataframe group containers.
-            |   |                 # dataframes MAY be in the `uns` group or in a subgroup.
-            |   │
-            |   ├── .zgroup
-            |   │                     
+            ├── layers            # You MAY add a `layers` group, which contains dense matrices with the same shape as X.
+            │   │
+            │   ├── .zgroup
+            │   ├── .zattrs       # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing a `layer`.
+            │   │
+            │   └── 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
+            |       ├── .zarray
+            |       |
+            |       ├── 0.0
+            │       │   ...
+            │       └── n.m
+            │        
+            ├── obs               # You MUST 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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
+            │   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.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.
+            │       ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
             |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
-            |   │      
-            |   └── col_0         # Each column in the obs table is a 1D zarr array.
-            |       ├── .zarray   # Each columns MUST be chunked the same, but the chunking may be chosen by the user.
-            |       │
-            |       └─ 0
+            |   │
+            |   ├── array_col     # Columns in the var table MAY be 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
+            |   |
+            |   └── cat_col       # Columns in the var table MAY be categorical
+            |       ├── .zattrs.  # `.zattrs` MUST contain `"encoding-type"`, which is set to `"categorical"` by AnnData.
+            |       |             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
+            |       |
+            |       ├── categories
+            |       |  ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires.
+            |       |  |
+            |       |  └─ 0
+            |       ├── codes
+            |       |  ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires.
+            |       |  |
+            |       |  └─ 0
+            |       |
+            |       ├── null_col  # Columns in the var table MAY nullable integer
+            |       ├── .zattrs.  # `.zattrs` MUST contain `"encoding-type"`, which is set to `"nullable-integer"` by AnnData.
+            |       |             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |       |
+            |       ├── mask
+            |       |  ├── .zarray # categories MUST be a 1D zarr array. The rows can be chunked as the user desires.
+            |       |  |
+            |       |  └─ 0
+            |       └── values
+            |          ├── .zarray # codes MUST be a 1D zarr array. The rows can be chunked as the user desires.
+            |          |
+            |          └─ 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
+            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsm` arrays.
+            |   │
+            │   └── obsm_0        # You MAY add a zarr array for each obsm matrix.
+            |       |             # 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.
+            |       ├── .zarray
+            |       |
+            |       ├── 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
+            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varm` arrays.
+            |   │
+            │   └── varm_0        # You MAY add a zarr array for each varm matrix.
+            |       |             # Each varm array MUST have the same number of rows as columns in X.
+            |       |             # The rows in each obsm array SHOULD be chunked the same as the columns in X.
+            |       ├── .zarray
+            |       ├── 0.0
+            │       │   ...
+            │       └── n.m
             |
-            ├── dense_array       # You MAY dense arrays as n n-dimensional zarr arrays.
-            |   │                 # `dense_array` MUST not be a complex type (i.e., MUST be a single type)
-            |   │                 # `dense_array` MAY be chunked as the user desires.
-            |   |                 # `dense array` MAY be in the `uns` group or in a subgroup.
+            ├── 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
             |   |
-            |   ├── .zarray
-            |   ├── 0.0
-            |   │   ...
-            |   └── n.m
+            |   ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
+            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `obsp` arrays.
+            |   │
+            │   └── 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` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.          
+            |       │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |       |             # `.zattrs` MUST 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.
+            |       |   ├── .zarray
+            |       |   |
+            |       |   ├── 0
+            │       │   |   ...
+            │       |   └── n
+            |       |
+            |       ├── indices   # You MUST add a one-dimensional zarr array named "indices".
+            |       |   |         # `indices` MAY be chunked as the user desires.
+            |       |   ├── .zarray  # `indices` MUST be an `int` dtype.
+            |       |   |
+            |       |   ├── 0
+            │       │   |   ...
+            │       |   └── n
+            |       |
+            |       └── indptr    # You MUST add a one-dimensional zarr array named "indptr".
+            |           |         # `indptr` MAY be chunked as the user desires.
+            |           ├── .zarray  # `indptr` MUST be an `int` dtype.
+            |           |
+            |           ├── 0
+            │           |   ...
+            │           └── n
             |
-            └── sparse_array  # You MAY add sparse arrays as a zarr group for each sparse array.
-                |             # sparse arrays MAY be in the `uns` group or in a subgroup.
+            ├── 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` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
+            |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |   |                 # `.zattrs` MUST contain `"keys"`, which is an array of the names of the subgroups containing `varp` arrays.
+            |   │
+            │   └── 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` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.           
+            |       │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+            |       |             # `.zattrs` MUST 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.
+            |       |   ├── .zarray
+            |       |   |
+            |       |   ├── 0
+            │       │   |   ...
+            │       |   └── n
+            |       |
+            |       ├── indices   # You MUST add a one-dimensional zarr array named "indices".
+            |       |   |         # `indices` MAY be chunked as the user desires.
+            |       |   ├── .zarray  # `indices` MUST be an `int` dtype.
+            |       |   |
+            |       |   ├── 0
+            │       │   |   ...
+            │       |   └── n
+            |       |
+            |       └── indptr    # You MUST add a one-dimensional zarr array named "indptr".
+            |           |         # `indptr` MAY be chunked as the user desires.
+            |           ├── .zarray  # `indptr` MUST be an `int` dtype.
+            |           |
+            |           ├── 0
+            │           |   ...
+            │           └── n
+            |
+            └── uns               # You MAY add a uns containter to store unstructured data.
                 |
                 ├── .zgroup
                 |
-                ├── .zattrs      # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.           
-                │                # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
-                |                # `.zattrs` MUST 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.
-                |   ├── .zarray
+                ├── .zattrs       # `.zattrs` MUST contain `"encoding-type"`, which is set to `"dict"` by AnnData.           
+                │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+                │
+                ├── group         # You MAY add zarr groups.
+                |   |             # `uns` groups MAY contain groups, dataframes, dense arrays, and sparse arrays.
+                |   |
+                |   ├── .zgroup
                 |   |
-                |   ├── 0
-                │   |   ...
-                |   └── n
+                |   ├── .zattrs   # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` by AnnData.           
+                |   │             # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+                |   ...
                 |
-                ├── indices      # You MUST add a one-dimensional zarr array named "indices".
-                |   |            # `indices` MAY be chunked as the user desires.
-                |   ├── .zarray  # `indices` MUST be an `int` dtype.
+                ├── dataframe_0   # You MAY add dataframe group containers.
+                |   |                 # dataframes MAY be in the `uns` group or in a subgroup.
+                |   │
+                |   ├── .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` MUST contain `"encoding-type"`, which is set to `"dataframe"` by AnnData.
+                |   │                 # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.2.0"` by AnnData.
+                |   │      
+                |   └── col_0         # Each column in the obs table is a 1D zarr array.
+                |       ├── .zarray   # Each columns MUST be chunked the same, but the chunking may be chosen by the user.
+                |       │
+                |       └─ 0
+                |
+                ├── dense_array       # You MAY dense arrays as n n-dimensional zarr arrays.
+                |   │                 # `dense_array` MUST not be a complex type (i.e., MUST be a single type)
+                |   │                 # `dense_array` MAY be chunked as the user desires.
+                |   |                 # `dense array` MAY be in the `uns` group or in a subgroup.
                 |   |
-                |   ├── 0
-                │   |   ...
-                |   └── n
+                |   ├── .zarray
+                |   ├── 0.0
+                |   │   ...
+                |   └── n.m
                 |
-                └── indptr       # You MUST add a one-dimensional zarr array named "indptr".
-                    |            # `indptr` MAY be chunked as the user desires.
-                    ├── .zarray  # `indptr` MUST be an `int` dtype.
+                └── sparse_array  # You MAY add sparse arrays as a zarr group for each sparse array.
+                    |             # sparse arrays MAY be in the `uns` group or in a subgroup.
+                    |
+                    ├── .zgroup
+                    |
+                    ├── .zattrs      # `.zattrs` MUST contain `"encoding-type"`, which is set to `"csr_matrix"` or `"csc_matrix"` for compressed sparse row and compressed sparse column, respectively.           
+                    │                # `.zattrs` MUST contain `"encoding-version"`, which is set to `"0.1.0"` by AnnData.
+                    |                # `.zattrs` MUST 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.
+                    |   ├── .zarray
+                    |   |
+                    |   ├── 0
+                    │   |   ...
+                    |   └── n
+                    |
+                    ├── indices      # You MUST add a one-dimensional zarr array named "indices".
+                    |   |            # `indices` MAY be chunked as the user desires.
+                    |   ├── .zarray  # `indices` MUST be an `int` dtype.
+                    |   |
+                    |   ├── 0
+                    │   |   ...
+                    |   └── n
                     |
-                    ├── 0
-                    |   ...
-                    └── n
+                    └── indptr       # You MUST add a one-dimensional zarr array named "indptr".
+                        |            # `indptr` MAY be chunked as the user desires.
+                        ├── .zarray  # `indptr` MUST be an `int` dtype.
+                        |
+                        ├── 0
+                        |   ...
+                        └── n
         
 
 
From 337971b486cfe856fcb87ea9cdb21626ecdbb664 Mon Sep 17 00:00:00 2001 From: giovp Date: Wed, 22 Feb 2023 18:07:28 +0100 Subject: [PATCH 31/33] rename table --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index d22925e3..8b6ad747 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -196,9 +196,9 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver ├── .zgroup # The tables group MAY be in root or in another group. | ├── .zattrs # `.zattrs` MUST contain "tables", which lists the keys of the subgroups that are tables. In this case, the only table is "my_table". - # hence `.zattrs` should be equal to `{ "tables": [ "my_table" ] }`. + # hence `.zattrs` should be equal to `{ "tables": [ "table" ] }`. | - └── my_table + └── table │ # The table group MAY be in the root of the zarr file. ├── .zgroup # The table group MAY be in root or in another group. | From e9f707ba5e8bc15c0a4a27d53ed1682ec974819e Mon Sep 17 00:00:00 2001 From: giovp Date: Wed, 22 Feb 2023 18:30:19 +0100 Subject: [PATCH 32/33] add my_table consistently --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index 8b6ad747..d22925e3 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -196,9 +196,9 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver ├── .zgroup # The tables group MAY be in root or in another group. | ├── .zattrs # `.zattrs` MUST contain "tables", which lists the keys of the subgroups that are tables. In this case, the only table is "my_table". - # hence `.zattrs` should be equal to `{ "tables": [ "table" ] }`. + # hence `.zattrs` should be equal to `{ "tables": [ "my_table" ] }`. | - └── table + └── my_table │ # The table group MAY be in the root of the zarr file. ├── .zgroup # The table group MAY be in root or in another group. | From 22844a4bb008ab73660f5f5420168d359189c52b Mon Sep 17 00:00:00 2001 From: giovp Date: Thu, 23 Feb 2023 13:50:28 +0100 Subject: [PATCH 33/33] remove comment --- latest/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest/index.bs b/latest/index.bs index d22925e3..ed8b6aa4 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -188,9 +188,9 @@ OME-NGFF tables are compatible with the [AnnData model](https://github.com/scver | ├── .zgroup | - ├── .zattrs # `.zattrs` of any group containing a table MUST contain `"tables"`, which is an array with the keys of the subgroubs that are a table. + ├── .zattrs | - └── tables # The tables group is a container which holds one or multiple tables that are compatible with AnnData. + └── tables # The tables group is a container which holds one or multiple tables that are compatible with AnnData. | │ # The tables group MAY be in the root of the zarr file. ├── .zgroup # The tables group MAY be in root or in another group.