diff --git a/pixi.toml b/pixi.toml index 2a22610..bce7d6c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -44,6 +44,7 @@ xgboost = ">=2.1.1" ambertools = ">=23.6,<24" xtb = ">=6.7.1,<7" openbabel = ">=3.1.1,<4" +pandas = ">=2.2.3,<3" [feature.dev.dependencies] black = ">=23.10.0" diff --git a/study/figures/a-cro/a003-cro66_vol/.pages b/study/figures/a-cro/a003-cro66_vol/.pages new file mode 100644 index 0000000..35fd5a1 --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/.pages @@ -0,0 +1,2 @@ +nav: + - index.md diff --git a/study/figures/a-cro/a003-cro66_vol/cro66_vol-pdf.svg b/study/figures/a-cro/a003-cro66_vol/cro66_vol-pdf.svg new file mode 100644 index 0000000..db233c7 --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/cro66_vol-pdf.svg @@ -0,0 +1,1665 @@ + + + + + + + + 2024-12-06T23:00:03.009854 + image/svg+xml + + + Matplotlib v3.9.2, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/study/figures/a-cro/a003-cro66_vol/index.md b/study/figures/a-cro/a003-cro66_vol/index.md new file mode 100644 index 0000000..189fc95 --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/index.md @@ -0,0 +1 @@ +# A003: Cro66 volume diff --git a/study/figures/a-cro/a003-cro66_vol/pdf-info.md b/study/figures/a-cro/a003-cro66_vol/pdf-info.md new file mode 100644 index 0000000..4365afd --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/pdf-info.md @@ -0,0 +1,53 @@ +Reduced roGFP2 + +| Pocket volume | Density | +|-----------|-----------| +| 94.60 | $1.011 \times 10^{-12}$ | +| 150.60 | $2.442 \times 10^{-02}$ | +| 155.20 | $2.348 \times 10^{-02}$ | +| 159.00 | $2.531 \times 10^{-02}$ | +| 203.30 | $5.312 \times 10^{-04}$ | +| 203.70 | $5.316 \times 10^{-04}$ | +| 227.30 | $1.537 \times 10^{-12}$ | + +Oxidized roGFP2 + +| Pocket volume | Density | +|-----------|-----------| +| 80.10 | $1.107 \times 10^{-10}$ | +| 126.10 | $2.947 \times 10^{-02}$ | +| 127.20 | $2.940 \times 10^{-02}$ | +| 130.00 | $3.015 \times 10^{-02}$ | +| 131.80 | $2.981 \times 10^{-02}$ | +| 133.00 | $2.995 \times 10^{-02}$ | +| 183.50 | $3.752 \times 10^{-05}$ | +| 185.40 | $6.275 \times 10^{-05}$ | +| 187.80 | $3.262 \times 10^{-05}$ | +| 188.80 | $3.566 \times 10^{-05}$ | +| 193.90 | $8.277 \times 10^{-09}$ | +| 199.00 | $3.399 \times 10^{-05}$ | +| 204.80 | $1.692 \times 10^{-10}$ | + +roGFP2 and Cu(I) + +| Pocket volume | Density | +|-----------|-----------| +| 85.00 | $1.783 \times 10^{-16}$ | +| 101.20 | $9.523 \times 10^{-05}$ | +| 103.70 | $8.135 \times 10^{-05}$ | +| 110.40 | $3.174 \times 10^{-04}$ | +| 111.60 | $3.143 \times 10^{-04}$ | +| 155.80 | $1.945 \times 10^{-02}$ | +| 163.90 | $1.773 \times 10^{-02}$ | +| 166.80 | $1.811 \times 10^{-02}$ | +| 249.90 | $5.275 \times 10^{-16}$ | + +roGFP2 and Na+ + +| Pocket volume | Density | +|-----------|-----------| +| 84.80 | $4.821 \times 10^{-23}$ | +| 152.90 | $1.529 \times 10^{-02}$ | +| 266.50 | $8.235 \times 10^{-07}$ | +| 272.90 | $1.690 \times 10^{-05}$ | +| 294.10 | $6.912 \times 10^{-23}$ | diff --git a/study/figures/a-cro/a003-cro66_vol/pdf.py b/study/figures/a-cro/a003-cro66_vol/pdf.py new file mode 100755 index 0000000..b0ab3eb --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/pdf.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 + +import os + +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +from scipy.stats import gaussian_kde + +from metalflare.analysis.figures import use_mpl_rc_params +from metalflare.analysis.pdfs import ( + extrema_table, + make_pdf_fig, +) + +os.chdir(os.path.dirname(os.path.realpath(__file__))) + +if __name__ == "__main__": + # Specify the paths to the trajectory and topology files + base_dir = "../../../" + + # Update plot params + rc_json_path = os.path.join( + base_dir, "misc/003-figure-style/matplotlib-rc-params.json" + ) + font_dirs = [os.path.join(base_dir, "misc/003-figure-style/roboto")] + use_mpl_rc_params(rc_json_path, font_dirs) + + rogfp_data_path = os.path.join( + base_dir, + "analysis/005-rogfp-glh-md/data/pocket/povme/volumes.csv", + ) + rogfp_data = pd.read_csv(rogfp_data_path)["volume"].to_numpy() + + # Oxidized + rogfp_oxd_data_path = os.path.join( + base_dir, + "analysis/007-rogfp-oxd-glh-md/data/pocket/povme/volumes.csv", + ) + rogfp_oxd_data = pd.read_csv(rogfp_oxd_data_path)["volume"].to_numpy() + + rogfp2_cu_path = os.path.join( + base_dir, + "analysis/006-rogfp-cu-glh-md/data/pocket/povme/volumes.csv", + ) + rogfp2_cu_data = pd.read_csv(rogfp2_cu_path)["volume"].to_numpy() + + rogfp2_na_path = os.path.join( + base_dir, + "analysis/008-rogfp-na-glh-md/data/pocket/povme/volumes.csv", + ) + rogfp2_na_data = pd.read_csv(rogfp2_na_path)["volume"].to_numpy() + + x_bounds = (10, 500) + x_values = np.arange(*x_bounds, 0.1) + bw_method = 0.09 + + kde = gaussian_kde(rogfp_data, bw_method=bw_method) + scaling_factor = kde.integrate_box_1d(*x_bounds) + pdf_rogfp = kde(x_values) / scaling_factor + + kde = gaussian_kde(rogfp_oxd_data, bw_method=bw_method) + scaling_factor = kde.integrate_box_1d(*x_bounds) + pdf_rogfp_oxd = kde(x_values) / scaling_factor + + kde = gaussian_kde(rogfp2_cu_data, bw_method=bw_method) + scaling_factor = kde.integrate_box_1d(*x_bounds) + pdf_rogfp_cu = kde(x_values) / scaling_factor + + kde = gaussian_kde(rogfp2_na_data, bw_method=bw_method) + scaling_factor = kde.integrate_box_1d(*x_bounds) + pdf_rogfp_na = kde(x_values) / scaling_factor + + # save pdf information + pdf_info_lines = ["Reduced roGFP2\n"] + pdf_info_lines.extend( + extrema_table( + x_values, + "Pocket volume", + pdf_rogfp, + "Density", + sci_notation=True, + window_length=20, + ) + ) + pdf_info_lines.append("\nOxidized roGFP2\n") + pdf_info_lines.extend( + extrema_table( + x_values, + "Pocket volume", + pdf_rogfp_oxd, + "Density", + sci_notation=True, + window_length=20, + ) + ) + pdf_info_lines.append("\nroGFP2 and Cu(I)\n") + pdf_info_lines.extend( + extrema_table( + x_values, + "Pocket volume", + pdf_rogfp_cu, + "Density", + sci_notation=True, + window_length=20, + ) + ) + pdf_info_lines.append("\nroGFP2 and Na+\n") + pdf_info_lines.extend( + extrema_table( + x_values, + "Pocket volume", + pdf_rogfp_na, + "Density", + sci_notation=True, + window_length=20, + ) + ) + pdf_info_lines = [line + "\n" for line in pdf_info_lines] + pdf_info_path = "./pdf-info.md" + with open(pdf_info_path, "w", encoding="utf-8") as f: + f.writelines(pdf_info_lines) + + # Make pdf plot + fig_title = "cro66_vol" + pdf_plt_kwargs = {"alpha": 1.0, "linewidth": 1.5} + x_label = "Cro66 Pocket Volume [Å$^3$]" + plot_x_bounds = (75, 275) + y_label = "Density" + plot_y_bounds = (0, None) + + pdf_fig = make_pdf_fig( + x_values, + pdf_rogfp, + pdf_rogfp_cu, + pdf_plt_kwargs, + x_label=x_label, + x_bounds=plot_x_bounds, + y_label=y_label, + y_bounds=plot_y_bounds, + pdf_rogfp_oxd=pdf_rogfp_oxd, + pdf_na=pdf_rogfp_na + ) + plt.xticks(np.arange(100, 250 + 0.01, 50)) + pdf_fig.savefig(f"{fig_title}-pdf.svg") + plt.close() diff --git a/study/figures/a-cro/a003-cro66_vol/pmf-info.md b/study/figures/a-cro/a003-cro66_vol/pmf-info.md new file mode 100644 index 0000000..8ede3f8 --- /dev/null +++ b/study/figures/a-cro/a003-cro66_vol/pmf-info.md @@ -0,0 +1,214 @@ +Reduced roGFP2 + +| Dihedral [°] | PMF [kcal/mol] | +|-----------|-----------| +| -175.99 | 4.080 | +| -171.99 | 4.693 | +| -168.48 | 3.965 | +| -165.98 | 4.832 | +| -164.98 | 4.620 | +| -162.98 | 5.083 | +| -160.97 | 4.339 | +| -159.47 | 4.618 | +| -157.97 | 4.474 | +| -156.47 | 4.539 | +| -153.46 | 4.391 | +| -147.45 | 6.251 | +| -141.95 | 4.288 | +| -137.94 | 7.496 | +| -135.44 | 5.165 | +| -131.93 | 8.463 | +| -124.92 | 4.270 | +| -123.92 | 4.385 | +| -119.92 | 4.093 | +| -116.91 | 4.567 | +| -114.91 | 3.996 | +| -112.41 | 4.876 | +| -105.90 | 3.765 | +| -102.39 | 4.170 | +| -100.89 | 4.076 | +| -99.89 | 4.085 | +| -62.84 | -0.452 | +| -26.29 | 4.115 | +| -24.78 | 4.079 | +| -23.78 | 4.140 | +| -22.28 | 4.029 | +| -20.28 | 4.341 | +| -16.27 | 3.775 | +| -14.27 | 4.041 | +| -10.76 | 3.691 | +| -6.26 | 4.593 | +| 0.75 | 1.869 | +| 7.26 | 7.435 | +| 11.27 | 4.265 | +| 13.77 | 4.712 | +| 48.32 | -0.000 | +| 77.86 | 2.956 | +| 79.36 | 2.908 | +| 83.37 | 3.437 | +| 85.37 | 3.243 | +| 88.37 | 3.728 | +| 100.39 | 2.618 | +| 102.89 | 2.711 | +| 109.90 | 3.016 | +| 110.90 | 2.985 | +| 115.91 | 3.280 | +| 117.91 | 3.038 | +| 119.42 | 3.072 | +| 122.92 | 2.848 | +| 124.92 | 2.968 | +| 132.93 | 2.708 | +| 135.44 | 2.768 | +| 137.94 | 2.714 | +| 139.94 | 2.868 | +| 140.95 | 2.845 | +| 142.95 | 2.944 | +| 146.95 | 2.828 | +| 149.46 | 3.144 | +| 150.96 | 3.114 | +| 153.46 | 3.495 | +| 155.47 | 3.389 | +| 162.48 | 4.628 | +| 164.98 | 4.266 | +| 166.48 | 4.362 | +| 167.98 | 4.305 | +| 168.98 | 4.322 | +| 170.49 | 4.267 | +| 172.99 | 5.103 | +| 174.99 | 4.661 | +| 177.50 | 5.175 | +| 178.50 | 5.089 | + +Oxidized roGFP2 + +| Dihedral [°] | PMF [kcal/mol] | +|-----------|-----------| +| -179.00 | 1.970 | +| -177.00 | 1.967 | +| -174.99 | 2.434 | +| -172.99 | 2.128 | +| -170.99 | 2.385 | +| -168.48 | 1.967 | +| -166.48 | 2.167 | +| -163.98 | 1.939 | +| -159.97 | 3.879 | +| -154.46 | 2.330 | +| -148.46 | 3.500 | +| -146.95 | 3.373 | +| -145.45 | 3.838 | +| -143.45 | 2.866 | +| -139.94 | 5.279 | +| -137.44 | 3.393 | +| -126.93 | 44.397 | +| -116.41 | 3.064 | +| -111.91 | 9.009 | +| -102.39 | 2.049 | +| -99.39 | 2.202 | +| -62.84 | -2.390 | +| -24.28 | 2.000 | +| -22.78 | 1.925 | +| -21.28 | 1.967 | +| -17.77 | 1.691 | +| -15.27 | 1.791 | +| -11.27 | 1.360 | +| -8.26 | 1.752 | +| -3.76 | 1.498 | +| -1.25 | 1.638 | +| 2.25 | 1.777 | +| 4.26 | 1.723 | +| 6.76 | 2.048 | +| 8.26 | 1.882 | +| 16.27 | 2.488 | +| 19.78 | 2.131 | +| 21.28 | 2.198 | +| 45.81 | -0.005 | +| 66.34 | 0.854 | +| 67.34 | 0.821 | +| 72.35 | 1.374 | +| 73.85 | 1.257 | +| 85.37 | 2.736 | +| 87.87 | 2.578 | +| 90.88 | 4.370 | +| 92.88 | 3.413 | +| 108.40 | 92.083 | +| 123.92 | 2.799 | +| 142.45 | 123.959 | +| 160.47 | 3.392 | +| 163.48 | 6.206 | +| 165.98 | 3.467 | +| 167.48 | 3.572 | +| 169.99 | 2.630 | +| 174.49 | 3.649 | + +roGFP2 and Cu(I) + +| Dihedral [°] | PMF [kcal/mol] | +|-----------|-----------| +| -176.50 | 1.031 | +| -171.49 | 1.103 | +| -167.48 | 1.036 | +| -159.47 | 1.515 | +| -156.97 | 1.501 | +| -138.94 | 3.487 | +| -137.44 | 3.135 | +| -135.94 | 3.173 | +| -134.44 | 3.048 | +| -131.43 | 3.608 | +| -129.93 | 3.434 | +| -125.92 | 4.306 | +| -120.42 | 3.531 | +| -118.41 | 3.601 | +| -115.41 | 3.246 | +| -113.41 | 3.726 | +| -110.40 | 3.061 | +| -107.90 | 3.246 | +| -104.90 | 2.615 | +| -103.39 | 2.727 | +| -63.34 | -1.694 | +| -28.79 | 2.908 | +| -27.29 | 2.712 | +| -22.78 | 3.317 | +| -21.78 | 3.257 | +| -18.28 | 3.907 | +| -15.77 | 3.379 | +| -12.27 | 3.824 | +| -7.26 | 3.156 | +| -3.25 | 4.338 | +| 0.75 | 2.192 | +| 4.26 | 3.780 | +| 6.26 | 3.292 | +| 7.76 | 3.351 | +| 11.77 | 2.837 | +| 14.27 | 3.186 | +| 45.81 | -0.009 | +| 47.82 | 0.000 | +| 49.32 | -0.006 | +| 78.86 | 1.933 | +| 81.36 | 1.742 | +| 83.37 | 1.811 | +| 89.87 | 1.671 | +| 92.38 | 1.823 | +| 99.39 | 1.606 | +| 108.90 | 2.277 | +| 110.40 | 2.167 | +| 112.91 | 2.558 | +| 114.91 | 2.387 | +| 118.92 | 2.703 | +| 120.92 | 2.426 | +| 123.92 | 2.666 | +| 127.43 | 2.397 | +| 130.93 | 3.042 | +| 131.93 | 2.939 | +| 132.93 | 2.981 | +| 138.44 | 2.492 | +| 140.45 | 2.760 | +| 142.45 | 2.426 | +| 144.95 | 2.545 | +| 146.45 | 2.443 | +| 150.46 | 2.510 | +| 154.46 | 2.106 | +| 159.97 | 2.275 | +| 166.48 | 1.731 | +| 168.48 | 1.870 | +| 173.99 | 1.347 | +| 175.49 | 1.383 |