Page 1 of 1

MAPR plugin installation

PostPosted: Thu May 24, 2018 9:33 am
by sameh
Hello everyone ,

we are doing tests with the MAPR plugin on our OMERO database.

We followed the instructions: https://github.com/ome/omero-mapr/

Now, we do not know how to integrate this code into our database?

key_value_data = [["Gene Identifier", "ENSG00000117399"],
                  ["Gene Identifier URL", "http://www.ensembl.org/id/ENSG00000117399"],
                  ["Gene Symbol", "CDC20"]]
map_ann = omero.gateway.MapAnnotationWrapper (conn)
map_ann.setValue (key_value_data)
map_ann.setNs ( "openmicroscopy.org/mapr/gene")
map_ann.save ()
i = conn.getObject ('Image', 2917)
i.linkAnnotation (map_ann)

Is there a Python script that allows us to insert annotations ? Or a simpler way?

Thanks for your help

Re: MAPR plugin installation

PostPosted: Fri May 25, 2018 8:51 pm
by wmoore
Hi,

That Python code snippet is using the OMERO Python API to connect to OMERO and create a new Map Annotation.

See https://docs.openmicroscopy.org/omero/5 ... ython.html
You need the OMERO Python libs (shipped with the OMERO.server, or in the OMERO.py download) on your PYTHONPATH and you need Ice installed.

You could also use the OMERO interactive python shell for trying out small bits of code
Code: Select all
$ bin/omero shell --login

# enter login credentials then...

In [1]: from omero.gateway import BlitzGateway
In [2]: conn = BlitzGateway(client_obj=client)
# Then use 'conn' as in the example



An alternative is to use the Java API https://docs.openmicroscopy.org/omero/5 ... /Java.html
I think the Map annotation example is missing from that page (needs updating) but if you want to go that way we can easily provide an example.

Hope that helps.

Will.