-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix plate detection to ignore empty plates #118
Conversation
HCS metadata will now only be written by default if there is at least one Plate, which contains at least one Well, which has at least one WellSample that links to an existing Image ID. This means that empty plates will be ignored for the purposes of writing Zarr, but will be preserved in METADATA.ome.xml.
After discussion earlier today, a small OME-XML file that gets committed might be the easiest way to test this. @muhanadz would you be willing to put together a test file? Two examples for reference: https://downloads.openmicroscopy.org/images/OME-XML/2016-06/single-image.ome.xml It basically needs to have one Once a file is ready to go, we can add a corresponding test here. |
Without PR the following section of the XML gets processed and outputs a Zarr file with an HCS layout where one of the directories is named
With PR the following warning message is displayed and the resulting Zarr is a non-HCS layout (like
Adding more than one empty plate doesn't change the documented behaviour, but only displays test_withoutPR_no-hcs.zarr.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From previous review, fixed test.ome.xml file to pass bftools' xmlvalid
as it wasn't before
bftools_v6.5.1-397/xmlvalid ./test_bioformats2raw_pr118.ome.xml
Parsing schema path
http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd
Validating ./test_bioformats2raw_pr118.ome.xml
No validation errors found.
The behaviour with and without the PR remains the same as previously documented with this test.ome.xml file.
test_bioformats2raw_pr118.ome.xml.zip
test_withoutPR.zarr.zip
test_withPR.zarr.zip
That's perfect, thanks @muhanadz. 52d1de0 commits the file and adds the corresponding unit test. /cc @chris-allan I of course completely forgot that we had already added some small OME-XML tests in #91, so adding another one was easier than expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle build
on this PR builds fine with no problems.
BUILD SUCCESSFUL in 1m 55s
11 actionable tasks: 11 executed
HCS metadata will now only be written by default if there is at least one Plate, which contains at least one Well, which has at least one WellSample that links to an existing Image ID. This means that empty plates will be ignored for the purposes of writing Zarr, but will be preserved in METADATA.ome.xml.
For datasets that have only empty/invalid plates, the default
bioformats2raw
behavior with this PR should matchbioformats2raw --no-hcs
without this PR. No test (yet?) as creating an empty plate via fake files isn't possible.