This streamline JavaScript tool can be added to any website or browser application very easily: it converts Monarch Initiative's IDs for diseases, genes and phenotypes (i.e. respectively 'MONDO:', 'HGNC:' and 'HP:') to OMIM IDs -and viceversa.
Once added to your .html configuration, it can accept either Monarch Initiative's IDs or OMIM IDs and convert them. It fetches corresponding IDs from mapping files monarch-omim.json and
omim-monarch.json`.
Both are necessary to avoid that when looking for OMIM IDs in the monarch-omim.json
file, it iterates through each element taking a lot of time.
Mapping files can be generated -or updated by overwriting them- with the following prompts:
python updateMapping.py
for default functionality (ID mapping files only for diseases)python updateMapping.py --genes
ID mapping files for diseases and genespython updateMapping.py --phenotypes
ID mapping files for diseases and phenotypespython updateMapping.py --genes --phenotypes
ID mapping files for diseases, genes and phenotypespython updateMapping.py --reverse
foromim-monarch.json
file creation based onmonarch-omim.json
mapping file
The --reverse
command overrides any other function of the script, only generating the second mapping file. Otherwise, that file is generated automatically after monarch-omim.json
. Mappings are extrapolated using Monarch Initiative's V3 API.
Copies of both mapping files for diseases only are already provided in this repository, updated to January 13th 2025. IDs only for disease were downloaded so far as generating the mapping for 29.916 diseases present on Monarch Initiative's database took 4h21min: downloading those also for 571.154 genes and 151.521 phenotypes might have take too long, and I didn't need them to test the tool. They still can be extrapolated fairly easily though, if run in the background.
You can check how the tool work after cloning the repository and running a local web server with Python: python -m http.server 8000
which can then be accessed at http://localhost:8000/test.html
from any web browser.
This very simple html configuration lacks any CSS embellishment, yet the JavaScript tools allows for any set of UI choices.