Skip to content

Conversation

@will-moore
Copy link
Member

@will-moore will-moore commented Jun 4, 2025

This adds support for excluding Wells from Plate export, based on Key-Value pairs.

E.g. if we have "my_key": "my_value" on a Well, we can exclude that with an exact match or with wildcards:

$ omero zarr export Plate:1 --skip_wells_map my_key:my_value

$ omero zarr export Plate:1 --skip_wells_map my_key:my*
$ omero zarr export Plate:1 --skip_wells_map my_key:*value
$ omero zarr export Plate:1 --skip_wells_map my_key:*val*
$ omero zarr export Plate:1 --skip_wells_map my_key:*

# important to use same value if/when you export masks or polygons for the same Plate:

$ omero zarr masks Plate:1 --skip_wells_map my_key:my*

This PR also adds a --metadata_only option, which skips all the pixel data (no chunks) but still includes
array metadata .zarray etc. This allows a fast export of a Plate, e.g. to quickly test the --skip_wells_map above.

$ omero zarr export Plate:1 --metadata_only

cc @jrswedlow

@will-moore will-moore marked this pull request as draft June 5, 2025 08:58
@will-moore
Copy link
Member Author

@jrswedlow You can install from this branch with

$ pip install git+https://github.com/ome/omero-cli-zarr.git@refs/pull/174/head

Probably best to $pip uninstall omero-cli-zarr first if you already have it installed.

@will-moore
Copy link
Member Author

Testing against merge-ci looking good:

 $ omero zarr export Plate:19602 --name_by name --skip_wells_map "Even Columns:*"
 $ omero zarr polygons Plate:19602 --overlaps=dtype_max --name_by name --skip_wells_map "Even Columns:*"
 $ ome_zarr view 10WellPlate.ome.zarr/

Delete $ rm -rf 10WellPlate.ome.zarr/ each time and re-export with other options:

 $ omero zarr export Plate:19602 --name_by name --skip_wells_map "label:*2"
 $ omero zarr export Plate:19602 --name_by name --skip_wells_map "label:B*"

@will-moore
Copy link
Member Author

@jrswedlow I've added support for $ omero zarr export_csv Plate:51 --skip_wells_map drug:ex*

I don't know if you've been using the --name_by name option with these exports (supported by export and masks and export_csv commands), but that will give you a plateName.ome.zarr output instead of PLATE_ID.ome.zarr which can be useful.

@jrswedlow
Copy link
Member

@jrswedlow I've added support for $ omero zarr export_csv Plate:51 --skip_wells_map drug:ex*

I don't know if you've been using the --name_by name option with these exports (supported by export and masks and export_csv commands), but that will give you a plateName.ome.zarr output instead of PLATE_ID.ome.zarr which can be useful.

Have tested --skip_wells_map on Plates from Glencoe OMERO Plus and all seems to work. Great work! I have not tested --name_by

@joshmoore
Copy link
Member

joshmoore commented Jun 18, 2025

A quick thought: though for this workflow having the explicit method is more straight-forward, I think there could be sufficiently many workflows that we wouldn't want individual command-line arguments. An alternative would be to have one command that generates a list of Wells (or any object) and then to take that list of identifiers as a skip list:

./find_identifiers wells_map my_key:my* > my_identifiers.txt
omero zarr export Plate:1 --skip my_identifiers.txt

@will-moore
Copy link
Member Author

Thanks @joshmoore - that makes sense.

I'm not even sure at this point that we want to release any of this --skip functionality or if this is just a one-off fork for a particular IDR submission (hence the Draft status). TBD...

@will-moore will-moore closed this Oct 4, 2025
@will-moore will-moore reopened this Oct 8, 2025
@will-moore will-moore marked this pull request as ready for review October 9, 2025 07:16
@snoopycrimecop
Copy link
Member

snoopycrimecop commented Oct 9, 2025

Conflicting PR. Removed from build OMERO-plugins-push#552. See the console output for more details.
Possible conflicts:

  • PR Use zarr v3 and updated ome-zarr-py #172 will-moore 'Use zarr v3 and updated ome-zarr-py'
    • src/omero_zarr/cli.py
    • src/omero_zarr/util.py
    • src/omero_zarr/masks.py
    • src/omero_zarr/raw_pixels.py
    • test/integration/clitest/test_export.py

--conflicts Conflict resolved in build OMERO-plugins-push#576. See the console output for more details.

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.

4 participants