Skip to content

Commit

Permalink
Merge pull request #23 from chanzuckerberg/uermel/linkml
Browse files Browse the repository at this point in the history
Add LinkML schema for metadata files and the ability to generate docs and pydantic classes from the schema.
  • Loading branch information
uermel authored Mar 9, 2024
2 parents ca61dae + f891adf commit 757fd3f
Show file tree
Hide file tree
Showing 138 changed files with 18,414 additions and 0 deletions.
14 changes: 14 additions & 0 deletions schema/v1.1.0/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DEFAULT_GOAL := build

.PHONY: clean
clean:
rm -rf metadata-docs
rm -rf metadata_materialized.yaml
rm -rf metadata_models.py

.PHONY: build
build:
python schema.py materialize metadata.yaml common.yaml metadata_materialized.yaml
gen-doc -d metadata-docs --no-mergeimports --hierarchical-class-view --stacktrace metadata_materialized.yaml
gen-pydantic --pydantic-version 2 metadata_materialized.yaml > metadata_models.py
black -l 88 metadata_models.py
50 changes: 50 additions & 0 deletions schema/v1.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# cryoET data portal metadata schema

This directory contains the metadata schema for the cryoET data portal. Browse contained classes [here](metadata-docs/index.md).

Metadata file and directory layout specs:

<pre>
[dataset_identifier]/
|-- <a href="metadata-docs/Dataset.md">dataset_metadata.json</a>
|-- [run_name]/
| |-- run_metadata.json
| |-- Frames/
| | |-- [tiff|eer|mrc]
| | |-- Gain_reference.mrc|dm4
| | |-- frame_acquisition_order.json
| |-- TiltSeries/
| | |-- <a href="metadata-docs/TiltSeries.md">tiltseries_metadata.json</a>
| | |-- [run_name].mrc
| | |-- [run_name].zarr/
| | | |-- [subdirectories according to <a href="https://ngff.openmicroscopy.org/latest/">OME-NGFF spec</a> at 100%, 50% and 25% scale]
| | |-- [run_name].mdoc [optional, sometimes]
| | |-- [run_name].rawtlt [optional, sometimes]
| | |-- [run_name].tlt [optional, sometimes]
| |-- Tomograms/
| | |-- VoxelSpacing[xx.yyy]
| | | |-- CanonicalTomogram
| | | | |-- <a href="metadata-docs/Tomogram.md">tomogram_metadata.json</a>
| | | | |-- neuroglancer_config.json
| | | | |-- [run_name].mrc
| | | | |-- [run_name].xf [optional, sometimes]
| | | | |-- [run_name].zarr/
| | | | | |-- [subdirectories according to <a href="https://ngff.openmicroscopy.org/latest/">OME-NGFF spec</a> at 100%, 50% and 25% scale]
| | | |-- Annotations/
| | | | |-- XXX_[object_name]_[version]_point.ndjson
| | | | |-- <a href="metadata-docs/Annotation.md">XXX_[object_name]_[version].json</a>
| | | | |-- YYY_[object_name]_[version]_segmentationmask.mrc
| | | | |-- YYY_[object_name]_[version]_segmentationmask.zarr
| | | | | |-- [subdirectories according to <a href="https://ngff.openmicroscopy.org/latest/">OME-NGFF spec</a> at 100%, 50% and 25% scale]
| | | | |-- <a href="metadata-docs/Annotation.md">YYY_[object_name]_[version].json</a>

</pre>

## Building the schema and docs

To build the schema, markdown docs and pydantic classes:

```bash
cd schema/v1.1.0
make build
```
Loading

0 comments on commit 757fd3f

Please sign in to comment.