Skip to content

Commit

Permalink
Use a compound key for annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadling committed Oct 17, 2024
1 parent ed45029 commit 96e6268
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 149 deletions.
9 changes: 8 additions & 1 deletion ingestion_tools/scripts/importers/db/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
262 changes: 130 additions & 132 deletions test_infra/test_files/tomogram_metadata.json
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 96e6268

Please sign in to comment.