We're Hiring!

(1) change file ownership, (2) restrict import search

General user discussion about using the OMERO platform to its fullest. Please ask 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

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

(1) change file ownership, (2) restrict import search

Postby dsudar » Tue Jul 01, 2014 10:29 pm

Hi,

Two unrelated questions:

1) is there any way to change the ownership of images/projects/screens after the import? I imported a huge amount of image data and would like to transfer ownership to another user whose data it actually is. (Yes, I should have imported with the "import for" functionality but ..... I didn't ....).
Actually that brings up another question: is the "Import For" functionality available from the command line importer?

2) is there a way to restrict how many levels deep the importer will search for valid files? I have a plate worth of TIFF images from a screen acquired with IN Cell 6000 but the acquisition software also created a subdirectory of thumbnails (.jpg's) which I do not want to import (since OMERO creates its own). So I'd like to stop the command line importer from going down to that subdirectory.

Thanks,
- Damir
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

Re: (1) change file ownership, (2) restrict import search

Postby jmoore » Wed Jul 02, 2014 6:24 am

Morning, Damir,

dsudar wrote:1) is there any way to change the ownership of images/projects/screens after the import? I imported a huge amount of image data and would like to transfer ownership to another user whose data it actually is. (Yes, I should have imported with the "import for" functionality but ..... I didn't ....).


The "chown" functionality is preview quality at best. How much data are we talking about? How many images, for example?

Actually that brings up another question: is the "Import For" functionality available from the command line importer?


Use `bin/omero login --sudo=youradmin regularuser@localhost`

You'll be asked for the password of "youradmin". After which, anything you do on the CLI will done as "regularuser".

2) is there a way to restrict how many levels deep the importer will search for valid files? I have a plate worth of TIFF images from a screen acquired with IN Cell 6000 but the acquisition software also created a subdirectory of thumbnails (.jpg's) which I do not want to import (since OMERO creates its own). So I'd like to stop the command line importer from going down to that subdirectory.


There is:
Code: Select all
$ JAVA_OPTS=-Domero.import.depth=1 dist/bin/omero import -f /tmp/subdirs/
...OMERO Version: 5.0.3-ice35-SNAPSHOT
....Bioformats version: 5.0.3-ice35-SNAPSHOT revision: 0c4215a date: 16 June 2014
...Log levels -- Bio-Formats: ERROR OMERO.importer: INFO
...Depth: 1 Metadata Level: MINIMUM
         ===

But there's also no good reason this isn't an option directly on the import CLI, so it should be available in 5.0.3: https://github.com/openmicroscopy/openmicroscopy/pull/2724

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: (1) change file ownership, (2) restrict import search

Postby dsudar » Wed Jul 02, 2014 5:08 pm

Hi Josh,

Thanks! both for the answers and for the fact that the answers are "yes".

I have about 150,000 2D images (3 or 4 channel each) from about 88 plates (384-well) that I would like to "chown".

Great to have the import for functionality on the CLI. In the queue for documenting on: http://www.openmicroscopy.org/site/supp ... mport.html

And great about the import.depth setting: saves me a lot of work temporarily removing those thumbs directories and then moving them back in place.

And sorry but another question: due to a failed import of a large plate worth of data, a huge number of images (about 30,000) got dropped into my Orphaned image container. Is there any easy way (ideally CLI) to delete them all? Insight barfs when I try to select them all and Web only lets me select 200 at a time.

Thanks!
- Damir
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

Re: (1) change file ownership, (2) restrict import search

Postby jmoore » Wed Jul 02, 2014 6:14 pm

Hi Damir,

dsudar wrote:Thanks! both for the answers and for the fact that the answers are "yes".
I have about 150,000 2D images (3 or 4 channel each) from about 88 plates (384-well) that I would like to "chown".

Ha. You're welcome, but I'm not overly optimistic about getting chown to work on these images. In my few tests of it this morning, I had little success. If at all possible, I'd suggest re-importing. Otherwise, we'll likely need to come up with something custom.

And sorry but another question: due to a failed import of a large plate worth of data, a huge number of images (about 30,000) got dropped into my Orphaned image container. Is there any easy way (ideally CLI) to delete them all? Insight barfs when I try to select them all and Web only lets me select 200 at a time.


No problem. You can get a list of the images with a query like this:
Code: Select all
bin/omero hql --style=plain --all -q --limit=100 "select '/Image:'||i.id, d.name from Dataset d join d.imageLinks l join l.child i where d.id = 123456"

appending:
Code: Select all
| cut -f2 -d,

will list only the images, and that you can use in a loop or like this:
Code: Select all
$ LIST=$(bin/omero hql --style=plain --all -q --limit=10 "select '/Image:'||i.id,d.id from Dataset d join d.imageLinks l join l.child i" | cut -f2 -d,)
$ echo $LIST
/Image:303 /Image:354 /Image:355 /Image:356 /Image:1152 /Image:1153 /Image:1302 /Image:1351 /Image:1577 /Image:1578
$ bin/omero delete $LIST
omero.cmd.Delete /Image 303... ok
omero.cmd.Delete /Image 354... ok
omero.cmd.Delete /Image 355... ok
omero.cmd.Delete /Image 356... ok
omero.cmd.Delete /Image 1152... ok
omero.cmd.Delete /Image 1153... ok
....


Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: (1) change file ownership, (2) restrict import search

Postby dsudar » Mon Jul 07, 2014 10:21 pm

Hi Josh,

I'm afraid I'm declaring defeat. I've been trying to decypher the HQL query in your instructions in order to make it do what I need but alas, well over my head ....

First I don't really see where you specify that the select is from the "Orphaned Images" container. Furthermore, I get very much lost with all the joins of i, and d, and l ....

So I'm afraid I'll have to ask again. So I still have thousands of images in that Orphaned Images container and since that container doesn't seem to have a Dataset ID, I'm not sure that the instructions would work for this.

Thanks,
- Damir
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

Re: (1) change file ownership, (2) restrict import search

Postby jmoore » Tue Jul 08, 2014 6:34 am

Hi Damir,

dsudar wrote:First I don't really see where you specify that the select is from the "Orphaned Images" container. Furthermore, I get very much lost with all the joins of i, and d, and l ....


My apologies. Somehow I dropped the "in the orphaned container" once I started writing the query. The version for the orphaned images is:
Code: Select all
bin/omero hql "select i from Image i where i.datasetLinks is empty and i.wellSamples is empty"


Note: if you omit the "i.wellSamples is empty" you will end up with some images that are in Plates but not datasets.

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: (1) change file ownership, (2) restrict import search

Postby dsudar » Tue Jul 08, 2014 6:29 pm

Thanks Josh,

Yes, now that makes sense and I'm busily deleting the images thousands at a time with:

$ LIST=$(bin/omero hql --style=plain --all -q --limit=5000 "select '/Image:'||i.id, i from Image i where i.datasetLinks is empty and i.wellSamples is empty" | cut -f2 -d, )
Using session 272d175d-718e-4a53-942d-58ada68ddc74 (dsudar@localhost:4064). Idle timeout: 10.0 min. Current group: Atlas
$ bin/omero delete $LIST
Using session 272d175d-718e-4a53-942d-58ada68ddc74 (dsudar@localhost:4064). Idle timeout: 10.0 min. Current group: Atlas
omero.cmd.Delete /Image 22595... ok
omero.cmd.Delete /Image 22596... ok
omero.cmd.Delete /Image 22597... ok
omero.cmd.Delete /Image 22598... ok
.... etc ...


Cheers,
- Damir
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest