Skip to content

Commit

Permalink
Merge pull request #90 from loucerac/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
loucerac authored Aug 23, 2024
2 parents f9bac0c + 5d40091 commit a88629b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
16 changes: 2 additions & 14 deletions drexml/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,9 @@ def load_disgenet():
Disgenet curated dataset of gene-disease associations.
"""

url = "/".join(
[
"https:/",
"www.disgenet.org",
"static",
"disgenet_ap1",
"files",
"downloads",
"curated_gene_disease_associations.tsv.gz",
]
)
fpath = get_resource_path("curated_gene_disease_associations.tsv.gz")

disgenet: pd.DataFrame = pystow.ensure_csv(
"drexml", "datasets", url=url, read_csv_kwargs={"sep": "\t"}
)
disgenet: pd.DataFrame = pd.read_csv(fpath, sep="\t")

disgenet = disgenet.rename(
columns={
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"pystow>=0.5.0",
]
name = "drexml"
version = "1.1.2"
version = "1.1.3"
description = "(DRExM³L) Drug REpurposing using and eXplainable Machine Learning and Mechanistic Models of signal transduction\""
readme = "README.md"

Expand Down
16 changes: 15 additions & 1 deletion tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from pandas.errors import ParserError

from drexml.datasets import get_disease_data, load_df
from drexml.datasets import get_disease_data, load_df, load_disgenet

from .test_utils import make_disease_config

Expand Down Expand Up @@ -63,3 +63,17 @@ def test_load_df_fails_feather():
_, tmp_file = mkstemp()
pd.DataFrame().reset_index(names="vader").to_feather(tmp_file)
load_df(tmp_file)


def test_load_disgenet():
"""Unit test load_disgenet."""

disgenet = load_disgenet()

assert disgenet.shape[0] > 0
assert all(
[
x in ["disease_name", "disease_id", "entrez_id", "dga_score"]
for x in disgenet.columns
]
)

0 comments on commit a88629b

Please sign in to comment.