From 28f3e9c98598bf9a06349f8a0924ca48b27bcce9 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Wed, 19 Apr 2023 10:05:59 -0400 Subject: [PATCH] refactor: update to lastest version of gene-normalizer (#146) * gene-normalizer versions allowed: >= 0.1.34 OR >= 0.2.9 * QueryHandler now accepts Database instance in the latest version * CoolSeqTool now has a gene_query_handler instance var --- Pipfile | 2 +- cool_seq_tool/cool_seq_tool.py | 1 + cool_seq_tool/data_sources/gene_normalizer.py | 4 +- cool_seq_tool/version.py | 2 +- requirements-dev.txt | 54 ++++++++++--------- requirements.txt | 32 +++++------ setup.cfg | 2 +- 7 files changed, 52 insertions(+), 45 deletions(-) diff --git a/Pipfile b/Pipfile index 3046fffb..2295afdb 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ hgvs = "*" pydantic = "*" fastapi = "*" uvicorn = "*" -gene-normalizer = "*" +gene-normalizer = ">=0.1.34, != 0.2.0, != 0.2.1, != 0.2.2, != 0.2.3, != 0.2.4, != 0.2.5, != 0.2.6, != 0.2.7, != 0.2.8" "ga4gh.vrs" = "*" [dev-packages] diff --git a/cool_seq_tool/cool_seq_tool.py b/cool_seq_tool/cool_seq_tool.py index b75553b3..062b9c75 100644 --- a/cool_seq_tool/cool_seq_tool.py +++ b/cool_seq_tool/cool_seq_tool.py @@ -59,6 +59,7 @@ def __init__( self.uta_db = UTADatabase(db_url=db_url, db_pwd=db_pwd) gene_normalizer = GeneNormalizer(gene_query_handler, gene_db_url, gene_db_region) + self.gene_query_handler = gene_normalizer.query_handler self.alignment_mapper = AlignmentMapper( self.seqrepo_access, self.transcript_mappings, self.uta_db) self.mane_transcript = MANETranscript( diff --git a/cool_seq_tool/data_sources/gene_normalizer.py b/cool_seq_tool/data_sources/gene_normalizer.py index c86f0cdb..3d147757 100644 --- a/cool_seq_tool/data_sources/gene_normalizer.py +++ b/cool_seq_tool/data_sources/gene_normalizer.py @@ -1,6 +1,7 @@ """Module for accessing Gene Normalizer""" from typing import Dict +from gene.database.dynamodb import DynamoDbDatabase from gene.query import QueryHandler from gene.schemas import SourceName @@ -27,7 +28,8 @@ def __init__( if query_handler: self.query_handler = query_handler else: - self.query_handler = QueryHandler(db_url, db_region) + ddb = DynamoDbDatabase(db_url=db_url, region_name=db_region) + self.query_handler = QueryHandler(ddb) def get_hgnc_data(self, gene: str) -> Dict: """Return HGNC data for a given gene diff --git a/cool_seq_tool/version.py b/cool_seq_tool/version.py index 0c5c3007..74acd0ef 100644 --- a/cool_seq_tool/version.py +++ b/cool_seq_tool/version.py @@ -1 +1 @@ -__version__ = "0.1.11" +__version__ = "0.1.12" diff --git a/requirements-dev.txt b/requirements-dev.txt index c8f885e3..0bfb657c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,13 +5,13 @@ appdirs==1.4.4 appnope==0.1.3 ; sys_platform == 'darwin' asttokens==2.2.1 asyncpg==0.27.0 -attrs==22.2.0 ; python_version >= '3.6' +attrs==23.1.0 ; python_version >= '3.7' backcall==0.2.0 -beautifulsoup4==4.12.0 ; python_full_version >= '3.6.0' +beautifulsoup4==4.12.2 ; python_full_version >= '3.6.0' biocommons.seqrepo==0.6.5 bioutils==0.5.7 ; python_version >= '3.6' -boto3==1.26.103 -botocore==1.29.103 ; python_version >= '3.7' +boto3==1.26.115 +botocore==1.29.115 ; python_version >= '3.7' bs4==0.0.1 canonicaljson==2.0.0 ; python_version >= '3.7' certifi==2022.12.7 ; python_version >= '3.6' @@ -22,16 +22,17 @@ coloredlogs==15.0.1 ; python_version >= '2.7' and python_version not in '3.0, 3. comm==0.1.3 ; python_version >= '3.6' configparser==5.3.0 ; python_version >= '3.7' -e . -coverage[toml]==7.2.2 ; python_version >= '3.7' +coverage[toml]==7.2.3 ; python_version >= '3.7' cssselect==1.2.0 ; python_version >= '3.7' -debugpy==1.6.6 ; python_version >= '3.7' +cython==0.29.34 ; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2' +debugpy==1.6.7 ; python_version >= '3.7' decorator==5.1.1 ; python_version >= '3.5' distlib==0.3.6 exceptiongroup==1.1.1 ; python_version < '3.11' executing==1.2.0 fake-useragent==1.1.3 -fastapi==0.95.0 -filelock==3.10.7 ; python_version >= '3.7' +fastapi==0.95.1 +filelock==3.12.0 ; python_version >= '3.7' flake8==6.0.0 flake8-annotations==3.0.0 flake8-docstrings==1.7.0 @@ -39,13 +40,13 @@ flake8-import-order==0.18.2 flake8-quotes==3.3.2 ga4gh.vrs==0.9.0.dev0 ga4gh.vrsatile.pydantic==0.1.0.dev7 ; python_version >= '3.8' -gene-normalizer==0.2.8 +gene-normalizer==0.2.9 h11==0.14.0 ; python_version >= '3.7' hgvs==1.5.4 humanfriendly==10.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' identify==2.5.22 ; python_version >= '3.7' idna==3.4 ; python_version >= '3.5' -importlib-metadata==6.1.0 ; python_version >= '3.7' +importlib-metadata==6.5.0 ; python_version >= '3.7' inflection==0.5.1 ; python_version >= '3.5' iniconfig==2.0.0 ; python_version >= '3.7' ipykernel==6.22.0 @@ -53,18 +54,18 @@ ipython==8.12.0 ; python_version >= '3.8' jedi==0.18.2 ; python_version >= '3.6' jmespath==1.0.1 ; python_version >= '3.7' jsonschema==3.2.0 -jupyter-client==8.1.0 ; python_version >= '3.8' +jupyter-client==8.2.0 ; python_version >= '3.8' jupyter-core==5.3.0 ; python_version >= '3.8' lxml==4.9.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' markdown==3.4.3 ; python_version >= '3.7' matplotlib-inline==0.1.6 ; python_version >= '3.5' mccabe==0.7.0 ; python_version >= '3.6' -mock==5.0.1 +mock==5.0.2 nest-asyncio==1.5.6 ; python_version >= '3.5' nodeenv==1.7.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' numpy==1.24.2 ; python_version >= '3.8' -packaging==23.0 ; python_version >= '3.7' -pandas==1.5.3 +packaging==23.1 ; python_version >= '3.7' +pandas==2.0.0 parse==1.19.0 parsley==1.3 parso==0.8.3 ; python_version >= '3.6' @@ -72,11 +73,11 @@ pexpect==4.8.0 ; sys_platform != 'win32' pickleshare==0.7.5 platformdirs==3.2.0 ; python_version >= '3.7' pluggy==1.0.0 ; python_version >= '3.6' -pre-commit==3.2.1 +pre-commit==3.2.2 prompt-toolkit==3.0.38 ; python_full_version >= '3.7.0' -psutil==5.9.4 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -psycopg2==2.9.5 ; python_version >= '3.6' -psycopg2-binary==2.9.5 +psutil==5.9.5 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +psycopg2==2.9.6 ; python_version >= '3.6' +psycopg2-binary==2.9.6 ptyprocess==0.7.0 pure-eval==0.2.2 pycodestyle==2.10.0 ; python_version >= '3.6' @@ -84,16 +85,16 @@ pydantic==1.10.7 pydocstyle==6.3.0 ; python_version >= '3.6' pyee==8.2.2 pyflakes==3.0.1 ; python_version >= '3.6' -pygments==2.14.0 ; python_version >= '3.6' +pygments==2.15.1 ; python_version >= '3.7' pyliftover==0.4 pyppeteer==1.0.2 ; python_version >= '3.7' and python_version < '4.0' pyquery==2.0.0 pyrsistent==0.19.3 ; python_version >= '3.7' -pysam==0.20.0 -pytest==7.2.2 +pysam==0.21.0 ; python_version >= '3.6' +pytest==7.3.1 pytest-asyncio==0.18.3 pytest-cov==4.0.0 -python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' python-jsonschema-objects==0.4.1 pytz==2023.3 pyyaml==6.0 ; python_version >= '3.6' @@ -102,19 +103,20 @@ requests==2.28.2 ; python_version >= '3.7' and python_version < '4' requests-html==0.10.0 ; python_full_version >= '3.6.0' s3transfer==0.6.0 ; python_version >= '3.7' setuptools==67.6.1 ; python_version >= '3.7' -six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' sniffio==1.3.0 ; python_version >= '3.7' snowballstemmer==2.2.0 -soupsieve==2.4 ; python_version >= '3.7' -sqlparse==0.4.3 ; python_version >= '3.5' +soupsieve==2.4.1 ; python_version >= '3.7' +sqlparse==0.4.4 ; python_version >= '3.5' stack-data==0.6.2 starlette==0.26.1 ; python_version >= '3.7' tabulate==0.9.0 ; python_version >= '3.7' tomli==2.0.1 ; python_version < '3.11' -tornado==6.2 ; python_version >= '3.7' +tornado==6.3 ; python_version >= '3.8' tqdm==4.65.0 ; python_version >= '3.7' traitlets==5.9.0 ; python_version >= '3.7' typing-extensions==4.5.0 ; python_version >= '3.7' +tzdata==2023.3 ; python_version >= '2' urllib3==1.26.15 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' uvicorn==0.21.1 virtualenv==20.21.0 ; python_version >= '3.7' diff --git a/requirements.txt b/requirements.txt index 5eaf8560..a12375e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,13 +5,13 @@ appdirs==1.4.4 appnope==0.1.3 ; sys_platform == 'darwin' asttokens==2.2.1 asyncpg==0.27.0 -attrs==22.2.0 ; python_version >= '3.6' +attrs==23.1.0 ; python_version >= '3.7' backcall==0.2.0 -beautifulsoup4==4.12.0 ; python_full_version >= '3.6.0' +beautifulsoup4==4.12.2 ; python_full_version >= '3.6.0' biocommons.seqrepo==0.6.5 bioutils==0.5.7 ; python_version >= '3.6' -boto3==1.26.103 -botocore==1.29.103 ; python_version >= '3.7' +boto3==1.26.115 +botocore==1.29.115 ; python_version >= '3.7' bs4==0.0.1 canonicaljson==2.0.0 ; python_version >= '3.7' certifi==2022.12.7 ; python_version >= '3.6' @@ -20,18 +20,19 @@ click==8.1.3 ; python_version >= '3.7' coloredlogs==15.0.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' configparser==5.3.0 ; python_version >= '3.7' cssselect==1.2.0 ; python_version >= '3.7' +cython==0.29.34 ; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2' decorator==5.1.1 ; python_version >= '3.5' executing==1.2.0 fake-useragent==1.1.3 -fastapi==0.95.0 +fastapi==0.95.1 ga4gh.vrs==0.9.0.dev0 ga4gh.vrsatile.pydantic==0.1.0.dev7 ; python_version >= '3.8' -gene-normalizer==0.2.8 +gene-normalizer==0.2.9 h11==0.14.0 ; python_version >= '3.7' hgvs==1.5.4 humanfriendly==10.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' idna==3.4 ; python_version >= '3.5' -importlib-metadata==6.1.0 ; python_version >= '3.7' +importlib-metadata==6.5.0 ; python_version >= '3.7' inflection==0.5.1 ; python_version >= '3.5' ipython==8.12.0 ; python_version >= '3.8' jedi==0.18.2 ; python_version >= '3.6' @@ -41,25 +42,25 @@ lxml==4.9.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, markdown==3.4.3 ; python_version >= '3.7' matplotlib-inline==0.1.6 ; python_version >= '3.5' numpy==1.24.2 ; python_version >= '3.8' -pandas==1.5.3 +pandas==2.0.0 parse==1.19.0 parsley==1.3 parso==0.8.3 ; python_version >= '3.6' pexpect==4.8.0 ; sys_platform != 'win32' pickleshare==0.7.5 prompt-toolkit==3.0.38 ; python_full_version >= '3.7.0' -psycopg2==2.9.5 ; python_version >= '3.6' +psycopg2==2.9.6 ; python_version >= '3.6' ptyprocess==0.7.0 pure-eval==0.2.2 pydantic==1.10.7 pyee==8.2.2 -pygments==2.14.0 ; python_version >= '3.6' +pygments==2.15.1 ; python_version >= '3.7' pyliftover==0.4 pyppeteer==1.0.2 ; python_version >= '3.7' and python_version < '4.0' pyquery==2.0.0 pyrsistent==0.19.3 ; python_version >= '3.7' -pysam==0.20.0 -python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +pysam==0.21.0 ; python_version >= '3.6' +python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' python-jsonschema-objects==0.4.1 pytz==2023.3 pyyaml==6.0 ; python_version >= '3.6' @@ -67,16 +68,17 @@ requests==2.28.2 ; python_version >= '3.7' and python_version < '4' requests-html==0.10.0 ; python_full_version >= '3.6.0' s3transfer==0.6.0 ; python_version >= '3.7' setuptools==67.6.1 ; python_version >= '3.7' -six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' sniffio==1.3.0 ; python_version >= '3.7' -soupsieve==2.4 ; python_version >= '3.7' -sqlparse==0.4.3 ; python_version >= '3.5' +soupsieve==2.4.1 ; python_version >= '3.7' +sqlparse==0.4.4 ; python_version >= '3.5' stack-data==0.6.2 starlette==0.26.1 ; python_version >= '3.7' tabulate==0.9.0 ; python_version >= '3.7' tqdm==4.65.0 ; python_version >= '3.7' traitlets==5.9.0 ; python_version >= '3.7' typing-extensions==4.5.0 ; python_version >= '3.7' +tzdata==2023.3 ; python_version >= '2' urllib3==1.26.15 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' uvicorn==0.21.1 w3lib==2.1.1 ; python_version >= '3.7' diff --git a/setup.cfg b/setup.cfg index 5a26ad00..55ca5061 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ install_requires = pydantic uvicorn fastapi - gene-normalizer + gene-normalizer >=0.1.34, != 0.2.0, != 0.2.1, != 0.2.2, != 0.2.3, != 0.2.4, != 0.2.5, != 0.2.6, != 0.2.7, != 0.2.8 ga4gh.vrs [options.package_data]