We're Hiring!

Finding original files

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Finding original files

Postby DaveMellert » Fri Sep 28, 2018 6:59 pm

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!
DaveMellert
 
Posts: 21
Joined: Mon Jun 04, 2018 5:46 pm

Re: Finding original files

Postby mtbc » Mon Oct 01, 2018 9:34 am

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
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Re: Finding original files

Postby DaveMellert » Mon Oct 01, 2018 5:50 pm

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
DaveMellert
 
Posts: 21
Joined: Mon Jun 04, 2018 5:46 pm

Re: Finding original files

Postby DaveMellert » Tue Oct 02, 2018 5:22 pm

Mark,

Worked like a charm! Thanks again.

-Dave
DaveMellert
 
Posts: 21
Joined: Mon Jun 04, 2018 5:46 pm


Return to Developer Discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron