Skip to content

Commit

Permalink
Merge pull request #65 from TheJacksonLaboratory/G3-247-update-genese…
Browse files Browse the repository at this point in the history
…t-get-endpoint-to-include-ontology-term-filter

Adding the ontology term filter to genesets
  • Loading branch information
bergsalex authored May 14, 2024
2 parents ae14bc6 + 1301292 commit f76abb9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
19 changes: 15 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "geneweaver-api"
version = "0.5.0"
version = "0.6.0a0"
description = "The Geneweaver API"
authors = [
"Alexander Berger <[email protected]>",
Expand All @@ -20,7 +20,7 @@ python = "^3.9"
geneweaver-core = "^0.9.1"
fastapi = {extras = ["all"], version = "^0.99.1"}
uvicorn = {extras = ["standard"], version = "^0.24.0"}
geneweaver-db = "^0.3.8"
geneweaver-db = "0.4.0a1"
psycopg-pool = "^3.1.7"
requests = "^2.31.0"
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
Expand Down
2 changes: 2 additions & 0 deletions src/geneweaver/api/controller/genesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def get_visible_genesets(
),
] = None,
gene_id_type: Optional[GeneIdentifier] = None,
ontology_term: Optional[str] = None,
search_text: Annotated[
Optional[str], Query(description=api_message.SEARCH_TEXT)
] = None,
Expand Down Expand Up @@ -102,6 +103,7 @@ def get_visible_genesets(
gene_id_type=gene_id_type,
search_text=search_text,
with_publication_info=with_publication_info,
ontology_term=ontology_term,
only_my_genesets=only_my_genesets,
limit=limit,
offset=offset,
Expand Down
5 changes: 5 additions & 0 deletions src/geneweaver/api/services/geneset.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ def get_visible_genesets(
pubmed_id: Optional[int] = None,
gene_id_type: Optional[GeneIdentifier] = None,
search_text: Optional[str] = None,
ontology_term: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
with_publication_info: bool = True,
) -> dict:
"""Get genesets from the database.
:param cursor: A database cursor.
:param user: The user requesting the genesets.
:param gs_id: Show only results with this geneset ID.
:param only_my_genesets: Show only results owned by the user.
:param curation_tier: Show only results of this curation tier.
:param species: Show only results associated with this species.
:param name: Show only results with this name.
Expand All @@ -44,6 +47,7 @@ def get_visible_genesets(
:param gene_id_type: Show only results with this gene ID type.
:param search_text: Return genesets that match this search text (using PostgreSQL
full-text search).
:param ontology_term: Show only results associated with this ontology term.
:param limit: Limit the number of results.
:param offset: Offset the results.
:param with_publication_info: Include publication info in the return.
Expand All @@ -70,6 +74,7 @@ def get_visible_genesets(
gene_id_type=gene_id_type,
search_text=search_text,
with_publication_info=with_publication_info,
ontology_term=ontology_term,
limit=limit,
offset=offset,
)
Expand Down

0 comments on commit f76abb9

Please sign in to comment.