Page 1 of 1

retrieve data from file annotation

PostPosted: Thu Jul 03, 2014 6:04 am
by ebbwdan
Hi,

I was wondering what would be the best way of reading numeric data from a file annotation (csv, columns of numbers) on an Omero server via a script. So, the file is uploaded to the server and the script accesses the data in that file. I would like to work purely in Python (omero-csv-tools seems to do something similar but in Java) and I assumed I could use the BlitzGateway connection. I very naively thought I could get the path on the server to the original file and then give that to something like numpy.genfromtxt ...

We are in the process of getting our Omero server up and running within a cloud service which is going to be backed up with some hefty resources so I am looking at running some analysis inside the server (both image and purely numeric data which is annotated to images). Ideally I would like to turn files of columnar numeric data into Omero.tables on import but it seems like this needs to be done in two steps - annotate an image first and then convert some/all the data in the file to HDF5?

Many thanks in advance for any pointers!

Cheers,

Dan.

Re: retrieve data from file annotation

PostPosted: Thu Jul 03, 2014 9:15 am
by PaulVanSchayck
Hey Dan,

I was wondering what would be the best way of reading numeric data from a file annotation (csv, columns of numbers) on an Omero server via a script. So, the file is uploaded to the server and the script accesses the data in that file. I would like to work purely in Python (omero-csv-tools seems to do something similar but in Java) and I assumed I could use the BlitzGateway connection. I very naively thought I could get the path on the server to the original file and then give that to something like numpy.genfromtxt ...

This is most certainly possible. What have you tried so far?
Take a look at:
http://downloads.openmicroscopy.org/ome ... nnotations
http://downloads.openmicroscopy.org/ome ... class.html
http://downloads.openmicroscopy.org/ome ... class.html

Kind regards,

Paul

Re: retrieve data from file annotation

PostPosted: Thu Jul 03, 2014 1:00 pm
by jmoore
Just adding to Paul's answer, your options as I can see them are:

  • Download the files as Paul describes.
  • Access the files locally via scripts. This is not a suggested method, but there are certainly sites which have done something similar.
  • Put the tabular data into OMERO.tables as you mention. The importer is currently OMERO.tables agnostic, so yes, you'd have to perform a post-processing step of some kind to attach the OMERO.tables.

Cheers,
~Josh.

Re: retrieve data from file annotation

PostPosted: Thu Jul 03, 2014 11:33 pm
by ebbwdan
Hi Paul and Josh,

Many thanks for the quick responses! I realised what the solution was just after I posted my message; I guess just asking the question made me realise where I was going wrong. I was trying to get that path on the server which wasn't a good idea.

The solution was staring me in the face on this page:

https://www.openmicroscopy.org/site/sup ... ython.html

I 'download' the file to some temp location on the server, then parse the file with numpy, and put the data I want in a table and then destroy the temp location.

Cheers,

Dan.