You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all many thanks for your nice contribution to the field!
I was surprised to see that MLE ddG errors differ from calculated ddG errors for open cycles, this is not expected right? Please find bellow the code to reproduce this unexpected results, thanks in advance for your insights!
# cinnabar 0.4.1fromcinnabarimportfemapimportnumpyasnpimportitertools# dummy calculated and experimental dataexperimental_data= {'0': {'dG': -1, 'ddG': 2}, '1': {'dG': -2, 'ddG': 2}, '2': {'dG': -3, 'ddG': 2}, '3': {'dG': -4, 'ddG': 2}}
#calculated_data = {'0->1': {'ligand_i': '0', 'ligand_j': '1', 'dG': 1, 'ddG': 1}, '0->2': {'ligand_i': '0', 'ligand_j': '2', 'dG': 2, 'ddG': 1}, '2->3': {'ligand_i': '2', 'ligand_j': '3', 'dG': 3, 'ddG': 1}}calculated_data= {'0->1': {'ligand_i': '0', 'ligand_j': '1', 'dG': 1, 'ddG': 2.5}, '0->2': {'ligand_i': '0', 'ligand_j': '2', 'dG': 2, 'ddG': 2.8}, '2->3': {'ligand_i': '2', 'ligand_j': '3', 'dG': 3, 'ddG': 3.1}}
# creating cinnabar csv filecinnabar_filename='cinnabar_input.csv'withopen(cinnabar_filename, 'w') asf:
f.write("# Experimental block\n")
f.write("# Ligand, expt_DDG, expt_dDDG\n")
forentryinexperimental_data:
dG=experimental_data[entry]['dG']
ddG=experimental_data[entry]['ddG']
f.write(f"{entry},{dG:.2f},{ddG:.2f}\n")
f.write('\n')
f.write('# Calculated block\n')
f.write('# Ligand1,Ligand2,calc_DDG,calc_dDDG(MBAR),calc_dDDG(additional)\n')
forentryincalculated_data:
dG=calculated_data[entry]['dG']
ddG=calculated_data[entry]['ddG']
molA=calculated_data[entry]['ligand_i']
molB=calculated_data[entry]['ligand_j']
f.write(f"{molA},{molB},{dG:.2f},0,{ddG:.2f}\n")
# create femapfe=femap.FEMap.from_csv(cinnabar_filename)
# Get MLE generated estimates of the absolute valuesfe.generate_absolute_values()
graph=fe.to_legacy_graph()
nodes=graph.nodes(data=True)
node_names= [node[0] fornodeinnodes]
mle_dG=np.asarray([node[1]["calc_DG"] fornodeinnodes])
mle_dG_err=np.asarray([node[1]["calc_dDG"] fornodeinnodes])
# Get calcualted ddGs from MLE-dGs in cinnabarmle_network= {}
for (a, b), node_pairinzip(itertools.combinations(range(len(mle_dG)), 2), itertools.combinations(node_names, 2)):
# mle_ddG estimates from MLE-dGsmle_ddG=mle_dG[b] -mle_dG[a]
# mle ddG errors from MLE-dG errors (error propagation)mle_ddG_err= (mle_dG_err[b] **2+mle_dG_err[a] **2) **0.5# populate mle_networkmle_network[f"{node_pair[0]}->{node_pair[1]}"] = {'ligand_i': node_names[a], 'ligand_j': node_names[b], 'dG': mle_ddG, 'ddG': mle_ddG_err}
#print(node_pair, mle_ddG, mle_ddG_err)foredgeincalculated_data:
# MLE ddGs and calculated ddGs should be the same as we have an open thermodynamic cycleprint(f"MLE ddG: {round(mle_network[edge]['dG'], 1)}, Calculated ddG: {round(calculated_data[edge]['dG'], 1)}")
assertround(calculated_data[edge]['dG'], 1) ==round(mle_network[edge]['dG'],1 ), f"MLE ddG and calculated ddG for {edge} are not the same"# MLE ddG errors and calculated ddG errors should be the same as we have an open thermodynamic cycleprint(f"MLE ddG error: {round(mle_network[edge]['ddG'], 1)}, Calculated ddG error: {round(calculated_data[edge]['ddG'], 1)}")
assertround(calculated_data[edge]['ddG'], 1) ==round(mle_network[edge]['ddG'], 1), f"MLE ddG error and calculated ddG error for {edge} are not the same"
The text was updated successfully, but these errors were encountered:
First of all many thanks for your nice contribution to the field!
I was surprised to see that MLE ddG errors differ from calculated ddG errors for open cycles, this is not expected right? Please find bellow the code to reproduce this unexpected results, thanks in advance for your insights!
The text was updated successfully, but these errors were encountered: