Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZarrReader: Update handling of pre-existing plate metadata #49

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

dgault
Copy link
Member

@dgault dgault commented Mar 17, 2023

This PR is to fix the IDR import errors seen in IDR/idr-metadata#642 (comment) and other datasets.

Without this PR these datasets would fail due to duplicate keys in the WellSample ImageRefs such as below:

cvc-identity-constraint.4.2.2: Duplicate key value [Image:24] found for identity constraint "WellSampleImageRefIDKey" of element "OME".
cvc-identity-constraint.4.2.2: Duplicate key value [Image:39] found for identity constraint "WellSampleImageRefIDKey" of element "OME".
cvc-identity-constraint.4.2.2: Duplicate key value [Image:42] found for identity constraint "WellSampleImageRefIDKey" of element "OME".
cvc-identity-constraint.4.2.2: Duplicate key value [Image:45] found for identity constraint "WellSampleImageRefIDKey" of element "OME".
cvc-identity-constraint.4.2.2: Duplicate key value [Image:48] found for identity constraint "WellSampleImageRefIDKey" of element "OME".

This was due to the previous logic being to populate the metadata first from the existing METADATA.ome.xml file if present and then to override with the parsing of either the zarr attrs or the structure (depending on the format version). Due to the indexing differing between the original XML and the parsed structure this was resulting in some duplicate ID's (notably in wells with multiple fields).

The new logic is to simply remove the existing OME-XML metadata for plates and wells, only populating it from the new ngff format. With these PR there should be no validation failures for the idr0011 dataset.

@dominikl
Copy link
Member

👍 Tested with bftool's showinf incl the OMEZarrReader with this PR (FYI on pilot-idr-testing /ngff/bftools)

@dgault
Copy link
Member Author

dgault commented Mar 23, 2023

Retested idr0011 dataset today for a sanity check and went through the metadata for plates, wells and images. Everything appears to match up correctly with the metadata from the METADATA.OME.XML. Getting this PR merged and tagging the repo.

@dgault dgault merged commit 2e3dec4 into ome:main Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants