Skip to content

CLI Metadata Plugin#4037

Merged
joshmoore merged 42 commits intoome:metadatafrom
manics:cli-metadata
Oct 2, 2015
Merged

CLI Metadata Plugin#4037
joshmoore merged 42 commits intoome:metadatafrom
manics:cli-metadata

Conversation

@manics
Copy link
Copy Markdown
Member

@manics manics commented Aug 11, 2015

Replacement for @joshmoore #3936

For inspecting the availability of "metadata" (items shown in the right-hand panel of the GUIs) from the CLI, a bin/omero metadata plugin is being added along with tests to show how to add and query such data. The plugin also wraps populate_metadata.py and populate_roi.py mostly to simplify login.

Also:

Testing:

  • omero metadata --help
  • omero metadata populate --file input.csv Screen:123
  • omero metadata populate --file input.csv Plate:123
  • omero metadata populate --context bulkmap (uses bulk-annotation OMERO.table)
  • omero metadata populate --context bulkmap --file fileid
  • omero metadata populateroi Plate:123
  • omero metadata {summary,original,measures,bulkanns,mapanns,allannas,rois} ...
  • omero metadata rois Object:Id
  • and for some sub-commands try the --report flag for additional output

@pwalczysko The fix for populate_roi should be in here thanks to @joshmoore

joshmoore and others added 30 commits August 3, 2015 11:16
For a server who's policy restricts the download of plates,
populate_roi.py can no longer get access to the results file.
For the moment, we're detecting files based on their file
ending and permitting the download.
This is an initial example to show how a bulk-annotation table can be converted into MapAnnotations
This is for internal testing only, and will be changed when this is moved to the metadata CLI plugin.
BlitzGateway didn't work with self.client
Initial attempt at integrating the populate_metadata.py script into the OMERO CLI
Also fix ignored name parameter in make_file_annotation
This is consistent with the fs plugin
@ximenesuk
Copy link
Copy Markdown
Contributor

I have tried the workflow at https://www.openmicroscopy.org/private/ome-internal/testing_scenarios/BulkAnnotations.html but using the cli without much luck.

ls30778:openmicroscopy colin$ omero metadata populate --file ~/Desktop/Bulk\ annotations/test_screen.csv Screen:1
Using session 54a20a55-d317-4db6-89ef-dc012c19b8d1 (user-0@localhost:4064). Idle timeout: 10 min. Current group: pg-0
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:Screen is missing plate: 365700055641
WARNING:omero.util.populate_metadata:PlateColumn is unimplemented
INFO:omero.util.populate_metadata:Created new table OriginalFile:767
INFO:omero.util.populate_metadata:Table initialized with 11 columns.
INFO:omero.util.populate_metadata:Added data column data.
ls30778:openmicroscopy colin$ omero metadata summary Screen:1
Using session 54a20a55-d317-4db6-89ef-dc012c19b8d1 (user-0@localhost:4064). Idle timeout: 10 min. Current group: pg-0
Screen:1
--------
Name: Screen1
Bulk annotations: 1
FileAnnotations: 1

There is an annotation on the Screen but not on individual wells. And with,

ls30778:openmicroscopy colin$ omero metadata populate --file ~/Desktop/Bulk\ annotations/test_plate.csv Plate:3
Using session 54a20a55-d317-4db6-89ef-dc012c19b8d1 (user-0@localhost:4064). Idle timeout: 10 min. Current group: pg-0
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
INFO:omero.util.populate_metadata:Missing image name column, skipping.
INFO:omero.util.populate_metadata:Missing plate name column, skipping.
Traceback (most recent call last):
  File "/Users/colin/Work/repos/openmicroscopy/dist/bin/omero", line 125, in <module>
    rv = omero.cli.argv()
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/cli.py", line 1437, in argv
    cli.invoke(args[1:])
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/cli.py", line 951, in invoke
    stop = self.onecmd(line, previous_args)
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/cli.py", line 1028, in onecmd
    self.execute(line, previous_args)
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/cli.py", line 1110, in execute
    args.func(args)
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/plugins/metadata.py", line 324, in populate
    ctx.write_to_omero()
  File "/Users/colin/Work/repos/openmicroscopy/dist/lib/python/omero/util/populate_metadata.py", line 572, in write_to_omero
    "Unable to create table: %s" % name)
omero.util.populate_metadata.MetadataError: Unable to create table: bulk_annotations

Is there anything else I need on my local branch? And @pwalczysko is that scenario and are the files used valid?

@pwalczysko
Copy link
Copy Markdown
Member

@ximenesuk : The scenario was last tested during the Paris meeting this year. It worked up to the points which are documented in the tickets. One of the points in the tickets is that when you run the script against a Screen (as you did above in step 1) then the annotation on single wells is missing. When run against a plate this shoiuld work as of June this year. The scenario was not updated with respect to this PR (scenario is unaware of this PR). I do not think you should be missing anything on your branch. If your setup is wrong, in my experience you would not get accross to the output like

NFO:omero.util.populate_metadata:Missing image name column, skipping.

@pwalczysko
Copy link
Copy Markdown
Member

@ximenesuk : The "populate_roi.py does not work" ticket is https://trac.openmicroscopy.org/ome/ticket/12235

@ximenesuk
Copy link
Copy Markdown
Contributor

