@@ -137,8 +137,8 @@ def analyze(self):
137137 value_list = [dH_dict ["VDW" ], dH_dict ["COU (with DH)" ], dH_dict ["PB" ], dH_dict ["SA" ],
138138 TdS_dict ["Binding (with DH)" ], dH_dict ["Binding (with DH)" ]]
139139 name_list = ['ΔG vdw' , 'ΔG ele' , 'ΔG polar' , 'ΔG nonpolar' , '-TΔS' , 'ΔG binding' ]
140- df = pd .DataFrame ({'Energy Items' : name_list , 'Energy kcal /mol' : value_list })
141- sns .barplot (x = 'Energy Items' , y = 'Energy kcal /mol' , data = df )
140+ df = pd .DataFrame ({'Energy Items' : name_list , 'Energy kJ /mol' : value_list })
141+ sns .barplot (x = 'Energy Items' , y = 'Energy kJ /mol' , data = df )
142142 # show value of each bar
143143 for x , y in enumerate (value_list ):
144144 plt .text (x , y , '%s' % round (y , 3 ), ha = 'center' , va = 'bottom' )
@@ -194,11 +194,11 @@ def analyze(self):
194194 for i in range (len (name_list )):
195195 name_list [i ] = name_list [i ][2 :].strip ('(with DH)' )
196196
197- df = pd .DataFrame ({'Residue' : name_list , 'Energy kcal /mol' : value_list })
197+ df = pd .DataFrame ({'Residue' : name_list , 'Energy kJ /mol' : value_list })
198198
199199 # small font size
200200 plt .rcParams .update ({'font.size' : 15 })
201- sns .barplot (x = 'Residue' , y = 'Energy kcal /mol' , data = df )
201+ sns .barplot (x = 'Residue' , y = 'Energy kJ /mol' , data = df )
202202 # show value of each bar
203203 for x , y in enumerate (value_list ):
204204 plt .text (x , y , '%s' % round (y , 3 ), ha = 'center' , va = 'bottom' )
@@ -215,7 +215,7 @@ def analyze(self):
215215 plt .close ()
216216
217217 # create a output.md file
218- with open ('results/analysis/output_test .md' , 'w' ) as f :
218+ with open ('results/analysis/analysis_output .md' , 'w' , encoding = 'utf-8 ' ) as f :
219219 f .write (f'=== Calculate the binding free energy between the ligand small molecule and the protein === \n ' )
220220 f .write (f'Δ*G*<sub>binding</sub> \n ' )
221221 f .write (f'= Δ*H* - *T*Δ*S* \n ' )
0 commit comments