From c0d27c25b55c60009afc844b1d25b0ec1710ba56 Mon Sep 17 00:00:00 2001 From: Alejandro Velez Date: Thu, 2 Jan 2025 19:24:43 -0500 Subject: [PATCH] pharmone --- environment.yml | 2 +- requirements.txt | 2 +- tdc/resource/pharmone.py | 50 +++++++++++++------------------------- tdc/test/test_resources.py | 10 ++++---- 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/environment.yml b/environment.yml index 3ad15edf..d0ea8beb 100644 --- a/environment.yml +++ b/environment.yml @@ -22,7 +22,7 @@ dependencies: - pip: - accelerate==0.33.0 - cellxgene-census==1.15.0 - - datasets==2.20.0 + - datasets<2.20.0 - dgl==1.1.3 - evaluate==0.4.2 - gget==0.28.4 diff --git a/requirements.txt b/requirements.txt index 61adc449..63cb8584 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ accelerate==0.33.0 biopython>=1.78,<2.0 dataclasses>=0.6,<1.0 -datasets==2.20.0 +datasets<2.20.0 evaluate==0.4.2 fuzzywuzzy>=0.18.0,<1.0 huggingface_hub>=0.20.3,<1.0 diff --git a/tdc/resource/pharmone.py b/tdc/resource/pharmone.py index 68806856..72325712 100644 --- a/tdc/resource/pharmone.py +++ b/tdc/resource/pharmone.py @@ -1,45 +1,29 @@ -from ..utils.load import download_wrapper - +from ..utils import general_load """ Resource class for the Eve Bio (https://evebio.org/) Pharmone Map. """ + class PharmoneMap(object): - + def __init__(self, path="./data"): self.path = path - + def get_data(self): - return download_wrapper( - 'evebio_pharmone_v1_detailed_result_table', - self.path, - 'evebio_pharmone_v1_detailed_result_table' - ) # Load the Pharmone Map data - + return general_load('evebio_pharmone_v1_detailed_result_table', + self.path, '\t') # Load the Pharmone Map data + def get_obs_metadata(self): - return download_wrapper( - "evebio_pharmone_v1_observed_points_table", - self.path, - "evebio_pharmone_v1_observed_points_table" - ) - + return general_load("evebio_pharmone_v1_observed_points_table", + self.path, "\t") + def get_control_data(self): - return download_wrapper( - "evebio_pharmone_v1_control_table", - self.path, - "evebio_pharmone_v1_control_table" - ) # Load the control data - + return general_load("evebio_pharmone_v1_control_table", self.path, + "\t") # Load the control data + def get_compound_data(self): - return download_wrapper( - "evebio_pharmone_v1_compound_table", - self.path, - "evebio_pharmone_v1_compound_table" - ) - + return general_load("evebio_pharmone_v1_compound_table", self.path, + "\t") + def get_target_data(self): - return download_wrapper( - "evebio_pharmone_v1_target_table", - self.path, - "evebio_pharmone_v1_target_table" - ) \ No newline at end of file + return general_load("evebio_pharmone_v1_target_table", self.path, "\t") diff --git a/tdc/test/test_resources.py b/tdc/test/test_resources.py index 7c8a6673..42173ccc 100644 --- a/tdc/test/test_resources.py +++ b/tdc/test/test_resources.py @@ -125,23 +125,23 @@ def tearDown(self): except: pass + class TestPharmoneMap(unittest.TestCase): def setUp(self): print(os.getcwd()) pass - + def test_get_data(self): from tdc.resource.pharmone import PharmoneMap - + resource = PharmoneMap() data = resource.get_data() - assert data - assert isinstance(data, DataFrame) + assert isinstance(data, DataFrame), type(data) assert "Compound" in data.columns assert "Target_ID" in data.columns assert "pXC50" in data.columns - + def tearDown(self): try: print(os.getcwd())