-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zethson <lukas.heumos@posteo.net>
- Loading branch information
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
from pathlib import Path | ||
|
||
import bionty.base as bt_base | ||
from bionty.base.dev._io import s3_bionty_assets | ||
|
||
|
||
def test_ontology(): | ||
localpath = s3_bionty_assets("ontology_all__pw__7.79__Pathway") | ||
onto = bt_base.Ontology(localpath) | ||
assert onto.get_term("PW:0000014").name == "neurodegenerative pathway" | ||
df = onto.to_df(source="pw", include_id_prefixes={"pw": ["PW"]}) | ||
assert df.shape == (2647, 4) | ||
assert df.index.name == "ontology_id" | ||
|
||
try: | ||
onto = bt_base.Ontology(localpath) | ||
assert onto.get_term("PW:0000014").name == "neurodegenerative pathway" | ||
|
||
df = onto.to_df(source="pw", include_id_prefixes={"pw": ["PW"]}) | ||
assert df.shape == (2647, 4) | ||
assert df.index.name == "ontology_id" | ||
|
||
finally: | ||
if Path(localpath).exists: | ||
Path(localpath).unlink() |