Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding endpoint for vrs-python translate_from method #250

Merged
merged 6 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ uvicorn = "*"
pydantic = "*"
uvloop = "*"
httptools = "*"
"ga4gh.vrs" = {version = ">=0.7.2", extras = ["extras"]}
"ga4gh.vrs" = {version = ">=0.7.4", extras = ["extras"]}
gene-normalizer = ">=0.1.23"
pyliftover = "*"
boto3 = "*"
Expand Down
80 changes: 39 additions & 41 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ backcall==0.2.0
beautifulsoup4==4.10.0; python_version >= '3.1'
biocommons.seqrepo==0.6.5
bioutils==0.5.5; python_version >= '3.6'
black==22.1.0; python_full_version >= '3.6.2'
bleach==4.1.0; python_version >= '3.6'
boto3==1.21.3
botocore==1.24.3; python_version >= '3.6'
boto3==1.21.12
botocore==1.24.12; python_version >= '3.6'
bs4==0.0.1
canonicaljson==1.5.0; python_version ~= '3.5'
certifi==2021.10.8
Expand All @@ -39,41 +38,41 @@ click==8.0.4; python_version >= '3.6'
colorama==0.4.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
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.2.0; python_version >= '3.6'
coverage==6.3.1
coverage==6.3.2
coveralls==3.3.1
cssselect==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
cycler==0.11.0; python_version >= '3.6'
debugpy==1.5.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
decorator==5.1.1; python_version >= '3.5'
decorator==5.1.1; python_full_version >= '3.5.0'
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
distlib==0.3.4
docopt==0.6.2
docutils==0.18.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
entrypoints==0.4; python_version >= '3.6'
executing==0.8.2
executing==0.8.3
fake-useragent==0.1.11
fastapi==0.74.0
filelock==3.6.0; python_version >= '3.7'
fastapi==0.74.1
filelock==3.6.0; python_full_version >= '3.7.0'
flake8-docstrings==1.6.0
flake8==4.0.1
fonttools==4.29.1; python_version >= '3.7'
fonttools==4.29.1; python_full_version >= '3.7.0'
frozendict==2.3.0; python_version >= '3.6'
ga4gh.vrs[extras]==0.7.2
ga4gh.vrs[extras]==0.7.4
ga4gh.vrsatile.pydantic==0.0.9
gene-normalizer==0.1.24
gffutils==0.10.1
h11==0.13.0; python_version >= '3.6'
hgvs==1.5.2
httptools==0.3.0
httptools==0.4.0
humanfriendly==10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
identify==2.4.10; python_version >= '3.7'
identify==2.4.11; python_full_version >= '3.7.0'
idna==3.3; python_version >= '3'
importlib-metadata==4.11.1; python_version < '3.10'
inflection==0.5.1; python_version >= '3.5'
importlib-metadata==4.11.2; python_version < '3.10'
inflection==0.5.1; python_full_version >= '3.5.0'
iniconfig==1.1.1
ipykernel==6.9.1
ipython-genutils==0.2.0
ipython==8.0.1; python_version >= '3.8'
ipython==8.1.1; python_version >= '3.8'
ipywidgets==7.6.5
jedi==0.18.1; python_version >= '3.6'
jinja2==3.0.3; python_version >= '3.6'
Expand All @@ -83,42 +82,41 @@ jsonschema==3.2.0
jupyter-client==7.1.2; python_full_version >= '3.6.1'
jupyter-console==6.4.0; python_version >= '3.6'
jupyter-core==4.9.2; python_version >= '3.6'
jupyter-server==1.13.5; python_version >= '3.7'
jupyter-server==1.13.5; python_full_version >= '3.7.0'
jupyter==1.0.0
jupyterlab-pygments==0.1.2
jupyterlab-server==2.10.3; python_version >= '3.6'
jupyterlab-widgets==1.0.2; python_version >= '3.6'
jupyterlab==3.2.9
keyring==23.5.0; python_version >= '3.7'
kiwisolver==1.3.2; python_version >= '3.7'
jupyterlab==3.3.0
keyring==23.5.0; python_full_version >= '3.7.0'
kiwisolver==1.3.2; python_full_version >= '3.7.0'
lxml==4.8.0
markdown==3.3.6; python_version >= '3.6'
markupsafe==2.1.0; python_version >= '3.7'
matplotlib-inline==0.1.3; python_version >= '3.5'
markupsafe==2.1.0; python_full_version >= '3.7.0'
matplotlib-inline==0.1.3; python_full_version >= '3.5.0'
matplotlib==3.5.1
mccabe==0.6.1
mistune==0.8.4
mypy-extensions==0.4.3
nbclassic==0.3.5; python_version >= '3.6'
nbclient==0.5.11; python_version >= '3.7'
nbconvert==6.4.2; python_version >= '3.7'
nbclassic==0.3.6; python_full_version >= '3.7.0'
nbclient==0.5.11; python_full_version >= '3.7.0'
nbconvert==6.4.2; python_full_version >= '3.7.0'
nbformat==5.1.3; python_version >= '3.5'
nest-asyncio==1.5.4; python_version >= '3.5'
nodeenv==1.6.0
notebook-shim==0.1.0; python_full_version >= '3.7.0'
notebook==6.4.8; python_version >= '3.6'
numpy==1.22.2; python_version < '3.10' and platform_machine != 'aarch64' and platform_machine != 'arm64'
numpy==1.22.2; python_version >= '3.8'
packaging==21.3; python_version >= '3.6'
pandas==1.4.1
pandocfilters==1.5.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
parse==1.19.0
parsley==1.3
parso==0.8.3; python_version >= '3.6'
pathspec==0.9.0
pexpect==4.8.0; sys_platform != 'win32'
pickleshare==0.7.5
pillow==9.0.1; python_version >= '3.7'
pillow==9.0.1; python_full_version >= '3.7.0'
pkginfo==1.8.2
platformdirs==2.5.1; python_version >= '3.7'
platformdirs==2.5.1; python_full_version >= '3.7.0'
pluggy==1.0.0; python_version >= '3.6'
pre-commit==2.17.0
prometheus-client==0.13.1; python_version >= '3.6'
Expand All @@ -135,7 +133,7 @@ pydocstyle==6.1.1; python_version >= '3.6'
pyee==8.2.2
pyfaidx==0.6.4
pyflakes==2.4.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pygments==2.11.2; python_version >= '3.5'
pygments==2.11.2; python_full_version >= '3.5.0'
pyliftover==0.4
pyparsing==3.0.7; python_version >= '3.6'
pyppeteer==1.0.2; python_version >= '3.7' and python_version < '4.0'
Expand All @@ -155,37 +153,37 @@ readme-renderer==32.0; python_version >= '3.6'
requests-html==0.10.0; python_version >= '3.6'
requests-toolbelt==0.9.1
requests==2.27.1
rfc3986==2.0.0; python_version >= '3.7'
s3transfer==0.5.1; python_version >= '3.6'
rfc3986==2.0.0; python_full_version >= '3.7.0'
s3transfer==0.5.2; python_version >= '3.6'
send2trash==1.8.0
setuptools==60.9.3; python_version >= '3.7'
simplejson==3.17.6; python_version >= '2.5' 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, 3.3'
sniffio==1.2.0; python_version >= '3.5'
sniffio==1.2.0; python_full_version >= '3.5.0'
snowballstemmer==2.2.0
soupsieve==2.3.1; python_version >= '3.6'
sqlparse==0.4.2; python_version >= '3.5'
sqlparse==0.4.2; python_full_version >= '3.5.0'
stack-data==0.2.0
starlette==0.17.1; python_version >= '3.6'
tabulate==0.8.9
terminado==0.13.1; python_version >= '3.7'
testpath==0.5.0; python_version >= '3.5'
terminado==0.13.2; python_full_version >= '3.7.0'
testpath==0.6.0; python_version >= '3.5'
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
tomli==2.0.1; python_version >= '3.7'
tomli==2.0.1; python_full_version >= '3.7.0'
tornado==6.1; python_version >= '3.5'
tqdm==4.62.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
tqdm==4.63.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
traitlets==5.1.1; python_version >= '3.7'
twine==3.8.0
typing-extensions==4.1.1
urllib3==1.26.8; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'
uvicorn==0.17.5
uvloop==0.16.0
virtualenv==20.13.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
virtualenv==20.13.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
w3lib==1.22.0
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.2.3; python_version >= '3.6'
websockets==10.1
websocket-client==1.3.1; python_version >= '3.6'
websockets==10.2
widgetsnbextension==3.5.2
yoyo-migrations==7.3.2
zipp==3.7.0; python_version >= '3.7'
41 changes: 18 additions & 23 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ backcall==0.2.0
beautifulsoup4==4.10.0; python_version >= '3.1'
biocommons.seqrepo==0.6.5
bioutils==0.5.5; python_version >= '3.6'
black==22.1.0; python_full_version >= '3.6.2'
boto3==1.21.3
botocore==1.24.3; python_version >= '3.6'
boto3==1.21.12
botocore==1.24.12; python_version >= '3.6'
bs4==0.0.1
canonicaljson==1.5.0; python_version ~= '3.5'
certifi==2021.10.8
Expand All @@ -29,47 +28,44 @@ click==8.0.4; python_version >= '3.6'
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.2.0; python_version >= '3.6'
cssselect==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
decorator==5.1.1; python_version >= '3.5'
executing==0.8.2
decorator==5.1.1; python_full_version >= '3.5.0'
executing==0.8.3
fake-useragent==0.1.11
fastapi==0.74.0
fastapi==0.74.1
frozendict==2.3.0; python_version >= '3.6'
ga4gh.vrs[extras]==0.7.2
ga4gh.vrs[extras]==0.7.4
ga4gh.vrsatile.pydantic==0.0.9
gene-normalizer==0.1.24
gffutils==0.10.1
h11==0.13.0; python_version >= '3.6'
hgvs==1.5.2
httptools==0.3.0
httptools==0.4.0
humanfriendly==10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
idna==3.3; python_version >= '3'
importlib-metadata==4.11.1; python_version < '3.10'
inflection==0.5.1; python_version >= '3.5'
ipython==8.0.1; python_version >= '3.8'
importlib-metadata==4.11.2; python_version < '3.10'
inflection==0.5.1; python_full_version >= '3.5.0'
ipython==8.1.1; python_version >= '3.8'
jedi==0.18.1; python_version >= '3.6'
jmespath==0.10.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
jsonschema==3.2.0
lxml==4.8.0
markdown==3.3.6; python_version >= '3.6'
matplotlib-inline==0.1.3; python_version >= '3.5'
mypy-extensions==0.4.3
numpy==1.22.2; python_version < '3.10' and platform_machine != 'aarch64' and platform_machine != 'arm64'
matplotlib-inline==0.1.3; python_full_version >= '3.5.0'
numpy==1.22.2; python_version >= '3.8'
pandas==1.4.1
parse==1.19.0
parsley==1.3
parso==0.8.3; python_version >= '3.6'
pathspec==0.9.0
pexpect==4.8.0; sys_platform != 'win32'
pickleshare==0.7.5
platformdirs==2.5.1; python_version >= '3.7'
prompt-toolkit==3.0.28; python_full_version >= '3.6.2'
psycopg2==2.9.3; python_version >= '3.6'
ptyprocess==0.7.0
pure-eval==0.2.2
pydantic==1.9.0
pyee==8.2.2
pyfaidx==0.6.4
pygments==2.11.2; python_version >= '3.5'
pygments==2.11.2; python_full_version >= '3.5.0'
pyliftover==0.4
pyppeteer==1.0.2; python_version >= '3.7' and python_version < '4.0'
pyquery==1.4.3
Expand All @@ -81,25 +77,24 @@ pytz==2021.3
pyyaml==6.0; python_version >= '3.6'
requests-html==0.10.0; python_version >= '3.6'
requests==2.27.1
s3transfer==0.5.1; python_version >= '3.6'
s3transfer==0.5.2; python_version >= '3.6'
setuptools==60.9.3; python_version >= '3.7'
simplejson==3.17.6; python_version >= '2.5' 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, 3.3'
sniffio==1.2.0; python_version >= '3.5'
sniffio==1.2.0; python_full_version >= '3.5.0'
soupsieve==2.3.1; python_version >= '3.6'
sqlparse==0.4.2; python_version >= '3.5'
sqlparse==0.4.2; python_full_version >= '3.5.0'
stack-data==0.2.0
starlette==0.17.1; python_version >= '3.6'
tabulate==0.8.9
tomli==2.0.1; python_version >= '3.7'
tqdm==4.62.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
tqdm==4.63.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
traitlets==5.1.1; python_version >= '3.7'
typing-extensions==4.1.1
urllib3==1.26.8; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'
uvicorn==0.17.5
uvloop==0.16.0
w3lib==1.22.0
wcwidth==0.2.5
websockets==10.1
websockets==10.2
yoyo-migrations==7.3.2
zipp==3.7.0; python_version >= '3.7'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install_requires =
fastapi >= 0.72.0
uvicorn
pydantic
ga4gh.vrs[extras] >= 0.7.2
ga4gh.vrs[extras] >= 0.7.4
gene-normalizer >= 0.1.23
pyliftover
boto3
Expand Down
19 changes: 12 additions & 7 deletions variation/data_sources/uta.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def _update_db_url(self, db_pwd, db_url) -> Optional[str]:
else:
if uta_password_in_environ and not db_pwd:
db_pwd = environ['UTA_PASSWORD']
return f"{db_url[0]}:{db_pwd}@{db_url[1]}"
uta_db_url = f"{db_url[0]}:{db_pwd}@{db_url[1]}"
environ["UTA_DB_URL"] = uta_db_url
return uta_db_url

def _get_conn_args(self, is_prod, db_pwd, db_url) -> Dict:
"""Return connection arguments.
Expand All @@ -82,14 +84,17 @@ def _get_conn_args(self, is_prod, db_pwd, db_url) -> Dict:
self.schema = environ['UTA_SCHEMA']
region = 'us-east-2'
client = boto3.client('rds', region_name=region)
host = environ['UTA_HOST']
port = environ['UTA_PORT']
user = environ['UTA_USER']
db = environ['UTA_DATABASE']
token = client.generate_db_auth_token(
DBHostname=environ['UTA_HOST'], Port=environ['UTA_PORT'],
DBUsername=environ['UTA_USER'], Region=region
DBHostname=host, Port=port, DBUsername=user, Region=region
)
return self._get_args(environ['UTA_HOST'],
int(environ['UTA_PORT']),
environ['UTA_DATABASE'], environ['UTA_USER'],
token)
# TODO: Resolve in issue-252
# environ['UTA_DB_URL'] = \
# f"postgresql://{user}:{token}@{host}/{db}/{self.schema}"
return self._get_args(host, int(port), db, user, token)

def _url_encode_password(self, db_url) -> str:
"""Update DB URL to url encode password.
Expand Down
Loading