OMERO table from pandas dataframe

Hi,
I’m currently using OMERO’s python API to create OMERO.tables to annotate.
When I start from a pandas dataframe, this is programatically ‘laborioius’ and I was wondering if there is an alternative directly using pyTables. Something like creating a h5 file annotation with the specific formatting used by OMERO and link it.
Is this possible? is there some example code somewhere?

Hi Julio
I assume you want to the use the method dataFrame.to_hdf. It could be technically possible but we do not have API methods to directly convert using pyTables.
I am also not convinced that until there is a method like dataFrame.to_omero_table it will simplify matter since you will have to convert the element of the dataFrame into the corresponding omero types.

I assumed you had a look at some of the notebook examples we have omero-guide-cellprofiler/idr0002_save.ipynb at 431f3c41ae4bf74672bc37595bf4e84ce36a0c12 · ome/omero-guide-cellprofiler · GitHub

Jmarie

Yes, that is what I had in mind. Probably with some kind of preprocessing of the dataframe and maybe some postprocessing of the h5 file to fit it into what OMERO expects.

Yes I had a look at the examples and so and I came out with pandas-less version of it

but it does not look very robust (I only look at the type of the first element in the column) and I do not expect it to be very efficient when dealing with a big table.
I was planning to pandifying those functions and I wondered if I could get a shortcut :o)

Thanks

Hi @juliomateos
I guess you could split the table into several bundles of rows to write it (similar to a read)
I cannot think of a short cut.
You should maybe have a look at the Java implementation:

and omero-gateway-java/TablesFacilityHelper.java at cf1b4a4e080fc336d207bee777a96348510652b4 · ome/omero-gateway-java · GitHub

Cheers
Jmarie

Hi,

Thanks. I will look into this.

Julio