Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a post_table #16

Closed
juliomateoslangerak opened this issue Jan 29, 2021 · 4 comments
Closed

Adding a post_table #16

juliomateoslangerak opened this issue Jan 29, 2021 · 4 comments

Comments

@juliomateoslangerak
Copy link
Contributor

juliomateoslangerak commented Jan 29, 2021

I have some code I'd like to share for posting a table into OMERO if you would like to. I would have to cleanup a bit and consider some posibilities before.
As for now, the signature is something like this:

def post_table(conn, target_id: int, name: str, column_names: list[str], column_descriptions: list[str], values: list[list], namespace=None, table_description=None): -> table_id

The values argument is a list of lists of types that should within logic map to the types supported by the OMERO tables. That's kind of fine but for the image_id, roi, etc references that are special in omero. How would you go about this?
One option would be to assume that if a column name is image_id, it is considered as an images column, etc

Also, ideally you would like to pass a pandas dataframe as an OMERO table. I could try to implement that.

@mellertd
Copy link
Collaborator

mellertd commented Feb 1, 2021

I like this, and I haven't looked into how the OMERO API deals with posting tables at all, so even better!

Regarding input, I do think it would be preferred to take a pandas dataframe, as we are aiming for taking and returning objects that are either core Python or part of the SciPy ecosystem. PyTables support might also make sense but possibly harder to implement?

@mellertd
Copy link
Collaborator

mellertd commented Feb 1, 2021

One other thought...I think tables are similar to other annotations in that you can attach them to several different omero model object types (images, datasets, etc). So that should be supported (similar to what we have done with post_map_annotation)

@juliomateoslangerak
Copy link
Contributor Author

Indeed, a table is a 'special' file annotation that you may link to more than object.
You may construct the table through the omero's API. That is a bit of a pain but I already coded that. The problem may be that it is not very efficient of convenient if your data is on a proper pandas table.
however, as OMERO.tables is build on pyTables probably is easier to go that path

@erickmartins
Copy link
Collaborator

Closed with #58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants