From f381b5c79be80b24efae4a680318d2dbd6a0e824 Mon Sep 17 00:00:00 2001 From: Pierre Beaujean Date: Tue, 4 Jun 2024 15:14:20 +0200 Subject: [PATCH] add comparison to experiment --- analyses/Makefile | 1 + analyses/plot_pot_er.py | 2 +- analyses/plot_pot_exp.py | 40 +++++++++++++++++++++---------- analyses/pot_exp_acetonitrile.pos | 35 +++++++++++++-------------- analyses/pot_exp_water.pos | 24 +++++++++---------- data/Data_pot.csv | 1 - nitroxides.tex | 12 +++++++++- 7 files changed, 70 insertions(+), 45 deletions(-) diff --git a/analyses/Makefile b/analyses/Makefile index ddd48a1..3eea79e 100644 --- a/analyses/Makefile +++ b/analyses/Makefile @@ -5,6 +5,7 @@ all: python plot_pot_DH.py -o ../Figure11.pdf python plot_cplx_Kx1.py -o ../Figure12.pdf python plot_cplx_Kx2.py -o ../Figure14.pdf + python plot_pot_exp.py -o ../Figure15.pdf python plot_DH.py -o ../FigureS1.pdf python plot_CIP.py -o ../FigureS2.pdf python plot_pairs.py -o ../FigureS3.pdf diff --git a/analyses/plot_pot_er.py b/analyses/plot_pot_er.py index ffcafd6..498140e 100644 --- a/analyses/plot_pot_er.py +++ b/analyses/plot_pot_er.py @@ -58,7 +58,7 @@ def plot_corr_Er(ax, data: pandas.DataFrame, column: str): x = numpy.array([-.2, 1.5]) ax.plot(x, result.slope*x + result.intercept, 'k--') - ax.text(1.2, 1.2*result.slope+result.intercept+.05, '$R^2$={:.3f}'.format(result.rvalue **2)) + ax.text(1.2, 1.2*result.slope+result.intercept+.05, '$R^2$={:.2f}'.format(result.rvalue **2)) def make_table(f, data: pandas.DataFrame, solvent: str): subdata = data[(data['solvent'] == solvent) & data['px'].notnull()] diff --git a/analyses/plot_pot_exp.py b/analyses/plot_pot_exp.py index cfc15ab..fcae854 100644 --- a/analyses/plot_pot_exp.py +++ b/analyses/plot_pot_exp.py @@ -1,9 +1,9 @@ import pandas import matplotlib.pyplot as plt import numpy -import sys import pathlib import argparse +import scipy from nitroxides.commons import dG_DH, AU_TO_ANG, LabelPositioner, AU_TO_EV, EPSILON_R, E_SHE @@ -12,6 +12,8 @@ LABELS_KWARGS = {'water': [], 'acetonitrile': []} LABELS_PATH = {'water': pathlib.Path('pot_exp_water.pos'), 'acetonitrile': pathlib.Path('pot_exp_acetonitrile.pos')} +EXCLUDE = [57, 51, 59] + def prepare_data(data: pandas.DataFrame, data_exp: pandas.DataFrame, solvent): subdata = data[data['solvent'] == solvent] subdata.insert(1, 'compound', [int(n.replace('mol_', '')) for n in subdata['name']]) @@ -25,15 +27,27 @@ def prepare_data(data: pandas.DataFrame, data_exp: pandas.DataFrame, solvent): return subdata[['compound', 'family', 'E_ox_theo_{}'.format(solvent), 'E_ox_exp_{}'.format(solvent)]] -def plot_solv(ax, data: pandas.DataFrame, solvent: str, family: str, color: str): +def plot_exp_vs_theo(ax, data: pandas.DataFrame, solvent: str, family: str, color: str): subdata = data[data['family'] == family] - ax.plot(subdata['E_ox_theo_{}'.format(solvent)], subdata['E_ox_exp_{}'.format(solvent)], 'o', color=color, label=family.replace('Family.', '')) + + ax.plot(subdata[~subdata['compound'].isin(EXCLUDE)]['E_ox_theo_{}'.format(solvent)], subdata[~subdata['compound'].isin(EXCLUDE)]['E_ox_exp_{}'.format(solvent)], 'o', color=color, label=family.replace('Family.', '')) + ax.plot(subdata[subdata['compound'].isin(EXCLUDE)]['E_ox_theo_{}'.format(solvent)], subdata[subdata['compound'].isin(EXCLUDE)]['E_ox_exp_{}'.format(solvent)], '^', color=color) for name, etheo, eexp in zip(subdata['compound'], subdata['E_ox_theo_{}'.format(solvent)], subdata['E_ox_exp_{}'.format(solvent)]): LABELS[solvent].append(name) POINTS_POSITION[solvent].append((etheo, eexp)) LABELS_KWARGS[solvent].append(dict(color=color, ha='center', va='center')) +def plot_corr(ax, data: pandas.DataFrame, solvent: str): + x, y = data[~data['compound'].isin(EXCLUDE)]['E_ox_theo_{}'.format(solvent)], data[~data['compound'].isin(EXCLUDE)]['E_ox_exp_{}'.format(solvent)] + result = scipy.stats.linregress(x, y) + + x = numpy.array( [x.min(), x.max()]) + ax.plot(x, result.slope*x + result.intercept, 'k--') + + x = .9 * x.min()+ .1 * x.max() + ax.text(x + .05, result.slope*x + result.intercept, '{:.2f} $\\times E^0_{{rel}}$ + {:.2f} ($R^2$={:.2f})'.format(result.slope, result.intercept,result.rvalue **2)) + parser = argparse.ArgumentParser() parser.add_argument('-i', '--input', default='../data/Data_pot.csv') parser.add_argument('-i2', '--input2', default='../data/Data_pot_ox_exp.csv') @@ -50,10 +64,10 @@ def plot_solv(ax, data: pandas.DataFrame, solvent: str, family: str, color: str) subdata_wa = prepare_data(data, data_exp, 'water') -plot_solv(ax1, subdata_wa, 'water', 'Family.P6O', 'tab:blue') -plot_solv(ax1, subdata_wa, 'water', 'Family.P5O', 'black') -plot_solv(ax1, subdata_wa, 'water', 'Family.IIO', 'tab:green') -plot_solv(ax1, subdata_wa, 'water', 'Family.APO', 'tab:red') +plot_exp_vs_theo(ax1, subdata_wa, 'water', 'Family.P6O', 'tab:blue') +plot_exp_vs_theo(ax1, subdata_wa, 'water', 'Family.P5O', 'black') + +plot_corr(ax1, subdata_wa, 'water') positioner = LabelPositioner.from_file( LABELS_PATH['water'], @@ -70,10 +84,12 @@ def plot_solv(ax, data: pandas.DataFrame, solvent: str, family: str, color: str) subdata_ac = prepare_data(data, data_exp, 'acetonitrile') -plot_solv(ax2, subdata_ac, 'acetonitrile', 'Family.P6O', 'tab:blue') -plot_solv(ax2, subdata_ac, 'acetonitrile', 'Family.P5O', 'black') -plot_solv(ax2, subdata_ac, 'acetonitrile', 'Family.IIO', 'tab:green') -plot_solv(ax2, subdata_ac, 'acetonitrile', 'Family.APO', 'tab:red') +plot_exp_vs_theo(ax2, subdata_ac, 'acetonitrile', 'Family.P6O', 'tab:blue') +plot_exp_vs_theo(ax2, subdata_ac, 'acetonitrile', 'Family.P5O', 'black') +plot_exp_vs_theo(ax2, subdata_ac, 'acetonitrile', 'Family.IIO', 'tab:green') +plot_exp_vs_theo(ax2, subdata_ac, 'acetonitrile', 'Family.APO', 'tab:red') + +plot_corr(ax2, subdata_ac, 'acetonitrile') positioner = LabelPositioner.from_file( LABELS_PATH['acetonitrile'], @@ -89,7 +105,7 @@ def plot_solv(ax, data: pandas.DataFrame, solvent: str, family: str, color: str) positioner.add_labels(ax2) ax2.legend() -[ax.set_xlabel('Computed $E^0_{rel}(N^+|N^\\bullet)$ (V)') for ax in (ax1, ax2)] +[ax.set_xlabel('Computed $E^f_{rel}(N^+|N^\\bullet)$ (V)') for ax in (ax1, ax2)] [ax.set_ylabel('Experimental $E^0_{rel}(N^+|N^\\bullet)$ (V)') for ax in (ax1, ax2)] plt.tight_layout() diff --git a/analyses/pot_exp_acetonitrile.pos b/analyses/pot_exp_acetonitrile.pos index d409cf6..ce1031a 100644 --- a/analyses/pot_exp_acetonitrile.pos +++ b/analyses/pot_exp_acetonitrile.pos @@ -1,19 +1,18 @@ ,label,x,y -0,2,0.4680935077159968,0.8594418754324777 -1,3,0.6439545960905232,0.9210409552501769 -2,6,0.6036618186165716,0.8831986615267781 -3,12,1.0550136279645264,1.0439350103237066 -4,15,0.6913589245753096,0.9689001824640407 -5,58,0.6801081513917642,1.0669201314255197 -6,59,0.6169599394688117,1.1196364265892487 -7,23,0.7327546768346744,1.0489587543163594 -8,24,0.6997123735820899,1.0874421903982037 -9,25,0.6198603364371229,0.9866235026213223 -10,26,0.6612309560168483,1.0396392139706785 -11,27,0.7295318298715,1.0224152622354148 -12,33,0.7587245534809859,1.1324619587319071 -13,60,0.7319340873284088,1.108044942792472 -14,36,0.6294585922569756,1.0136200239602362 -15,51,0.5578921008197629,1.0978687639014926 -16,54,0.8277120644383962,1.1006498045499185 -17,55,0.9003717940513294,1.174913327540382 +0,2,0.4690266249288662,0.859081244166761 +1,3,0.6343912236494678,0.9157974678380149 +2,6,0.5992297345607707,0.8849237142051551 +4,15,0.6837604652279913,0.9674513602953603 +5,58,0.6797114400066084,1.0670537994468983 +6,59,0.6210885637215627,1.1191424222936612 +7,23,0.7325522988546151,1.0493883712399428 +8,24,0.7009509105263972,1.0871021588452765 +9,25,0.6211631429760444,0.9854917885641445 +10,26,0.6619975365945193,1.0396035871674212 +11,27,0.7288369184936319,1.0221615244457485 +12,33,0.7656753550588773,1.1317584301052221 +13,60,0.7331680892657321,1.1082271147017304 +14,36,0.6281568278773575,1.0122832478759587 +15,51,0.5656911426336507,1.095305148041645 +16,54,0.8233712020976975,1.102970580880633 +17,55,0.87724271534739,1.1840937215347163 diff --git a/analyses/pot_exp_water.pos b/analyses/pot_exp_water.pos index 4e9e333..0ddfccf 100644 --- a/analyses/pot_exp_water.pos +++ b/analyses/pot_exp_water.pos @@ -1,13 +1,13 @@ ,label,x,y -0,2,0.7949327362078152,0.7376816053671381 -1,3,0.8898290033605948,0.7952384213698037 -2,4,0.8380103476415318,0.8239135472829964 -3,6,0.9085014996557057,0.8194968402375304 -4,11,0.9874868767730546,0.8977130186435169 -5,12,1.0202732112554556,0.9096094338356219 -6,13,0.8552511446851506,0.7849584387222813 -7,15,0.9678577839521213,0.8606063310498585 -8,18,0.8715024756939583,0.8228390387477847 -9,56,0.9078762625552546,0.8736811364414723 -10,57,0.7905139321632375,0.8438830125519429 -11,58,1.0203076221477898,0.9647924240975598 +0,2,0.794674791650889,0.740220285621926 +1,3,0.8911611380622928,0.79538892618509 +2,4,0.8374360046205728,0.8231279014346508 +3,6,0.909627856140639,0.8216567188352355 +4,11,0.9881780343265377,0.8984453067635239 +5,12,1.0204190523174443,0.9096382200218576 +6,13,0.8501027693905805,0.7870820063601331 +7,15,0.961764890264702,0.8668855060419954 +8,18,0.874391737931688,0.8205484453858627 +9,56,0.9096947941871378,0.8706542754568355 +10,57,0.7960746568967588,0.8503775551674212 +11,58,1.029958564096185,0.9478428681455665 diff --git a/data/Data_pot.csv b/data/Data_pot.csv index 6f9d5a3..e25d8d3 100644 --- a/data/Data_pot.csv +++ b/data/Data_pot.csv @@ -2,7 +2,6 @@ name,family,z,hammet,r,px,Qxx,method,has_cation,has_anion,solvent_model,solvent, mol_02,Family.P6O,0,,2.87,-0.1172,-0.0856,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,4.99063120812876,2.3210944512185,3.32916564365692,3.29958300239661,3.34822905687088 mol_03,Family.P6O,0,0.45,2.866,0.7391,4.5213,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.14774539378464,2.37074296708237,3.91778024431751,3.90516091331277,3.89547245951191 mol_06,Family.P6O,0,-0.37,2.874,1.8435,-3.2481,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.11303957390658,2.36762959889671,3.31005080550692,3.30092734535027,3.3459604053747 -mol_12,Family.P6O,0,0.5,2.833,3.2454,-1.9312,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.58015858695805,2.44469293066752,3.33033116108693,3.31017703491598,3.34491793685276 mol_15,Family.P5O,0,0.37,2.198,0.7393,2.9804,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.20270985569746,2.3006833128675,3.58373884455652,3.80851721612492,3.73623533859462 mol_23,Family.IIO,0,,2.186,0.4422,3.6909,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.2363322641835,2.33018096854232,3.61257836978602,3.59645024506954,3.62134710511788 mol_24,Family.IIO,0,,2.185,1.5472,10.5503,wB97XD/6-311+G(d),False,False,SMD,acetonitrile,5.27008279686026,2.36554193768737,4.58957688878232,4.57019988616966,4.62107425713651 diff --git a/nitroxides.tex b/nitroxides.tex index c625902..d410834 100644 --- a/nitroxides.tex +++ b/nitroxides.tex @@ -409,7 +409,7 @@ \subsection{Structure-activity relationships} \label{sec:sar} Regarding the impact of substituents, it is noteworthy that non-substituted nitroxides within each family (\textit{i.e.}, \textbf{2}, \textbf{14}, \textbf{23}, and \textbf{36}) generally have some of the lowest oxidation and reduction potentials within their respective groups. Several trends emerge based on the nature of the substituent: \begin{inparaenum}[(i)] \item shielding the radical center with ethyl groups instead of methyl groups (\textbf{7}, \textbf{19}, and \textbf{28}) results in a decrease in potentials (particularly the reduction potential), likely due to changes in inductive effects, - \item protonation of \ce{NH2} increases the potentials, especially in P5O, + \item protonation of \ce{NH2} (\textit{e.g.}, \textbf{4} vs \textbf{11}) increases the potentials, especially in P5O, \item multiple substitutions by COOH (\textit{e.g.}, \textbf{8} vs. \textbf{9} and \textbf{10}) also increase the potentials, though the effect is less pronounced in IIO and APO, \item compounds with mesomeric donor substituents (\ce{NH2}, \ce{OH}, \ce{OMe}) have lower potentials than those with acceptor substituents (COOH, \ce{NO2}), particularly in aromatic systems (IIO and APO), and \item compounds \textbf{56} and \textbf{58} have surprisingly low reduction potentials. @@ -502,12 +502,22 @@ \subsection{Impact of the electrolytes} \label{sec:elect} \clearpage \subsection{Comparison to experiment} \label{sec:exp} +A comparison between theoretical (including all corrections discussed above) and experimental oxidation potentials is shown in Fig.~\ref{fig:expvstheo}.\todo{that's not really $E^f$ for the moment ;)} Excluding compounds bearing an \ce{NH2} group (\textbf{51}, \textbf{57}, and \textbf{59}) results in an excellent linear correlation ($R^2>0.9$). The computed potentials for these compounds are higher (by $>\SI{0.1}{\volt}$) than the fit line, suggesting that the amine group might be protonated under the experimental measurement conditions. This is consistent with the other cases (\textit{e.g.}, \textbf{25} vs \textbf{35}) discussed in Section \ref{sec:sar}. + + \begin{itemize} \item So one can drop $K_{x2}$, \item Impact is small, isn't? \item What about Matsui? \end{itemize} +\begin{figure}[!h] + \centering + \includegraphics[width=\linewidth]{Figure15} + \caption{Comparison between experimental ($E^0_{rel} $ vs SHE, from Table S8) and computed relative oxidation potential ($E^f_{rel}$ vs SHE), as computed at the $\omega$B97X-D/6-311+G(d) level in water (left) and acetonitrile (right) using SMD and $[X]=\SI{0.1}{\mole\per\liter}$. } + \label{fig:expvstheo} +\end{figure} + \clearpage \section{Conclusion} \label{sec:conclusion}