Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

OnToma is a python module that helps you map your disease/phenotype terms to the ontology we use in the Open Targets platform.

The ontology we use in the Open Targets platform is a subset (aka. slim) of the EFO ontology plus any HPO terms for which a valid EFO mapping could not be found.


  • Wrap OLS, OXO, Zooma in a pythonic API
  • Always tries to output full URI
  • Tries to find mappings iteratively using the faster methods first
  • Checks if mapping is in the subset of EFO that gets included in the Open Targets platform
  • tries to follow the procedure highlighted in



pip install ontoma


Looking for a disease or phenotype string is simple:

from ontoma import OnToma

otmap = OnToma()


you can obtain more details using the verbose flag:


#outputs something similar to:
'source':'EFO OBO','quality':'match' ...}

From the command line

The command line version can be invoked with ontoma (type ontoma --help to find out about the usage):

ontoma <input_file> <output_file>

where input file can be replaced with - to read from stdin and write to stdout.

Which means that to read from a previous command, using pipes:

echo 'asthma' | ontoma - <output_file>

will output a file test.txt containing the result, where it came from and the degree of confidence of the match (one of {match, fuzzy, check}):    asthma  EFO OBO     match

Piping also works for the output. If you want to find the string "mymatch" from the results, you can:

ontoma <input_file> - | grep "mymatch"

More detailed documentation is at Documentation Status


set up your environment

First clone this repo

git clone

Install pipenv and then run

pipenv install --dev

to get all development dependencies installed.

Test everything is working:

pipenv run pytest

if you don't like pipenv you can stick with the more traditional setuptools/virtualenv setup:

git clone
virtualenv -p python3 venv
source venv/bin/activate
pip install --editable .

How to add a dependency

Add to both pipenv AND

To add a dep for a library, add it by hand to, then add it separately to Pipfile, so that it shows up both as a transitive dependency and in your locked dev environment

Release to PyPi

Simply run ./

The script will tag, push and trigger a new CI run. The package will be automatically uploaded to pypi.


Map your disease and phenotype terms to the Open Targets platform ontology




No packages published