Expand supported link types#30
Conversation
sbesson
left a comment
There was a problem hiding this comment.
👍 for the expansion of the library to allow tables to be linked to additional objects.
Looking at https://omero.readthedocs.io/en/stable/developers/Model/StructuredAnnotations.html#annotation-hierarchy, the concrete annotation classes that are not included here are
BooleanAnnotation
TimeStampAnnotation
TermAnnotation
DoubleAnnotation
LongAnnotation
CommentAnnotation
Even though we don't have workflows for these types currently, we might in the future and/or others in the community could benefit from it. My vote goes towards adding them to the list of annotatable objects.
|
Thanks @sbesson, have made that change |
sbesson
left a comment
There was a problem hiding this comment.
Ran some a basic functional testing creating empty annotations of each type and importing a single table linked to every object
Python 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omero
>>> import omero2pandas
>>> import pandas
>>> my_data = pandas.read_csv("nuclei.csv")
>>> client = omero.client("localhost")
>>> client.createSession("import.user", password)
session-759e5066-69ac-471d-a2fe-ebda0636d7c4/b0e408fb-bf93-4e73-9793-7b4f8fe7a97e -t -e 1.1 @ BlitzAdapters
>>> ann_id = omero2pandas.upload_table(my_data, "test ann links", links=[("BooleanAnnotation", 3221), ("CommentAnnotation", 3222), ("DoubleAnnotation", 3223), ("FileAnnotation", 3224), ("ListAnnotation", 3225), ("LongAnnotation", 3226), ("MapAnnotation", 3227), ("TagAnnotation", 3228), ("TermAnnotation", 3229), ("TimestampAnnotation", 3230), ("XmlAnnotation", 3231)], omero_connector=client)
Inspecting table...: 0%| | 1/? rows, 00:00 WARNING:omero2pandas.upload:Limiting automatic chunk size to 50000 (was 285714)
Uploading table to OMERO: : 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 53/53 rows, 00:00
>>> ann_id
3232
A dry-run deletion of the newly created FileAnnotation object confirms there are 11 associated AnnotationAnnotationLink:
$ omero delete --dry-run FileAnnotation:3232 --report
Using session for import.user@localhost:4064. Idle timeout: 10 min. Current group: Demo Group
omero.cmd.Delete2 FileAnnotation:3232 Dry run performed
ok
Steps: 4
Elapsed time: 0.104 secs.
Flags: []
Deleted objects
AnnotationAnnotationLink:101-111
FileAnnotation:3232
OriginalFile:13162
ExternalInfo:17033
This PR expands the object types permitted in the
linksargument to cover some annotation types. This will primarily help to associate results with the workflow data model.We could potentially include some of the more obscure types like
BooleanAnnotationbut I've tried to limit it to what is likely to be useful within omero-web, at least in the first instance.