From 10b0412c61660bc73ada8cac41993dfc3f8413ee Mon Sep 17 00:00:00 2001 From: Alejandro Velez Date: Sat, 11 Jan 2025 07:44:34 -0500 Subject: [PATCH] remove some dependencies --- requirements.txt | 2 -- tdc/test/test_model_server.py | 60 ----------------------------------- tdc/utils/__init__.py | 3 -- tdc/version.py | 2 +- 4 files changed, 1 insertion(+), 66 deletions(-) diff --git a/requirements.txt b/requirements.txt index 63cb8584..8004b31a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,6 @@ datasets<2.20.0 evaluate==0.4.2 fuzzywuzzy>=0.18.0,<1.0 huggingface_hub>=0.20.3,<1.0 -moleculeace==3.0.0 -mygene>=3.2.2,<4.0.0 numpy>=1.26.4,<2.0.0 openpyxl>=3.0.10,<4.0.0 pandas>=2.1.4,<3.0.0 diff --git a/tdc/test/test_model_server.py b/tdc/test/test_model_server.py index d17ac64b..31cc48de 100644 --- a/tdc/test/test_model_server.py +++ b/tdc/test/test_model_server.py @@ -5,8 +5,6 @@ import unittest import shutil -import pytest -import mygene import numpy as np # temporary solution for relative imports in case TDC is not installed @@ -21,64 +19,6 @@ import requests -def get_ensembl_id(gene_symbols): - mg = mygene.MyGeneInfo() - return mg.querymany(gene_symbols, - scopes='symbol', - fields='ensembl.gene', - species='human') - - -def get_target_from_chembl(chembl_id): - # Query ChEMBL API for target information - chembl_url = f"https://www.ebi.ac.uk/chembl/api/data/{chembl_id}.json" - response = requests.get(chembl_url) - - if response.status_code == 200: - data = response.json() - # Extract UniProt ID from the ChEMBL target info - for component in data.get('target_components', []): - for xref in component.get('target_component_xrefs', []): - if xref['xref_src_db'] == 'UniProt': - return xref['xref_id'] - else: - raise ValueError(f"ChEMBL ID {chembl_id} not found or invalid.") - return None - - -def get_ensembl_from_uniprot(uniprot_id): - # Query UniProt API to get Ensembl ID from UniProt ID - uniprot_url = f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.json" - response = requests.get(uniprot_url) - - if response.status_code == 200: - data = response.json() - # Extract Ensembl Gene ID from the cross-references - for xref in data.get('dbReferences', []): - if xref['type'] == 'Ensembl': - return xref['id'] - else: - raise ValueError(f"UniProt ID {uniprot_id} not found or invalid.") - return None - - -def get_ensembl_id_from_chembl_id(chembl_id): - try: - # Step 1: Get UniProt ID from ChEMBL - uniprot_id = get_target_from_chembl(chembl_id) - if not uniprot_id: - return f"No UniProt ID found for ChEMBL ID {chembl_id}" - - # Step 2: Get Ensembl ID from UniProt - ensembl_id = get_ensembl_from_uniprot(uniprot_id) - if not ensembl_id: - return f"No Ensembl ID found for UniProt ID {uniprot_id}" - - return f"Ensembl ID for ChEMBL ID {chembl_id}: {ensembl_id}" - except Exception as e: - return str(e) - - def quant_layers(model): layer_nums = [] for name, parameter in model.named_parameters(): diff --git a/tdc/utils/__init__.py b/tdc/utils/__init__.py index 8c4a2fec..6edc5aa0 100644 --- a/tdc/utils/__init__.py +++ b/tdc/utils/__init__.py @@ -47,6 +47,3 @@ retrieve_benchmark_names, ) from .query import uniprot2seq, cid2smiles - -from ..feature_generators.data_feature_generator import DataFeatureGenerator -from ..feature_generators.protein_feature_generator import ProteinFeatureGenerator \ No newline at end of file diff --git a/tdc/version.py b/tdc/version.py index 09a840f7..e69a065f 100644 --- a/tdc/version.py +++ b/tdc/version.py @@ -19,4 +19,4 @@ # Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer. # 'X.Y.dev0' is the canonical version of 'X.Y.dev' # -__version__ = "1.1.4" # pragma: no cover +__version__ = "1.1.5" # pragma: no cover