Skip to content

Commit

Permalink
Merge branch 'master' into features/beacon-network
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfk committed Aug 12, 2024
2 parents 8b320d7 + 9b1ffe6 commit 901e1f1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Install black
run: python -m pip install black
- name: Run linter
run: black --check --line-length=120 ./bento_beacon
run: black --check --line-length=120 ./bento_beacon
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.06.01

SHELL ["/bin/bash", "-c"]

Expand Down
4 changes: 2 additions & 2 deletions bento_beacon/config_files/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class Config:
KATSU_DISEASES_TERMS_ENDPOINT = "/api/disease_term_autocomplete"
KATSU_SAMPLED_TISSUES_TERMS_ENDPOINT = "/api/biosample_sampled_tissue_autocomplete"
KATSU_PUBLIC_CONFIG_ENDPOINT = "/api/public_search_fields"
KATSU_INDIVIDUAL_SCHEMA_ENDPOINT = "/api/chord_phenopacket_schema"
KATSU_EXPERIMENT_SCHEMA_ENDPOINT = "/api/experiment_schema"
KATSU_INDIVIDUAL_SCHEMA_ENDPOINT = "/api/schemas/phenopacket"
KATSU_EXPERIMENT_SCHEMA_ENDPOINT = "/api/schemas/experiment"
KATSU_BEACON_SEARCH = "/api/beacon_search"
KATSU_SEARCH_OVERVIEW = "/api/search_overview"
KATSU_PRIVATE_OVERVIEW = "/api/overview"
Expand Down
2 changes: 1 addition & 1 deletion bento_beacon/endpoints/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def build_ga4gh_service_info():
"name": info["name"],
"type": {"artifact": "Beacon v2", "group": "org.ga4gh", "version": info["apiVersion"]},
"environment": info["environment"],
"organization": {"name": info["organization"]["name"], "url": info["organization"]["welcomeUrl"]},
"organization": {"name": info["organization"]["name"], "url": info["organization"].get("welcomeUrl", "")},
"contactUrl": info["organization"]["contactUrl"],
"version": info["version"],
"bento": {"serviceKind": "beacon"},
Expand Down
6 changes: 6 additions & 0 deletions bento_beacon/utils/search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from flask import current_app
from functools import reduce
from .gohan_utils import query_gohan
from .katsu_utils import katsu_filters_query, search_from_config, biosample_ids_for_individuals
from .beacon_response import add_info_to_response


# TODO: search by linked field set elements instead of hardcoding
Expand All @@ -11,6 +13,10 @@ def biosample_id_search(variants_query=None, phenopacket_filters=None, experimen
return []

if variants_query:
if not current_app.config["BEACON_CONFIG"].get("useGohan"):
# variants query even though there are no variants in this beacon, this can happen in a network context
add_info_to_response("No variants available at this beacon, query by metadata values only")
return []
variant_sample_ids = query_gohan(variants_query, "count", ids_only=True)
if not variant_sample_ids:
return []
Expand Down
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.06.01

LABEL org.opencontainers.image.description="Local development image for the Bento Beacon service."
LABEL devcontainer.metadata='[{ \
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ async-timeout==4.0.3
attrs==22.2.0
autopep8==1.6.0
bento-lib==10.1.1
certifi==2024.2.2
certifi==2024.7.4
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.7
cryptography==42.0.5
cryptography==42.0.8
flake8==6.1.0
Flask==2.2.5
Flask-Cors==4.0.1
Expand Down Expand Up @@ -45,8 +45,8 @@ six==1.16.0
toml==0.10.2
typing_extensions==4.8.0
uri-template==1.2.0
urllib3==1.26.18
urllib3==1.26.19
webcolors==1.12
Werkzeug==2.2.3
yarl==1.9.3
zipp==3.17.0
zipp==3.19.1

0 comments on commit 901e1f1

Please sign in to comment.