Skip to content

Commit

Permalink
Add test for HCS datset (#76)
Browse files Browse the repository at this point in the history
* Add basic test data layout

* Add test with a real HCS dataset

* Add HCS to docs

* Remove tables from test data
  • Loading branch information
dstansby authored Dec 10, 2024
1 parent dffcd3b commit 4a6851e
Show file tree
Hide file tree
Showing 15 changed files with 353 additions and 3 deletions.
8 changes: 6 additions & 2 deletions docs/api/v04/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ These are models that live further down the hierarchy.

::: ome_zarr_models.v04.multiscales

## plate
## hcs

::: ome_zarr_models.v04.plate
::: ome_zarr_models.v04.hcs

## image_label

Expand All @@ -26,6 +26,10 @@ These are models that live further down the hierarchy.

::: ome_zarr_models.v04.omero

## plate

::: ome_zarr_models.v04.plate

## well

::: ome_zarr_models.v04.well
13 changes: 12 additions & 1 deletion src/ome_zarr_models/v04/hcs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
from pydantic_zarr.v2 import ArraySpec, GroupSpec

from ome_zarr_models.base import Base
from ome_zarr_models.v04.plate import Plate

__all__ = ["HCSAttrs"]

class HCS(GroupSpec[Plate, ArraySpec | GroupSpec]):

class HCSAttrs(Base):
"""
HCS metadtata attributes.
"""

plate: Plate


class HCS(GroupSpec[HCSAttrs, ArraySpec | GroupSpec]):
"""
An OME-zarr high-content screening (HCS) dataset representing a single plate.
"""
28 changes: 28 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"plate": {
"acquisitions": [
{
"id": 0,
"name": "20200812-CardiomyocyteDifferentiation14-Cycle1"
}
],
"columns": [
{
"name": "03"
}
],
"rows": [
{
"name": "B"
}
],
"version": "0.4",
"wells": [
{
"columnIndex": 0,
"path": "B/03",
"rowIndex": 0
}
]
}
}
3 changes: 3 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
3 changes: 3 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
10 changes: 10 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"well": {
"images": [
{
"path": "0"
}
],
"version": "0.4"
}
}
3 changes: 3 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
118 changes: 118 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"multiscales": [
{
"axes": [
{
"name": "c",
"type": "channel"
},
{
"name": "z",
"type": "space",
"unit": "micrometer"
},
{
"name": "y",
"type": "space",
"unit": "micrometer"
},
{
"name": "x",
"type": "space",
"unit": "micrometer"
}
],
"datasets": [
{
"coordinateTransformations": [
{
"scale": [
1,
1.0,
0.1625,
0.1625
],
"type": "scale"
}
],
"path": "0"
},
{
"coordinateTransformations": [
{
"scale": [
1,
1.0,
0.325,
0.325
],
"type": "scale"
}
],
"path": "1"
},
{
"coordinateTransformations": [
{
"scale": [
1,
1.0,
0.65,
0.65
],
"type": "scale"
}
],
"path": "2"
},
{
"coordinateTransformations": [
{
"scale": [
1,
1.0,
1.3,
1.3
],
"type": "scale"
}
],
"path": "3"
},
{
"coordinateTransformations": [
{
"scale": [
1,
1.0,
2.6,
2.6
],
"type": "scale"
}
],
"path": "4"
}
],
"version": "0.4"
}
],
"omero": {
"channels": [
{
"color": "00FFFF",
"label": "DAPI",
"wavelength_id": "A01_C01",
"window": {
"end": 800,
"max": 65535,
"min": 0,
"start": 110
}
}
],
"id": 1,
"name": "TBD",
"version": "0.4"
}
}
3 changes: 3 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
27 changes: 27 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/0/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chunks": [
1,
1,
2160,
2560
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dimension_separator": "/",
"dtype": "<u2",
"fill_value": 0,
"filters": null,
"order": "C",
"shape": [
1,
2,
2160,
5120
],
"zarr_format": 2
}
27 changes: 27 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/1/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chunks": [
1,
1,
1080,
2560
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dimension_separator": "/",
"dtype": "<u2",
"fill_value": 0,
"filters": null,
"order": "C",
"shape": [
1,
2,
1080,
2560
],
"zarr_format": 2
}
27 changes: 27 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/2/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chunks": [
1,
1,
540,
1280
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dimension_separator": "/",
"dtype": "<u2",
"fill_value": 0,
"filters": null,
"order": "C",
"shape": [
1,
2,
540,
1280
],
"zarr_format": 2
}
27 changes: 27 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/3/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chunks": [
1,
1,
270,
640
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dimension_separator": "/",
"dtype": "<u2",
"fill_value": 0,
"filters": null,
"order": "C",
"shape": [
1,
2,
270,
640
],
"zarr_format": 2
}
27 changes: 27 additions & 0 deletions tests/v04/data/hcs_example.ome.zarr/B/03/0/4/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chunks": [
1,
1,
135,
320
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dimension_separator": "/",
"dtype": "<u2",
"fill_value": 0,
"filters": null,
"order": "C",
"shape": [
1,
2,
135,
320
],
"zarr_format": 2
}
Loading

0 comments on commit 4a6851e

Please sign in to comment.