diff --git a/latest/generate_anndata_example.py b/latest/generate_anndata_example.py index 447c27ce..ee1bf55e 100644 --- a/latest/generate_anndata_example.py +++ b/latest/generate_anndata_example.py @@ -33,6 +33,7 @@ def write_anndata(adata, filename, chunks): root = zarr.open(filename, mode="w") root.array("some_image", np.array([0]), chunks=(1,)) tables = root.create_group("tables") + tables.attrs["tables"] = ["/anndata/obs", "/anndata/var", "/anndata/obsm", "/anndata/varm", "/anndata/obsp", "/anndata/varp"] adgroup = tables.create_group("anndata") adgroup.attrs["anndata"] = "0.9.1" adgroup.attrs["other-metadata"] = "metadata describing how the anndata annotates some_image" @@ -96,6 +97,7 @@ def write_anndata_suggestion(adata, filename, chunks): root = zarr.open(filename, mode="w") root.array("some_image", np.array([0]), chunks=(1,)) tables = root.create_group("tables") + tables.attrs["tables"] = ["/anndata/obs", "/anndata/var"] adgroup = tables.create_group("anndata") adgroup.attrs["anndata"] = "0.9.1" adgroup.attrs["other-metadata"] = "metadata describing how the anndata annotates some_image" @@ -107,7 +109,6 @@ def write_anndata_suggestion(adata, filename, chunks): row_names = np.array(["X", "log_transformed", "other_data"]) layers.create_dataset("row_names", data=row_names, dtype=object, object_codec=numcodecs.VLenUTF8()) layers.attrs["annotated-data"] = [{"array": "/tables/anndata/X", "dimension": "2"}] - obs.attrs["column-order"] = ["row_names"] # obs (combines obs, obsm, obsp) localChunks = (chunks[0],) diff --git a/latest/index.bs b/latest/index.bs index df4240e6..3ea013b6 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -237,12 +237,12 @@ The on-disk format of a table group looks like this: └── 123.zarr | ├── .zgroup - ├── .zattrs | └──tables | ├── .zgroup - ├── .zattrs + ├── .zattrs # A table group's `.zattrs` file MUST contain an attribute "tables" that lists all + | # tables in the group with relative paths, e.g., `{"tables": ["table_1", "some/nested/table_2"]}` | └── table_1 # A table group holds arrays (called columns) with one or more dimensions, | # where the number of rows n MUST be the same across all arrays. @@ -253,7 +253,6 @@ The on-disk format of a table group looks like this: ├── column_1 # The table group MAY hold zero, one, or an arbitrary number of column arrays. | | | ├── .zarray - | ├── .zattrs | | | ├── 0.0 | | ... @@ -262,7 +261,6 @@ The on-disk format of a table group looks like this: └── row_names # The table group SHOULD contain a 1D array of strings of length n called `row_names`. | ├── .zarray - ├── .zattrs | ├── 0 | :