Skip to content

Skip wells - #174

Open
will-moore wants to merge 10 commits into
ome:masterfrom
will-moore:skip_wells
Open

Skip wells#174
will-moore wants to merge 10 commits into
ome:masterfrom
will-moore:skip_wells

Conversation

@will-moore

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

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

joshmoore commented Jun 18, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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

snoopycrimecop commented Oct 9, 2025

Copy link
Copy Markdown
Member

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.

@snoopycrimecop

snoopycrimecop commented Jan 24, 2026

Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-plugins-push#31. 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/raw_pixels.py
    • src/omero_zarr/masks.py
    • src/omero_zarr/util.py
    • src/omero_zarr/cli.py
    • test/integration/clitest/test_export.py

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

@snoopycrimecop

snoopycrimecop commented Feb 7, 2026

Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-plugins-push#48. 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/raw_pixels.py
    • test/integration/clitest/test_export.py
    • src/omero_zarr/masks.py

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

@snoopycrimecop

Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-plugins-push#65. 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/raw_pixels.py
    • src/omero_zarr/cli.py
    • test/integration/clitest/test_export.py
    • src/omero_zarr/masks.py
    • src/omero_zarr/util.py

--conflicts

@will-moore

Copy link
Copy Markdown
Member Author

I agree with #174 (comment) - Let's simply add support for e.g:

omero zarr export Plate:1 --skip well_labels.csv

# and/or

omero zarr export Plate:1 --skip A1,A2,A3,B1,B2,B3

I'm not sure whether we need to add support for:

./find_identifiers wells_map my_key:my* > well_labels.csv

since that doesn't feel like omero-cli-zarr functionality.

Also, the export of Well KVPs to csv (included in this PR) is also handled by https://github.com/ome/omero-scripts/blob/develop/omero/annotation_scripts/Export_to_csv.py. Once you have a whole plate of KVPs in a CSV, it's pretty trivial (for a developer) to remove rows based on KVP values etc, and to generate a well_labels.csv to use for omero zarr export.

cc @jburel

@snoopycrimecop

Copy link
Copy Markdown
Member

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

  • Upstream changes
    • src/omero_zarr/cli.py
    • src/omero_zarr/masks.py
    • test/integration/clitest/test_export.py
    • src/omero_zarr/util.py
    • src/omero_zarr/raw_pixels.py

--conflicts

@snoopycrimecop

Copy link
Copy Markdown
Member

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

  • Upstream changes
    • src/omero_zarr/masks.py
    • src/omero_zarr/util.py
    • test/integration/clitest/test_export.py
    • src/omero_zarr/cli.py
    • src/omero_zarr/raw_pixels.py

--conflicts

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