Page 1 of 1

Finding original files

PostPosted: Fri Sep 28, 2018 6:59 pm
by DaveMellert
Hello everyone. Long time lurker, first time poster.

I need to find a group of original files (paths) in the Omero (5.1.2) ManagedRepository, based on a Project ID. My first thought was to use
Code: Select all
find <user> -name *.<filetype>
but that of course did not work because many different users handled the original imports.
Code: Select all
bin/omero hql -q "<query>"
seems like a sensible option, but I am really struggling with the data model. I imagine this must be an easy query for experienced users, and any advice would be much appreciated.

Thank you!

Re: Finding original files

PostPosted: Mon Oct 01, 2018 9:34 am
by mtbc
Dear Dave,

That one isn't an easy query for anybody. :) You are using a very old OMERO though, since 5.3.x there is a convenience request http://downloads.openmicroscopy.org/lat ... ndChildren which will find, say, files in projects without requiring the user to specify the details of that "in". One can script that as at https://github.com/openmicroscopy/openm ... r176124789 but we hope someday to make it available at the command line as noted at the bottom of https://github.com/openmicroscopy/desig ... 1/index.md.

More directly for the query you were envisioning, with the help of https://docs.openmicroscopy.org/latest/ ... bject.html you can find your way along the model from Project:
Code: Select all
$ bin/omero hql -q "SELECT i.id, f.details.owner.omeName, o.path || o.name FROM Project AS p JOIN p.datasetLinks pdl JOIN pdl.child AS d JOIN d.imageLinks AS dil JOIN dil.child AS i JOIN i.fileset AS f JOIN f.usedFiles AS u JOIN u.originalFile AS o WHERE p.id = 1234"

for the image IDs, fileset owners and managed repository file paths for the images of project ID 1234.

Do note that images' files are organized into groups named filesets as at https://docs.openmicroscopy.org/latest/ ... l#filesets and that if you need the files archived for images back in OMERO 4.x then those are not in the managed repository and require a different query.

We are currently looking at polishing and making available a Java-based command-line download utility (currently in prototype) that can obtain a local copy of all of a project's imported image files, organized by fileset and image. However, that requires at least OMERO 5.3.

Please do feel free to ask anything further about the above or anything else.

Cheers,
Mark

Re: Finding original files

PostPosted: Mon Oct 01, 2018 5:50 pm
by DaveMellert
Mark,

Thanks so much! I was really beating my head against the wall. I will work through this and report back.

And yes, we are using a very old version of OMERO :cry: . Finding these original files are part of a larger project to move to a new version on new hardware, using a totally different storage solution on the back end (or else I would just migrate the repository as is).

-Dave

Re: Finding original files

PostPosted: Tue Oct 02, 2018 5:22 pm
by DaveMellert
Mark,

Worked like a charm! Thanks again.

-Dave