Page 1 of 1

fileset deletion with python bindings

PostPosted: Fri Jun 08, 2018 5:44 am
by evenhuis
Hi all,

I recently had a user accidentally upload a 100 FoV image three times into a an existing dataset. They couldn't delete a single image as it is part of a fileset. In they In principle they could have deleted the fileset themselves by multiply selecting the 100 images that make up the fileset, but this wasn't practical.

I found the id of the fileset through the python bindings, but I couldn't find a way to delete it, either in the documents or by inspecting the member methods of fileset and connection objects. I was able to delete it using the omero commandline line tool.

It is possible to delete a fileset through the python binding? It would be nice be able to do this through python as I find it much more convenient for interactively exploration.

Cheers,

Chris

Re: fileset deletion with python bindings

PostPosted: Fri Jun 08, 2018 5:59 am
by jmoore
Hi Chris,

evenhuis wrote:It is possible to delete a fileset through the python binding? It would be nice be able to do this through python as I find it much more convenient for interactively exploration.


Definitely, since this is exactly what the commandline tool is doing with the `omero.cmd.Delete2` argument. But it's even simpler if you use the Gateway wrapper. Based roughly on the Delete.py example:

Code: Select all
import omero
import omero.callbacks
from omero.gateway import BlitzGateway

fid = 31252
conn = BlitzGateway(USERNAME, PASSWORD, host=HOST, port=PORT)
conn.connect()
conn.deleteObjects("Fileset", [fid], wait=True)


Cheers,
~Josh