@pwalczysko Note from the description that this PR fixes populate_roi though I have not yet tested that.

@manics do you have any sources of test data that should test the cli? And any guidance on --context ?

@pwalczysko
Copy link
Copy Markdown
Member

@ximenesuk : This is the other ticket considering the populate_metadata.py - the two tickets pasted by me here fully describe all my knowledge about the status of this problematics (as indicated, my last test on this was done this year on the users' meeting in Paris) https://trac.openmicroscopy.org/ome/ticket/12211#comment:12

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 18, 2015

--context is an exploratory option for some of the IDR work, so it may be removed/changed before this ends up in develop (sorry for not describing it, I thought josh was around this week and would be reviewing it).

Essentially,
OMERO-TEST/bin/omero metadata populate --context bulkmap Object:Id should convert a bulk-annotations table (previously added using populate) into a MapAnnotation on each image or well (depending on what was referenced in the BulkAnnotations table). The MapAnnotations are in the bulk-annotations namespace. See the Trello card if you're interested in the rationale behind this.

The corresponding UI work has not been done- i.e. the table annotation is not removed, and annotations on wells aren't displayed, only those on images. #4038 is a temporary hack to force the display of Image and Well annotations.

OMERO-TEST/bin/omero metadata populate --context deletemap Object:Id should remove all MapAnnotations created as a result of the bulkmap context.

I'd expect the behaviour of populate_metadata to be unchanged in terms of what does/doesn't work. populate_roi should be fixed, at least for the test scenario.

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 18, 2015

omero metadata populate --report Plate:XX --file bulk_annotations/test_plate.csv works for me, do you have any server error logs?

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 18, 2015

And sources of data...just what's in the scenario. Assuming populate_rois works Well/Image A1 should have 173 ROIs, and you can use it to test most of the sub-commands e.g. bulkanns/measures sub-commands with {--parents,--report} options:
omero metadata bulkanns Image:ID --parents --report

@ximenesuk
Copy link
Copy Markdown
Contributor

Okay, so after a restart of the server the bulk annotation of a Plate worked. However, the webclient on my local server is taking 15 seconds to respond to every request so I think the earlier problem is likely a local issue unless there is anything else in the metadat branch that might complicate things. I'll continue later after a laptop restart.

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 18, 2015

You're welcome to test against dogfish (which is where the openmicroscopy:metadata merge-branch is deployed)

@ximenesuk
Copy link
Copy Markdown
Contributor

I think I have gone as far as I can with this one without spending a bit more time catching up on the IDR side of things. I've tested the basic listing and populating using --file but not any of the --context stuff. No problems other than the flakiness of my server. It may be that @joshmoore can review the areas I haven't more easily?

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 19, 2015

I've got another PR building on top of this, further extending the plugin, and it's staying on the metadata branch for now. I think the important thing as far as testing is concerned is it doesn't break the existing populate_* functionality (or anything else).

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 25, 2015

@joshmoore Over to you for further comments (note I'm already building on this in #4071 so if you prefer I could close this one and have the whole plugin reviewed at once)

@joshmoore
Copy link
Copy Markdown
Member

Various issues while testing: (I'll update this comment)

  • o metadata original Screen:2 fails
  • o metadata summary Screen:1 fails if it doesn't exist
  • REF: o metadata populate --attach to attach the CSV for download

@manics
Copy link
Copy Markdown
Member Author

manics commented Sep 16, 2015

First two points in above comment fixed in #4062 08faf6f

@manics
Copy link
Copy Markdown
Member Author

manics commented Sep 16, 2015

What do you prefer, close this PR and review #4062 as one big PR when it's done? Or merge this (without fixes) since it doesn't break anything?

FYI Your fs changes are in commit manics@8347d8a which only changes plugins/fs.py.

@manics
Copy link
Copy Markdown
Member Author

manics commented Sep 16, 2015

Regarding the RFE metadata populate --attach, if you can attach the CSV this implies you should also be able to create the bulk-annotations from a previously uploaded OriginalFile, which is fine.

However, with the increasing number of changes to existing methods in populate_metadata.py should __main__ be removed so omero metadata populate becomes the only way to run it?

@manics
Copy link
Copy Markdown
Member Author

manics commented Sep 18, 2015

@pwalczysko Regarding this PR, would you have any objections to me removing populate_{metadata,roi}.py in a future PR and only supporting omero metadata populate ... in 5.2, obviously with updated docs?

@pwalczysko
Copy link
Copy Markdown
Member

@manics : assuming that omero metadata populate... does at least the same scope or even more as did populate_(metadata, roi).py, I think this is fine. The only question would be whether we know about places which are totally dependent on the old scripts functioning ? @joshmoore @sbesson

@joshmoore
Copy link
Copy Markdown
Member

@pwalczysko : I assume will finish that conversation when this comes back to develop, perhaps for 5.2?

Merging for SiB.

cc: @jburel @ximenesuk

joshmoore added a commit that referenced this pull request Oct 2, 2015
@joshmoore joshmoore merged commit f645cdb into ome:metadata Oct 2, 2015
@manics manics deleted the cli-metadata branch November 25, 2015 17:38
@sbesson sbesson removed the ON_HOLD label Feb 3, 2016
@manics manics mentioned this pull request Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants