From 96e6268aa7c26df9884ef3d4ab8ffd9db6a8e19a Mon Sep 17 00:00:00 2001 From: Jessica Gadling Date: Thu, 17 Oct 2024 14:06:30 -0400 Subject: [PATCH] Use a compound key for annotations. --- .../scripts/importers/db/annotation.py | 9 +- .../Tomograms/100/tomogram_metadata.json | 6 +- .../TiltSeries/100/tiltseries_metadata.json | 6 +- .../Tomograms/100/tomogram_metadata.json | 6 +- .../TiltSeries/100/tiltseries_metadata.json | 6 +- test_infra/test_files/tomogram_metadata.json | 262 +++++++++--------- 6 files changed, 146 insertions(+), 149 deletions(-) diff --git a/ingestion_tools/scripts/importers/db/annotation.py b/ingestion_tools/scripts/importers/db/annotation.py index 32e7242f3..095cf1cf3 100644 --- a/ingestion_tools/scripts/importers/db/annotation.py +++ b/ingestion_tools/scripts/importers/db/annotation.py @@ -67,7 +67,14 @@ def import_to_db(self) -> BaseModel: @classmethod def get_id_fields(cls) -> list[str]: - return ["s3_metadata_path"] + return [ + "tomogram_voxel_spacing_id", + "deposition_id", + "annotation_method", + "object_name", + "object_description", + "object_state", + ] @classmethod def get_db_model_class(cls) -> type[BaseModel]: diff --git a/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/tomogram_metadata.json b/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/tomogram_metadata.json index eac29677e..c20f17bc8 100644 --- a/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/tomogram_metadata.json +++ b/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/tomogram_metadata.json @@ -81,10 +81,8 @@ "y": 1016, "x": 980 }, - "omezarr_dir": "RUN1.zarr", - "mrc_files": [ - "RUN1.mrc" - ], + "omezarr_dir": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/RUN1.zarr", + "mrc_file": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Tomograms/100/RUN1.mrc", "run_name": "RUN1", "key_photo": { "snapshot": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Images/key-photo-snapshot.png", diff --git a/test_infra/test_files/30001/RUN1/TiltSeries/100/tiltseries_metadata.json b/test_infra/test_files/30001/RUN1/TiltSeries/100/tiltseries_metadata.json index bf783d81e..e853dca3d 100644 --- a/test_infra/test_files/30001/RUN1/TiltSeries/100/tiltseries_metadata.json +++ b/test_infra/test_files/30001/RUN1/TiltSeries/100/tiltseries_metadata.json @@ -52,10 +52,8 @@ "pixel_spacing": 4.370, "is_aligned": true, "aligned_tiltseries_binning": 3, - "omezarr_dir": "ts_foo.zarr", - "mrc_files": [ - "ts_foo.mrc" - ], + "omezarr_dir": "30001/RUN1/TiltSeries/100/ts_foo.zarr", + "mrc_file": "30001/RUN1/TiltSeries/100/ts_foo.mrc", "run_name": "RUN1", "frames_count": 60, "deposition_id": 300, diff --git a/test_infra/test_files/30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/tomogram_metadata.json b/test_infra/test_files/30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/tomogram_metadata.json index b2bbce9d1..f170640a8 100644 --- a/test_infra/test_files/30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/tomogram_metadata.json +++ b/test_infra/test_files/30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/tomogram_metadata.json @@ -61,10 +61,8 @@ "y": 800, "x": 800 }, - "omezarr_dir": "RUN2.zarr", - "mrc_files": [ - "RUN2.mrc" - ], + "omezarr_dir": "30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/RUN2.zarr", + "mrc_file": "30001/RUN2/Reconstructions/VoxelSpacing3.456/Tomograms/100/RUN2.mrc", "run_name": "RUN2", "deposition_id": 300, "dates": { diff --git a/test_infra/test_files/30001/RUN3/TiltSeries/100/tiltseries_metadata.json b/test_infra/test_files/30001/RUN3/TiltSeries/100/tiltseries_metadata.json index fc7b8087b..aebd706f4 100644 --- a/test_infra/test_files/30001/RUN3/TiltSeries/100/tiltseries_metadata.json +++ b/test_infra/test_files/30001/RUN3/TiltSeries/100/tiltseries_metadata.json @@ -23,10 +23,8 @@ "data_acquisition_software": "leginon", "tilt_series_quality": 2, "pixel_spacing": 5.240, - "omezarr_dir": "ts_foo.zarr", - "mrc_files": [ - "ts_foo.mrc" - ], + "omezarr_dir": "30001/RUN3/TiltSeries/100/ts_foo.zarr", + "mrc_file": "30001/RUN3/TiltSeries/100/ts_foo.mrc", "run_name": "RUN3", "deposition_id": 300, "last_updated_at": 1728675676 diff --git a/test_infra/test_files/tomogram_metadata.json b/test_infra/test_files/tomogram_metadata.json index c885a8601..64a922a11 100644 --- a/test_infra/test_files/tomogram_metadata.json +++ b/test_infra/test_files/tomogram_metadata.json @@ -1,140 +1,138 @@ { - "affine_transformation_matrix": [ - [ - 1, - 0, - 0, - 0 - ], - [ - 0, - 1, - 0, - 0 - ], - [ - 0, - 0, - 1, - 0 - ], - [ - 0, - 0, - 0, - 1 - ] + "affine_transformation_matrix": [ + [ + 1, + 0, + 0, + 0 ], - "authors": [ - { - "ORCID": "0000-0002-4691-9501", - "name": "Irene de Teresa Trueba", - "primary_author_status": true - }, - { - "ORCID": "0000-0002-9903-3667", - "name": "Sara Goetz" - }, - { - "ORCID": "0000-0003-0901-8701", - "name": "Alexander Mattausch" - }, - { - "ORCID": "0000-0002-4327-1068", - "name": "Frosina Stojanovska" - }, - { - "ORCID": "0000-0003-4388-1349", - "name": "Christian Eugen Zimmerli" - }, - { - "ORCID": "0000-0001-5333-3640", - "name": "Mauricio Toro-Nahuelpan" - }, - { - "name": "Dorothy W. C. Cheng" - }, - { - "name": "Fergus Tollervey" - }, - { - "ORCID": "0000-0001-6562-7187", - "name": "Constantin Pape" - }, - { - "ORCID": "0000-0002-7397-1321", - "name": "Martin Beck" - }, - { - "ORCID": "0000-0001-6864-8901", - "name": "Alba Diz-Munoz" - }, - { - "ORCID": "0000-0003-1334-6388", - "name": "Anna Kreshuk" - }, - { - "ORCID": "0000-0001-6968-041X", - "corresponding_author_status": true, - "name": "Julia Mahamid" - }, - { - "ORCID": "0000-0001-8324-4040", - "corresponding_author_status": true, - "name": "Judith B. Zaugg" - } + [ + 0, + 1, + 0, + 0 ], - "ctf_corrected": false, - "dates": { - "deposition_date": "2023-04-01", - "last_modified_date": "2023-06-01", - "release_date": "2023-06-01" + [ + 0, + 0, + 1, + 0 + ], + [ + 0, + 0, + 0, + 1 + ] + ], + "authors": [ + { + "ORCID": "0000-0002-4691-9501", + "name": "Irene de Teresa Trueba", + "primary_author_status": true }, - "fiducial_alignment_status": "NON_FIDUCIAL", - "is_visualization_default": true, - "offset": { - "x": 0, - "y": 0, - "z": 0 + { + "ORCID": "0000-0002-9903-3667", + "name": "Sara Goetz" }, - "processing": "raw", - "reconstruction_method": "WBP", - "reconstruction_software": "IMOD", - "tomogram_version": 1, - "voxel_spacing": 13.48, - "scales": [ - { - "z": 500, - "y": 928, - "x": 960 - }, - { - "z": 250, - "y": 464, - "x": 480 - }, - { - "z": 125, - "y": 232, - "x": 240 - } - ], - "size": { - "z": 500, - "y": 928, - "x": 960 + { + "ORCID": "0000-0003-0901-8701", + "name": "Alexander Mattausch" }, - "omezarr_dir": "TS_045.zarr", - "mrc_files": [ - "TS_045.mrc" - ], - "run_name": "TS_045", - "key_photo": { - "snapshot": "10000/TS_045/Reconstructions/VoxelSpacing13.480/Images/100-key-photo-snapshot.png", - "thumbnail": "10000/TS_045/Reconstructions/VoxelSpacing13.480/Images/100-key-photo-thumbnail.png" + { + "ORCID": "0000-0002-4327-1068", + "name": "Frosina Stojanovska" + }, + { + "ORCID": "0000-0003-4388-1349", + "name": "Christian Eugen Zimmerli" + }, + { + "ORCID": "0000-0001-5333-3640", + "name": "Mauricio Toro-Nahuelpan" + }, + { + "name": "Dorothy W. C. Cheng" + }, + { + "name": "Fergus Tollervey" + }, + { + "ORCID": "0000-0001-6562-7187", + "name": "Constantin Pape" + }, + { + "ORCID": "0000-0002-7397-1321", + "name": "Martin Beck" + }, + { + "ORCID": "0000-0001-6864-8901", + "name": "Alba Diz-Munoz" + }, + { + "ORCID": "0000-0003-1334-6388", + "name": "Anna Kreshuk" + }, + { + "ORCID": "0000-0001-6968-041X", + "corresponding_author_status": true, + "name": "Julia Mahamid" + }, + { + "ORCID": "0000-0001-8324-4040", + "corresponding_author_status": true, + "name": "Judith B. Zaugg" + } + ], + "ctf_corrected": false, + "dates": { + "deposition_date": "2023-04-01", + "last_modified_date": "2023-06-01", + "release_date": "2023-06-01" + }, + "fiducial_alignment_status": "NON_FIDUCIAL", + "is_visualization_default": true, + "offset": { + "x": 0, + "y": 0, + "z": 0 + }, + "processing": "raw", + "reconstruction_method": "WBP", + "reconstruction_software": "IMOD", + "tomogram_version": 1, + "voxel_spacing": 13.48, + "scales": [ + { + "z": 500, + "y": 928, + "x": 960 + }, + { + "z": 250, + "y": 464, + "x": 480 }, - "alignment_metadata_path": "cryoetportal-output-test/10000/TS_045/Alignments/100/alignment_metadata.json", - "neuroglancer_config_path": "cryoetportal-output-test/10000/TS_045/Reconstructions/VoxelSpacing13.480/NeuroglancerPrecompute/100-neuroglancer_config.json", - "deposition_id": 10000, - "last_updated_at": 1728676818 + { + "z": 125, + "y": 232, + "x": 240 + } + ], + "size": { + "z": 500, + "y": 928, + "x": 960 + }, + "omezarr_dir": "10000/TS_045/Reconstructions/VoxelSpacing13.480/100/TS_045.zarr", + "mrc_file": "10000/TS_045/Reconstructions/VoxelSpacing13.480/100/TS_045.mrc", + "run_name": "TS_045", + "key_photo": { + "snapshot": "10000/TS_045/Reconstructions/VoxelSpacing13.480/Images/100-key-photo-snapshot.png", + "thumbnail": "10000/TS_045/Reconstructions/VoxelSpacing13.480/Images/100-key-photo-thumbnail.png" + }, + "alignment_metadata_path": "cryoetportal-output-test/10000/TS_045/Alignments/100/alignment_metadata.json", + "neuroglancer_config_path": "cryoetportal-output-test/10000/TS_045/Reconstructions/VoxelSpacing13.480/NeuroglancerPrecompute/100-neuroglancer_config.json", + "deposition_id": 10000, + "last_updated_at": 1728676818 }