diff --git a/pyproject.toml b/pyproject.toml index 6bc6c7b..1f37ea2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ "SPARQLWrapper >=2.0.0,<3.0.0", # "mlem", "mlem >=0.4.0", - "reasoner-pydantic >=3.0.1", + "reasoner-pydantic >=4.1.4", # "fairworkflows", # "fairworkflows@git+https://github.com/vemonet/fairworkflows.git", # "yatiml >=0.10.0", @@ -80,6 +80,7 @@ test = [ "types-requests", ] test-prod = [ + # Cannot be installed on python 3.8 "reasoner-validator >=3.9.0", ] doc = [ @@ -131,8 +132,8 @@ fmt = "pre-commit run --all --all-files" test-dev = "pytest tests/production {args}" test-ci = "pytest tests/production --server https://openpredict.ci.transltr.io {args}" test-prod = "pytest tests/production --server https://openpredict.transltr.io {args}" -compile = "pip-compile --extra dev --extra test --extra train -o requirements.txt pyproject.toml" -compile-test = "pip-compile --extra dev --extra test --extra test-prod -o requirements-tests.txt pyproject.toml" +requirements = "pip-compile --extra dev --extra test --extra train -o requirements.txt pyproject.toml" +requirements-test = "pip-compile --extra dev --extra test --extra test-prod -o requirements-tests.txt pyproject.toml" fix-permission = "sudo chown -R $(id -u):$(id -g) models data" # train = "python src/openpredict_model/train.py train-model" diff --git a/requirements.txt b/requirements.txt index 4703174..86780e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,76 +1,9 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --extra=dev --extra=test --extra=train --output-file=requirements.txt --resolver=backtracking pyproject.toml +# pip-compile --extra=dev --extra=test --extra=train --output-file=requirements.txt pyproject.toml # -fairworkflows@git+https://github.com/vemonet/fairworkflows.git - -# FAIRWORKFLOW DEPS -charset-normalizer==2.1.1 - # via requests -html5lib==1.1 - # via pyshacl - -# nanopub @ git+https://github.com/vemonet/nanopub.git - # via fairworkflows (pyproject.toml) -networkx==2.8.8 - # via fairworkflows (pyproject.toml) -noodles==0.3.3 - # via fairworkflows (pyproject.toml) -owlrl==6.0.2 - # via pyshacl -packaging==22.0 - # via pyshacl -prettytable==2.5.0 - # via pyshacl -pycryptodome==3.16.0 - # via nanopub -pyparsing==3.0.9 - # via rdflib -pyshacl==0.20.0 - # via fairworkflows (pyproject.toml) -pyyaml==6.0 - # via fairworkflows (pyproject.toml) -rdflib==6.2.0 - # via - # fairworkflows (pyproject.toml) - # nanopub - # owlrl - # pyshacl -requests==2.28.1 - # via - # fairworkflows (pyproject.toml) - # nanopub -ruamel-yaml==0.17.21 - # via yatiml -ruamel-yaml-clib==0.2.7 - # via ruamel-yaml -six==1.16.0 - # via - # html5lib - # isodate -typer==0.7.0 - # via nanopub -typing-extensions==4.4.0 - # via yatiml -ujson==5.6.0 - # via noodles -urllib3==1.26.13 - # via requests -wcwidth==0.2.5 - # via prettytable -webencodings==0.5.1 - # via html5lib -yatiml==0.10.0 - # via nanopub - - - - - -# ALL DEPS - aiohttp==3.8.3 # via # aiohttp-retry @@ -103,8 +36,6 @@ appdirs==1.4.4 # iterative-telemetry arrow==1.2.3 # via isoduration -asgiref==3.5.2 - # via uvicorn async-timeout==4.0.2 # via aiohttp asyncssh==2.12.0 @@ -118,8 +49,6 @@ attrs==22.1.0 # jsonlines # jsonschema # pytest -autoflake==1.7.8 - # via openpredict (pyproject.toml) babel==2.11.0 # via sphinx billiard==3.6.4.0 @@ -131,7 +60,9 @@ black==21.6b0 bmt==0.8.12 # via # kgx - # reasoner-validator + # trapi-predict-kit +build==1.0.3 + # via pip-tools cached-property==1.5.2 # via mlem cachetools==5.2.0 @@ -141,6 +72,7 @@ celery==5.2.7 certifi==2022.12.7 # via # httpcore + # httpx # requests cffi==1.15.1 # via @@ -170,10 +102,10 @@ click==8.1.3 # linkml # linkml-runtime # mlem + # pip-tools # prefixcommons # sphinx-click # typer - # uvicorn click-didyoumean==0.3.0 # via celery click-plugins==1.1.1 @@ -242,6 +174,7 @@ dvc==2.38.1 # via # dvc-http # openpredict (pyproject.toml) + # trapi-predict-kit dvc-data==0.28.4 # via dvc dvc-http==2.27.2 @@ -265,7 +198,7 @@ exceptiongroup==1.0.4 fastapi==0.68.2 # via # openpredict (pyproject.toml) - # reasoner-validator + # trapi-predict-kit filelock==3.8.2 # via # iterative-telemetry @@ -274,13 +207,7 @@ filelock==3.8.2 flake8==5.0.4 # via # bmt - # flake8-pyproject # kgx - # openpredict (pyproject.toml) -flake8-pyproject==1.2.2 - # via openpredict (pyproject.toml) -flaky==3.7.0 - # via openpredict (pyproject.toml) flatdict==4.0.1 # via mlem flatten-dict==0.4.2 @@ -324,16 +251,17 @@ graphviz==0.20.1 # via linkml greenlet==2.0.1 # via sqlalchemy -gunicorn==20.1.0 - # via openpredict (pyproject.toml) h11==0.14.0 - # via - # uvicorn + # via httpcore hbreader==0.9.1 # via # jsonasobj2 # linkml # linkml-runtime +httpcore==0.18.0 + # via httpx +httpx==0.25.0 + # via openpredict (pyproject.toml) hydra-core==1.3.0 # via dvc identify==2.5.10 @@ -341,9 +269,9 @@ identify==2.5.10 idna==3.4 # via # anyio + # httpx # jsonschema # requests - # rfc3986 # yarl ijson==3.1.4 # via kgx @@ -351,8 +279,15 @@ imagesize==1.4.1 # via sphinx importlib-metadata==4.13.0 # via + # build + # mlem # prefixmaps # sphinx +importlib-resources==6.1.0 + # via + # dvc + # hydra-core + # jsonschema iniconfig==1.1.1 # via pytest isodate==0.6.1 @@ -362,9 +297,7 @@ isodate==0.6.1 isoduration==20.11.0 # via jsonschema isort==5.11.2 - # via - # mlem - # openpredict (pyproject.toml) + # via mlem iterative-telemetry==0.0.6 # via # dvc @@ -403,11 +336,10 @@ jsonschema[format]==4.17.3 # via # linkml # linkml-runtime - # reasoner-validator jsonstreams==0.6.0 # via kgx kgx==1.7.2 - # via reasoner-validator + # via openpredict (pyproject.toml) kiwisolver==1.4.4 # via matplotlib kombu==5.2.4 @@ -418,7 +350,6 @@ linkml==1.3.16 # via # bmt # kgx - # reasoner-validator linkml-dataops==0.1.0 # via linkml linkml-runtime==1.3.7 @@ -427,7 +358,6 @@ linkml-runtime==1.3.7 # kgx # linkml # linkml-dataops - # reasoner-validator llvmlite==0.36.0 # via numba markdown-it-py==2.1.0 @@ -446,8 +376,10 @@ mdit-py-plugins==0.3.3 # via myst-parser mdurl==0.1.2 # via markdown-it-py -mlem==0.3.2 - # via openpredict (pyproject.toml) +mlem==0.4.14 + # via + # openpredict (pyproject.toml) + # trapi-predict-kit multidict==6.0.3 # via # aiohttp @@ -505,6 +437,7 @@ ordered-set==4.1.0 # via kgx packaging==22.0 # via + # build # deprecation # dvc # hydra-core @@ -527,6 +460,10 @@ pathspec==0.9.0 # scmrepo pillow==9.3.0 # via matplotlib +pip-tools==7.3.0 + # via openpredict (pyproject.toml) +pkgutil-resolve-name==1.3.10 + # via jsonschema platformdirs==2.6.0 # via virtualenv pluggy==1.0.0 @@ -537,7 +474,7 @@ ply==3.11 # via jsonpath-ng pockets==0.9.1 # via sphinxcontrib-napoleon -pre-commit==2.20.0 +pre-commit==3.5.0 # via openpredict (pyproject.toml) prefixcommons==0.1.12 # via @@ -569,13 +506,11 @@ pydantic==1.10.2 # mlem # openpredict (pyproject.toml) # reasoner-pydantic - # reasoner-validator + # trapi-predict-kit pydot==1.4.2 # via dvc pyflakes==2.5.0 - # via - # autoflake - # flake8 + # via flake8 pygit2==1.11.1 # via scmrepo pygments==2.13.0 @@ -600,6 +535,8 @@ pyparsing==3.0.9 # mlem # pydot # rdflib +pyproject-hooks==1.0.0 + # via build pyrdf2vec==0.0.5 # via openpredict (pyproject.toml) pyrsistent==0.19.2 @@ -656,7 +593,6 @@ pyyaml==6.0 # pre-commit # prefixcommons # prefixmaps - # reasoner-validator rdflib==6.2.0 # via # cfgraph @@ -669,6 +605,7 @@ rdflib==6.2.0 # rdflib-shim # sparqlslurper # sparqlwrapper + # trapi-predict-kit rdflib-jsonld==0.6.1 # via rdflib-shim rdflib-shim==1.0.3 @@ -676,10 +613,10 @@ rdflib-shim==1.0.3 # pyshex # pyshexc # sparqlslurper -reasoner-pydantic==3.0.1 - # via openpredict (pyproject.toml) -reasoner-validator==3.2.2 - # via openpredict (pyproject.toml) +reasoner-pydantic==4.1.4 + # via + # openpredict (pyproject.toml) + # trapi-predict-kit recommonmark==0.7.1 # via # bmt @@ -699,9 +636,9 @@ requests==2.28.1 # prefixcommons # pyshex # python-gitlab - # reasoner-validator # requests-toolbelt # sphinx + # trapi-predict-kit requests-toolbelt==0.10.1 # via python-gitlab rfc3339-validator==0.1.4 @@ -772,6 +709,7 @@ sniffio==1.3.0 # via # anyio # httpcore + # httpx snowballstemmer==2.2.0 # via sphinx sparqlslurper==0.5.1 @@ -830,15 +768,14 @@ terminaltables==3.1.10 threadpoolctl==3.1.0 # via scikit-learn toml==0.10.2 - # via - # black - # pre-commit + # via black tomli==2.0.1 # via - # autoflake + # build # coverage - # flake8-pyproject # mypy + # pip-tools + # pyproject-hooks # pytest # tox tomlkit==0.11.6 @@ -859,6 +796,8 @@ tqdm==4.64.1 # dvc-objects # pyrdf2vec # shap +trapi-predict-kit==0.2.1 + # via openpredict (pyproject.toml) typer==0.7.0 # via # mlem @@ -875,6 +814,7 @@ typing-extensions==4.4.0 # mypy # myst-parser # pydantic + # rich # torch uri-template==1.2.0 # via jsonschema @@ -883,10 +823,6 @@ urllib3==1.26.13 # dulwich # pyshex # requests -uvicorn==0.15.0 - # via - # openpredict (pyproject.toml) - # reasoner-validator validators==0.20.0 # via kgx vine==5.0.0 @@ -912,6 +848,7 @@ wheel==0.38.4 # via # nvidia-cublas-cu11 # nvidia-cuda-runtime-cu11 + # pip-tools wrapt==1.14.1 # via deprecated yarl==1.8.2 @@ -919,7 +856,9 @@ yarl==1.8.2 zc-lockfile==2.0 # via dvc zipp==3.11.0 - # via importlib-metadata + # via + # importlib-metadata + # importlib-resources # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/src/trapi/main.py b/src/trapi/main.py index 28a5bcf..e40fe19 100644 --- a/src/trapi/main.py +++ b/src/trapi/main.py @@ -76,6 +76,36 @@ \n\nMore documentation available at [github.com/MaastrichtU-IDS/translator-openpredict](https://github.com/MaastrichtU-IDS/translator-openpredict) \n\n[![Test production API](https://github.com/MaastrichtU-IDS/translator-openpredict/actions/workflows/run-tests-prod.yml/badge.svg)](https://github.com/MaastrichtU-IDS/translator-openpredict/actions/workflows/run-tests-prod.yml) \n\nService supported by the [NCATS Translator project](https://ncats.nih.gov/translator/about)""", + trapi_description="""The default example TRAPI query will give you a list of predicted potential drug treatments for a given disease + +You can also try this query to retrieve similar entities for a given drug: + +```json +{ + "message": { + "query_graph": { + "edges": { + "e01": { + "object": "n1", + "predicates": [ "biolink:similar_to" ], + "subject": "n0" + } + }, + "nodes": { + "n0": { + "categories": [ "biolink:Drug" ], + "ids": [ "DRUGBANK:DB00394" ] + }, + "n1": { + "categories": [ "biolink:Drug" ] + } + } + } + }, + "query_options": { "n_results": 5 } +} +``` + """, ) app.include_router(openpredict_api)