Temporal Trends and Compound Journeys

Abhik Seal
4 min readApr 7, 2023

--

Inspired by the moving targets publication and the app on @ https://rguha.shinyapps.io/MovingTargets/ i am sharing this post to visualize moving compounds over the years and try to see how many times the targets are tested over the years for a specific compound . Compound journey maps can be beneficial in the drug discovery process by providing a visual representation of the historical progression of a specific compound’s research. They help researchers understand various aspects of a compound’s development, such as its assay types, target interactions, and the years in which these activities were documented.

I only consider active compounds, so I took a cut off 1uM and extracted all the targets data and over the years . These types of analysis can drive insights about your compound and also the range of protein families. Often done in Pharma Industry to track not only targets but also ADME assays and other PK/PD studies. Lets see how can we do it. I am using ChEMBL web client and looking for Imatinib with the query already built by filter function.

import datetime
import matplotlib.pyplot as plt
from chembl_webresource_client.new_client import new_client

# Replace 'CHEMBL_ID' with the ChEMBL ID of the compound you want to analyze
compound_id = 'CHEMBL941'

# Get compound details
compound = new_client.molecule.get(compound_id)

# Get compound's assays and targets
micromolar_cutoff = 10
nanomolar_cutoff = micromolar_cutoff * 1000
activities = new_client.activity.filter(molecule_chembl_id=compound_id, standard_units='nM', standard_value__lt=nanomolar_cutoff).only(['assay_chembl_id', 'assay_type', 'document_chembl_id', 'target_chembl_id'])

#activities = new_client.activity.filter(molecule_chembl_id=compound_id).only(['assay_chembl_id', 'assay_type', 'document_chembl_id', 'target_chembl_id'])

# Prepare data for the journey map
compound_map_data = {}
target_names = {}

for activity in activities:
document = new_client.document.get(activity['document_chembl_id'])
document_year = datetime.datetime.strptime(str(document['year']), '%Y') if document['year'] else None

if document_year:
key = (activity['assay_type'], activity['target_chembl_id'], document_year)
compound_map_data[key] = {
'assay_type': activity['assay_type'],
'document_year': document_year,
'target_chembl_id': activity['target_chembl_id'],
}

if activity['target_chembl_id'] not in target_names:
target = new_client.target.get(activity['target_chembl_id'])
target_names[activity['target_chembl_id']] = target['pref_name']

# Sort data by document year
compound_map_data = list(compound_map_data.values())
compound_map_data.sort(key=lambda x: x['document_year'])

Next I plot the map with the timeline

# Plot the compound journey map
fig, ax = plt.subplots(figsize=(20, 15))
ax.set_title(f"Compound Journey Map: {compound['pref_name']} (ChEMBL ID: {compound_id})")

years = [entry['document_year'] for entry in journey_map_data]
assay_types = [entry['assay_type'] for entry in journey_map_data]
target_ids = [entry['target_chembl_id'] for entry in journey_map_data]
target_names_list = [target_names[target_id] for target_id in target_ids]

# Convert target names list to categorical data
unique_target_names = list(set(target_names_list))
y_positions = [unique_target_names.index(target_name) for target_name in target_names_list]

ax.plot(years, y_positions, 'o-', label='Target')
ax.set_xlabel('Document Year')
ax.set_ylabel('Target Name')

# Set y-axis ticks and labels
ax.set_yticks(range(len(unique_target_names)))
ax.set_yticklabels(unique_target_names)

ax.legend()
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
Imatinib Map

Now let’s check how many times imatinib is tested showing activity less than 1um and in what targets

from collections import defaultdict, Counter

# Create a dictionary with years as keys and a list of target names for each year as values
targets_by_year = defaultdict(list)
for entry in journey_map_data:
document_year = entry['document_year'].year
target_name = target_names[entry['target_chembl_id']]
targets_by_year[document_year].append(target_name)

# Count the occurrences of each target name
target_counts = Counter()
for target_list in targets_by_year.values():
target_counts.update(target_list)

# Find the most frequent targets
most_frequent_targets = target_counts.most_common()


# Print the most frequent targets
print("Most frequently tested targets:")
for target, count in most_frequent_targets:
print(f"{target}: {count} times")
Tyrosine-protein kinase ABL: 19 times
Stem cell growth factor receptor: 17 times
K562: 16 times
Bcr/Abl fusion protein: 13 times
Unchecked: 11 times
Platelet-derived growth factor receptor beta: 10 times
Platelet-derived growth factor receptor alpha: 9 times
NON-PROTEIN TARGET: 9 times
Epithelial discoidin domain-containing receptor 1: 7 times
Macrophage colony stimulating factor receptor: 6 times
Tyrosine-protein kinase ABL2: 6 times
Tyrosine-protein kinase LCK: 6 times
Discoidin domain-containing receptor 2: 6 times
Platelet-derived growth factor receptor: 4 times
Dual specificity protein kinase CLK4: 4 times
ATP-binding cassette sub-family G member 2: 3 times
Tyrosine-protein kinase FRK: 3 times
Serine/threonine-protein kinase 17A: 3 times
c-Jun N-terminal kinase 3: 3 times
Ephrin type-A receptor 8: 3 times
Serine/threonine-protein kinase GAK: 3 times
Tyrosine-protein kinase FYN: 3 times
Serine/threonine-protein kinase PLK4: 3 times
Dual specificty protein kinase CLK1: 3 times

The list goes on ….

One can create a bar chart showing the number of activities for each target over the years. This visualization will help you better understand the trends in target research over time.

Researchers can gain insights into several areas

  1. Target identification:This can help researchers understand the primary targets of a compound and identify potential off-target effects.
  2. Temporal trends: helping researchers understand how the compound’s research has evolved and potentially identify gaps or emerging areas of interest.
  3. Comparison between compounds: Journey maps can be used to compare multiple compounds in terms of their target interactions and development progress. This can assist researchers in identifying the most promising candidates for further investigation.
  4. Design of Knowledge graphs with better knowledge .

--

--

Abhik Seal
Abhik Seal

Written by Abhik Seal

Data Science / Cheminformatician x-AbbVie , I try to make complicated things looks easier and understandable www.linkedin.com/in/abseal/

No responses yet