diff --git a/chembl_downloading.py b/chembl_downloading.py index 6851eb7..35d6930 100644 --- a/chembl_downloading.py +++ b/chembl_downloading.py @@ -71,10 +71,10 @@ async def fetch_activities_async(self, session: aiohttp.ClientSession, target_id base_url = "https://www.ebi.ac.uk/chembl/api/data/activity.json" params = { - 'target_id__in': ','.join(target_ids), + 'target_chembl_id__in': ','.join(target_ids), 'assay_type__in': ','.join(assay_types), 'pchembl_value__isnull': 'false', - 'only': 'molecule_chembl_id,pchembl_value,target_id,bao_label' + 'only': 'molecule_chembl_id,pchembl_value,target_chembl_id,bao_label' } # First request to get total count and setup pagination @@ -208,7 +208,7 @@ async def fetch_all_protein_targets_async(self) -> List[str]: base_url = "https://www.ebi.ac.uk/chembl/api/data/target.json" params = { 'target_type': 'SINGLE PROTEIN', - 'only': 'target_id' + 'only': 'target_chembl_id' } async with await self.create_session() as session: @@ -377,4 +377,4 @@ def download_target(args): args = parser.parse_args() - download_target(args) \ No newline at end of file + download_target(args) diff --git a/data_processing.py b/data_processing.py index e288957..ffda517 100644 --- a/data_processing.py +++ b/data_processing.py @@ -451,7 +451,7 @@ def get_chembl_from_uniprot(uniprot_id: str) -> list: r = requests.get(url) r.raise_for_status() data = r.json().get('targets', []) - return [t['target_id'] for t in data] + return [t['target_chembl_id'] for t in data] # 6) Fetch inactive compounds for a ChEMBL target @@ -459,7 +459,7 @@ def fetch_inactive_compounds(chembl_target_id, pchembl_threshold) -> list: print("fetch_inactive_compounds started") url = "https://www.ebi.ac.uk/chembl/api/data/activity.json" params = { - 'target_id': chembl_target_id, + 'target_chembl_id': chembl_target_id, 'pchembl_value__lt': pchembl_threshold, 'limit': 10000 }