Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions chembl_downloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -377,4 +377,4 @@ def download_target(args):

args = parser.parse_args()

download_target(args)
download_target(args)
4 changes: 2 additions & 2 deletions data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,15 @@ 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

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
}
Expand Down