pKaTool/pKaIO.py
def write_pka(self,filename,data=None,format='WHAT IF'):
        """Write a PKA.DAT file containing all info on the calculations"""
        #
        # Get the data
        #
        if not data:
            data=self.pka
        #
        # Write the file
        #
        fd=open(filename,'w')
        fd.write('%s pKa File\n' %format)
        fd.write('Format 1.0\n')
        fd.write('      Group            pKa value  Model pK    dpK     dDesolv    dBack   dElec\n')
        groups=data.keys()
        groups.sort()
        written={}
        #
        # ---------
        #
        for group in groups:
            if data.has_key(group):
                this_data=data[group]
                fd.write('%15s      %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  \n' %(self.WI_res_text(group,format),
                                                                                    this_data['pKa'],
                                                                                    this_data['modelpK'],
                                                                                    this_data['pKa']-this_data['modelpK'],
                                                                                    this_data['desolv'],
                                                                                    this_data['backgr'],
                                                                                    this_data['delec']))
                written[group]=1
        fd.write('End of file\n')
        fd.close()
        return
Write a PKA.DAT file containing all info on the calculations
Write a PKA.DAT file containing all info on the calculations
Write a PKA . DAT file containing all info on the calculations
def write_pka(self,filename,data=None,format='WHAT IF'):
         Get the data
        if not data:
            data=self.pka
         Write the file
        fd=open(filename,'w')
        fd.write('%s pKa File\n' %format)
        fd.write('Format 1.0\n')
        fd.write('      Group            pKa value  Model pK    dpK     dDesolv    dBack   dElec\n')
        groups=data.keys()
        groups.sort()
        written={}
         ---------
        for group in groups:
            if data.has_key(group):
                this_data=data[group]
                fd.write('%15s      %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  \n' %(self.WI_res_text(group,format),
                                                                                    this_data['pKa'],
                                                                                    this_data['modelpK'],
                                                                                    this_data['pKa']-this_data['modelpK'],
                                                                                    this_data['desolv'],
                                                                                    this_data['backgr'],
                                                                                    this_data['delec']))
                written[group]=1
        fd.write('End of file\n')
        fd.close()
        return
def write_pka ( self , filename , data = None , format = 'WHAT IF' ) : if not data : data = self . pka fd = open ( filename , 'w' ) fd . write ( '%s pKa File\n' % format ) fd . write ( 'Format 1.0\n' ) fd . write ( '      Group            pKa value  Model pK    dpK     dDesolv    dBack   dElec\n' ) groups = data . keys ( ) groups . sort ( ) written = { } for group in groups : if data . has_key ( group ) : this_data = data [ group ] fd . write ( '%15s      %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  %7.4f  \n' % ( self . WI_res_text ( group , format ) , this_data [ 'pKa' ] , this_data [ 'modelpK' ] , this_data [ 'pKa' ] - this_data [ 'modelpK' ] , this_data [ 'desolv' ] , this_data [ 'backgr' ] , this_data [ 'delec' ] ) ) written [ group ] = 1 fd . write ( 'End of file\n' ) fd . close ( ) return
Write a PKA.DAT file containing all info on the calculations
Write a PKA . DAT file containing all info on the calculations
"""Write a PKA.DAT file containing all info on the calculations""" # # Get the data # # # Write the file # # # --------- #
self
filename
data
format