[ome-devel] Plan for transferring data from one OMERO to another

William Moore (Staff) W.Moore at dundee.ac.uk
Tue Oct 17 11:18:18 BST 2017


Hi,

 This could be quite a bit of work, so you will need to start small and build-up functionality as you go. Some investigation will be required - Some things will depend on the type of images you’ll be transferring. You’ll also need to have both OMERO servers using the same major version. E.g. 5.3.x.

You’ll really need to re-import the images to the central server instead of manually creating new DB entries for all image metadata etc. This can be acheived from the command line, with your OMERO.script invoking “bin/omero import …” to the central server.

Are these images imported in OMERO 5.0 or later (original files will be in managed repo)?
Your script, running on the source OMERO server *may* be able to access the managed repository directly, and call e.g. “bin/omero import /OMERO/ManagedRepository/will_3/2017-10/05/15-31-34.090/control.lsm”
This is certainly the easiest solution.

Alternatively, if the managed repo is not available then you can download the original images to the folder where the OMERO.script is running and import the images from there.
In the simplest case, a single OMERO Image has a single image file. However, some Images are stored as multiple original files in the managed repo, which means they will all need to be downloaded to the script before they can be imported if you go for that option.

In some cases, a single original file (or set of original files) will generate multiple OMERO Images when imported. So you may find that multiple images in your source server come from the same original file(s). In that case, you will have to be careful when you iterate through these images that you don’t import the same original file multiple times.

It’s not really possible for OMERO.scripts to be “interactive”. The easiest option for choosing a target is to have your users log in to the webclient (or Insight) in the central server and pick a Project or Dataset ID to enter into the script dialog in the other server.

Traversing the graph of linked objects Dataset -> Image and handling of file Annotations / duplicate tags etc should be pretty straight-forward once you have the re-import of images working.

Please put your script in github and commit all changes as you go. This will allow us to see what you have working and to help or contribute much easier. One option if you don’t already have a repo is to fork https://github.com/ome/omero-user-scripts which allows us and the community to find your repo from there.

Be careful when handling usernames and passwords in your OMERO.script. Make sure you’re not logging these etc.

Initial goals:
 - Create an script that can take an Image ID as input, along with username & password of central server. Can use https://github.com/openmicroscopy/openmicroscopy/blob/develop/examples/Training/python/Scripting_Service_Example.py
 - List original files from source Image
for f in image.getImportedImageFiles():
    print f.path, f.name
- Create a BlitzGateway connection to central server
- You can get a “client” object using  client = conn.c
- Command line import using code similar to that in our python test framework (using ‘client’ from above as in the example) :https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/src/omero/testlib/__init__.py#L277


Let us know how this goes,

  Regards,

  Will.


On 12 Oct 2017, at 12:46, Eilidh Troup <e.troup at epcc.ed.ac.uk<mailto:e.troup at epcc.ed.ac.uk>> wrote:

Hi,

I’m a software engineer working on data management in biology. Our use case is that lab groups have their own instances of OMERO, and there is also a centrally-hosted university OMERO server which they would like to transfer data to. I’m planning to write a script to allow users to transfer data from one OMERO to another. I wanted to run the plans by this forum to see what you thought of the idea, and whether my planned implementation seems sensible.

I plan to write a script (OMERO.scripts) to run on the local instances of OMERO and be used through OMERO.server or OMERO.web. This will let the user choose the image, dataset or project that they want to move, and enter their credentials for the central OMERO server. Then the script will use the Blitz Gateway to read data from the local server, and then to write to the remote server.

issues:

- How will users choose where to put data? It will have to be either in a default project on the central server, or the script would have to be interactive, where the user enters their credentials, and then the central server is contacted so that a list of projects and datasets belonging to that user can be presented.

- There will be a graph of objects linked to any given one, for example, a dataset with images, tags and attachments. Need to traverse this to transfer all associated data.

- Some IDs will need to be mapped from one OMERO to the other, for example tags - shouldn’t create a new one, but link to existing tag with same name on the other OMERO.

I’m planning to write the code in Python and use OMERO.scripts and the Blitz Gateway. Please let me know what you think.
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20171017/e1a1f312/attachment.html>


More information about the ome-devel mailing list