Skip to content

Commit

Permalink
update to released 0.5.19 of oaklib, update model, format
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Sep 22, 2023
1 parent 870fa00 commit f555c95
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 54 deletions.
88 changes: 44 additions & 44 deletions backend/poetry.lock

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

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pystow = ">=0.5.0"
loguru = "*"
### Optional API dependencies
fastapi ={ version = "^0.87.0", optional = true }
oaklib = "0.5.19rc-1"
oaklib = "0.5.19"


[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion backend/src/monarch_py/api/semsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _post_compare(
def _search(
subjects: str = Query(...),
target_group: SemsimSearchCategory = Query(...),
limit: int = Query(default=10, ge=1, le=500)
limit: int = Query(default=10, ge=1, le=500),
):
"""
Search for genes or diseases by phenotype similarity<br>
Expand Down
18 changes: 10 additions & 8 deletions backend/src/monarch_py/implementations/oak/oak_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def init_semsim(self, phenio_path: str = None, force_update: bool = False):
self.semsim = get_adapter(f"semsimian:sqlite:{phenio_path}")
else:
monarchstow = pystow.module("monarch")
with monarchstow.ensure_gunzip("phenio",
url=self.default_phenio_db_url,
force=force_update) as stowed_phenio_path:
with monarchstow.ensure_gunzip(
"phenio", url=self.default_phenio_db_url, force=force_update
) as stowed_phenio_path:
self.semsim = get_adapter(f"semsimian:sqlite:{stowed_phenio_path}")

# run a query to get the adapter to initialize properly
Expand Down Expand Up @@ -76,11 +76,13 @@ def compare(
response_dict = self.json_dumper.to_dict(response)
return TermSetPairwiseSimilarity(**response_dict)

def search(self,
objects: List[str],
target_groups: List[SemsimSearchCategory] = None,
predicates: List[str] = None,
limit: int = 10):
def search(
self,
objects: List[str],
target_groups: List[SemsimSearchCategory] = None,
predicates: List[str] = None,
limit: int = 10,
):
predicates = predicates or self.default_predicates
return self.semsim.associations_subject_search(
predicates={"biolink:has_phenotype"},
Expand Down

0 comments on commit f555c95

Please sign in to comment.