P-glycoprotein (MDR1) Substrate Profile Dashboard

DrugBank database
MolPort database
Python script number 34 to build the frequency distribution graph of the Pgp_substrate parameter on DrugBank molecules.
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
import numpy as np
from scipy.interpolate import make_interp_spline

# 1. P-gp Substrate Data
bin_centers = [0.0, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 
               0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95]

frequencies = [4.94, 11.89, 10.72, 7.61, 5.42, 5.70, 4.37, 6.03, 5.02, 
               6.39, 5.10, 4.94, 3.20, 3.28, 3.11, 3.68, 3.03, 2.83, 2.18, 0.57]

# 2. Smoothing
x_smooth = np.linspace(min(bin_centers), max(bin_centers), 300)
spl = make_interp_spline(bin_centers, frequencies, k=3)
y_smooth = spl(x_smooth)
y_smooth = [val if val > 0 else 0 for val in y_smooth] 

# 3. Colors
colors = []
for val in bin_centers:
    if val < 0.3:
        colors.append('mediumseagreen')
    elif val < 0.7:
        colors.append('gold')
    else:
        colors.append('darkorange')

# 4. Create the chart
plt.figure(figsize=(7, 6))

# Bars
plt.bar(bin_centers, frequencies, width=0.04, color=colors, edgecolor='black', alpha=0.8, label='Data Frequency')

# 5. Tags and Titles
plt.xlabel('Probability of being a P-gp Substrate', fontsize=12)
plt.ylabel('% Frequency', fontsize=12)
plt.title('P-glycoprotein (MDR1) Substrate Profile', fontsize=14)

# Axle settings
plt.xticks(np.arange(0.0, 1.05, 0.1))
plt.xlim(-0.05, 1.05)
plt.ylim(0, 14)

# 6. Vertical Legend
legend_elements = [
    Patch(facecolor='mediumseagreen', edgecolor='black', label='Non-Substrate (High CNS Permeability)'),
    Patch(facecolor='gold', edgecolor='black', label='Moderate Substrate'),
    Patch(facecolor='darkorange', edgecolor='black', label='Strong Substrate (Effluxed / Low CNS Entry)'),
]

plt.legend(handles=legend_elements, loc='upper right', framealpha=0.95, ncol=1, fontsize=10)

plt.grid(axis='y', linestyle='--', alpha=0.5)
plt.tight_layout()

plt.show()