Skip to content
Snippets Groups Projects
Commit 2cea55a3 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

make molprobity promod3/modeller comparison plots quadratic

parent d62287c2
No related branches found
No related tags found
No related merge requests found
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import json import json
import numpy as np import numpy as np
import math
promod_label = 'ProMod3' promod_label = 'ProMod3'
...@@ -41,8 +42,6 @@ for key in promod_data: ...@@ -41,8 +42,6 @@ for key in promod_data:
probity_diffs.append(probity_values_promod[-1] - probity_values_modeller[-1]) probity_diffs.append(probity_values_promod[-1] - probity_values_modeller[-1])
keys.append(key) keys.append(key)
for a,b in zip(keys, lddt_diffs):
print(a,b)
# plot both in the same plot # plot both in the same plot
xs = np.linspace(-7.0, 7.0, 300) xs = np.linspace(-7.0, 7.0, 300)
n_lddt, bins_lddt, patches_lddt = plt.hist(lddt_diffs, 50, range=(-7.0,7.0), n_lddt, bins_lddt, patches_lddt = plt.hist(lddt_diffs, 50, range=(-7.0,7.0),
...@@ -79,49 +78,62 @@ for key in promod_data: ...@@ -79,49 +78,62 @@ for key in promod_data:
probity_ramachandran_outliers_modeller.append(modeller_data[key]['Ramachandran outliers']) probity_ramachandran_outliers_modeller.append(modeller_data[key]['Ramachandran outliers'])
keys.append(key) keys.append(key)
#plt.clf() plt.clf()
fig, axs = plt.subplots(2, 2) def DoThingsWithAxes(ax, x_values, y_values, title, xlabel, ylabel):
ax.plot(x_values, y_values, '.', color = (128.0/255,0.0,0.0))
ax.plot([-1.0,1000.0], [-1.0,1000], color = 'k',linestyle='--')
ax.set_title(title, loc='left', y=1.08, x=-0.11, fontsize='x-large')
ax.set_xlabel(xlabel, fontsize='large')
ax.set_ylabel(ylabel, fontsize='large')
max_val = math.ceil(max([max(x_values), max(y_values)]))
ax.set_xlim([0, max_val])
ax.set_ylim([0, max_val])
ax.set_aspect('equal', 'box')
tick_locations = list()
step_size = None
if max_val <= 5:
step_size = 1
elif max_val <= 14:
step_size = 2
elif max_val <= 30:
step_size = 5
elif max_val <= 100:
step_size = 10
else:
step_size = 50
for i in range(0, int(max_val)+step_size, step_size):
tick_locations.append(i)
ax.set_xticks(tick_locations)
ax.set_yticks(tick_locations)
fig, axs = plt.subplots(2, 2, figsize=(7,7))
probity_overall_ax = axs[0, 0] probity_overall_ax = axs[0, 0]
probity_clash_ax = axs[0, 1] probity_clash_ax = axs[0, 1]
probity_rotamer_ax = axs[1, 0] probity_rotamer_ax = axs[1, 0]
probity_ramachandran_ax = axs[1, 1] probity_ramachandran_ax = axs[1, 1]
probity_overall_ax.plot(probity_values_promod, probity_values_modeller,'.', color = cred)
# plot zero line
probity_overall_ax.plot([0.0,5.0], [0.0,5.0], '.', color = 'k',linestyle='--')
probity_overall_ax.set_title('a) Overall Score', loc='left', y=1.05)
probity_overall_ax.set_xlabel(promod_label)
probity_overall_ax.set_ylabel(modeller_label)
probity_clash_ax.plot(probity_clash_promod, probity_clash_modeller,'.', color = cred) DoThingsWithAxes(probity_overall_ax, probity_values_promod,
# plot zero line probity_values_modeller, 'a) Overall Score',
probity_clash_ax.plot([0.0,180.0], [0.0,180.0], color = 'k',linestyle='--') promod_label, modeller_label)
probity_clash_ax.set_title('b) Clash Score', loc='left', y=1.05)
probity_clash_ax.set_xlabel(promod_label)
probity_clash_ax.set_ylabel(modeller_label)
DoThingsWithAxes(probity_clash_ax, probity_clash_promod,
probity_clash_modeller, 'b) Clash Score',
promod_label, modeller_label)
probity_rotamer_ax.plot(probity_rotamer_outliers_promod, probity_rotamer_outliers_modeller, DoThingsWithAxes(probity_rotamer_ax, probity_rotamer_outliers_promod,
'.', color = cred) probity_rotamer_outliers_modeller, 'c) Rotamer Outliers',
# plot zero line promod_label, modeller_label)
probity_rotamer_ax.plot([0.0,20.0], [0.0,20.0], color = 'k',linestyle='--')
probity_rotamer_ax.set_title('c) Rotamer Outliers', loc='left', y=1.05)
probity_rotamer_ax.set_xlabel(promod_label)
probity_rotamer_ax.set_ylabel(modeller_label)
DoThingsWithAxes(probity_ramachandran_ax, probity_ramachandran_outliers_promod,
probity_ramachandran_ax.plot(probity_ramachandran_outliers_promod, probity_ramachandran_outliers_modeller,
probity_ramachandran_outliers_modeller, '.', color = cred) 'd) Ramachandran Outliers', promod_label, modeller_label)
# plot zero line
probity_ramachandran_ax.plot([0.0,30.0], [0.0,30.0], color = 'k',linestyle='--')
probity_ramachandran_ax.set_title('d) Ramachandran Outliers', loc='left', y=1.05)
probity_ramachandran_ax.set_xlabel(promod_label)
probity_ramachandran_ax.set_ylabel(modeller_label)
plt.tight_layout(pad=1.2, h_pad=1.5, w_pad=1.5, rect=None) plt.tight_layout(pad=1.2, h_pad=1.5, w_pad=1.5, rect=None)
plt.savefig(molprobity_plot_name) plt.savefig(molprobity_plot_name)
print('avg. lddt value', promod_label, np.mean(lddt_values_promod)) print('avg. lddt value', promod_label, np.mean(lddt_values_promod))
......
modelling/promod3_vs_modeller_molprobity_scores.png

48 KiB | W: | H:

modelling/promod3_vs_modeller_molprobity_scores.png

60.9 KiB | W: | H:

modelling/promod3_vs_modeller_molprobity_scores.png
modelling/promod3_vs_modeller_molprobity_scores.png
modelling/promod3_vs_modeller_molprobity_scores.png
modelling/promod3_vs_modeller_molprobity_scores.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment