Package: omero-mapr
MAPROMERO.mapr is an OMERO.web app that enables browsing of data through attributes linked to images
in the form of Map Annotations.It is used extensively by theImage Data Resource,
allowing users to find data by various categories such as Genes, Phenotypes, Organism etc.In OMERO, Map Annotations are lists of named attributes or “Key-Value Pairs” that can be used to
annotate many types of data. Annotations can be assigned anamespaceto indicate the origin and purpose of the annotation.Map Annotations created by users via the Insight client or webclient all have the
namespaceopenmicroscopy.org/omero/client/mapAnnotation, whereas other
Map Annotations created via the OMERO API by other tools should have their own distinct
namespace.We can configure OMERO.mapr to search for Map Annotations of specifiednamespace,
looking forValuesunder specifedKeys.
For example, seach for values under keyGene SymbolorGene Identifierand namespaceopenmicroscopy.org/mapr/gene.RequirementsOMERO.web 5.6 or newer.Installing from PypiThis section assumes that an OMERO.web is already installed.
NB: Configuration of the settings (see below) is not optional
and is required for the app to work.Install the app usingpip:$ pip install omero-maprAdd the app to the list of installed apps:$ omero config append omero.web.apps '"omero_mapr"'Config SettingsYou need to configure the namespaces and keys that you want users to be able to search for.User-edited Map AnnotationsMap Annotations that are added using the webclient or Insight in the Key-Value panel
use a specific “client” namespace. We can therefore configure OMERO.mapr to search
for these annotations using the namespaceopenmicroscopy.org/omero/client/mapAnnotation.
For example, to search for “Primary Antibody” or “Secondary Antibody” values, we can add:$ omero config append omero.web.mapr.config '{"menu": "antibody", "config":{"default":["Primary Antibody"], "all":["Primary Antibody", "Secondary Antibody"], "ns":["openmicroscopy.org/omero/client/mapAnnotation"], "label":"Antibody"}}'We can add an “Antibodies” link to the top of the webclient page to take us to the Antibodies search page.
The link tooltip is “Find Antibody values”.
Theviewnameshould be in the formmaprindex_{menu}where{menu}is the themenuvalue in the previous config.$ omero config append omero.web.ui.top_links '["Antibodies", {"viewname": "maprindex_antibody"}, {"title": "Find Antibody values"}]'After restarting web, we can now search for Antibodies:We can also specify an empty list of keys to search foranyvalue.$ omero config append omero.web.mapr.config '{"menu": "anyvalue", "config":{"default":["Any Value"], "all":[], "ns":["openmicroscopy.org/omero/client/mapAnnotation"], "label":"Any"}}'

# Top link
$ omero config append omero.web.ui.top_links '["Any Value", {"viewname": "maprindex_anyvalue"}, {"title": "Find Any Value"}]'After restarting web, we can now search for any Value, such as “INCENP”:Other Map AnnotationsIn this example we want to search
for Map Annotations of namespaceopenmicroscopy.org/mapr/genesearching for
attributes under theGene SymbolandGene Identifierkeys.$ omero config append omero.web.mapr.config '{"menu": "gene","config": {"default": ["Gene Symbol"],"all": ["Gene Symbol", "Gene Identifier"],"ns": ["openmicroscopy.org/mapr/gene"],"label": "Gene"}}'Now add a top link ofGeneswith tooltipFind Gene annotationsthat will take us to thegenesearch page. Thequery_stringparameters are added to the URL, with"experimenter":-1specifying that we want to search across all users.$ omero config append omero.web.ui.top_links '["Genes", {"viewname": "maprindex_gene", "query_string": {"experimenter": -1}}, {"title": "Find Gene annotations"}]'Finally, we can add a map annotation to an Image that is in a Screen -> Plate -> Well
or Project -> Dataset -> Image hierarchy.
This code uses the OMEROPython APIto
add a map annotation corresponding to the configuration above: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()
image = conn.getObject('Image', 2917)
image.linkAnnotation(map_ann)Now restart OMERO.web as normal for the configuration above to take effect.
You should now be able to browse to aGenespage and search forCDC20orENSG00000117399.External URL FaviconsMapr can automatically convert URLs into favicon links.
To use this feature the key such asGene Identifiermust be in the “all” list of a config
as shown above and theGene Identifierkey-value pair must be followed by a key-value pair
calledGene Identifier URL.
A favicon linked to the external URL will be appended to theGene Identifierrow, and theGene Identifier URLkey-value pair will be hidden.
OMERO.web must be configured with the Django redis cachehttps://docs.openmicroscopy.org/omero/5/sysadmins/unix/install-web/walkthrough/omeroweb-install-centos7-ice3.6.html?highlight=redis#configuring-omero-webwhich is used to cache the favicons that are obtained using a Google service.TestingTesting MAPR requires OMERO.server running.
Run tests (includes self-contained OMERO.server, requires docker):docker-compose -f docker/docker-compose.yml up --build --abort-on-container-exit
docker-compose -f docker/docker-compose.yml rm -fvLicenseMAPR is released under the AGPL.Copyright2016-2021, The Open Microscopy Environment