Skip to content

Commit

Permalink
pharmone
Browse files Browse the repository at this point in the history
  • Loading branch information
amva13 committed Jan 3, 2025
1 parent e42aea1 commit c0d27c2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 40 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
50 changes: 17 additions & 33 deletions tdc/resource/pharmone.py
Original file line number Diff line number Diff line change
@@ -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"
)
return general_load("evebio_pharmone_v1_target_table", self.path, "\t")
10 changes: 5 additions & 5 deletions tdc/test/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit c0d27c2

Please sign in to comment.