pKaTool/pKacalc_interface.py
def load_pdb(self):
        """Open a window to load a PDB file with the aim of calculating pKa values

        Get the PDB file, and see if a calculation has been carried out"""
        import os

        if not self.pdbfile:
            pdbfilename=tkFileDialog.askopenfilename(defaultextension='.pdb',
                                                     initialdir=os.getcwd(),
                                                     filetypes=[("PDB file","*.pdb"),
                                                                ("All files","*.*")],
                                                     parent=self.master)
            if not pdbfilename:
                return
        else:
            pdbfilename=self.pdbfile
        #
        #
        #
        self.pdbfilename=os.path.join(os.getcwd(),pdbfilename)
        if not os.path.isfile(self.pdbfilename):
            tkMessageBox.showwarning("File not found",
                                     'File not found: %s' %pdbfilename
                                     ,parent=self.master)
            return
        #
        # Set the name for it
        #
        self.label_count=0
        self.labels='ABCDEFGHIJKLMNOP'
        label=self.labels[self.label_count]
        #
        # Load the PDB file in Protool
        #
        import Protool
        self.Protool_instance=Protool.structureIO()
        self.Protool_instance.readpdb(self.pdbfilename)
        #
        # Setup the calculation arrays
        #
        import pKaIO
        self.calcs[self.pdbfilename]={'instance':pKaIO.pKaIO(self.pdbfilename),'selected_groups':[],'label':label}
        self.label_count=self.label_count+1
        self.X=self.calcs[self.pdbfilename]['instance']
        #
        # Open the file and assess status
        #
        if self.X.assess_status():
            import tkMessageBox
            answer=tkMessageBox.askyesno('WHAT IF pKa calculation found',
                                          'A WHAT IF pKa calculation has been found for this PDB file.\nDo you want to load the results from this calculation?',
                                          parent=self.master)
            if answer:
                self.load_titration()
            else:
                self.pdbfilename_var.set('PDB file: %s' %os.path.split(pdbfilename)[1])
                self.pka_status_var.set('pKa calc status: No calculation performed')
                del self.calcs[pdbfilename]
        else:
            self.pdbfilename_var.set('PDB file: %s' %os.path.split(pdbfilename)[1])
            self.pka_status_var.set('pKa calc status: No calculation performed')
            del self.calcs[pdbfilename]
        return
Open a window to load a PDB file with the aim of calculating pKa values

        Get the PDB file, and see if a calculation has been carried out
Open a window to load a PDB file with the aim of calculating pKa values
Get the PDB file, and see if a calculation has been carried out
Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file and see if a calculation has been carried out
def load_pdb(self):
        import os
        if not self.pdbfile:
            pdbfilename=tkFileDialog.askopenfilename(defaultextension='.pdb',
                                                     initialdir=os.getcwd(),
                                                     filetypes=[("PDB file","*.pdb"),
                                                                ("All files","*.*")],
                                                     parent=self.master)
            if not pdbfilename:
                return
        else:
            pdbfilename=self.pdbfile
        self.pdbfilename=os.path.join(os.getcwd(),pdbfilename)
        if not os.path.isfile(self.pdbfilename):
            tkMessageBox.showwarning("File not found",
                                     'File not found: %s' %pdbfilename
                                     ,parent=self.master)
            return
         Set the name for it
        self.label_count=0
        self.labels='ABCDEFGHIJKLMNOP'
        label=self.labels[self.label_count]
         Load the PDB file in Protool
        import Protool
        self.Protool_instance=Protool.structureIO()
        self.Protool_instance.readpdb(self.pdbfilename)
         Setup the calculation arrays
        import pKaIO
        self.calcs[self.pdbfilename]={'instance':pKaIO.pKaIO(self.pdbfilename),'selected_groups':[],'label':label}
        self.label_count=self.label_count+1
        self.X=self.calcs[self.pdbfilename]['instance']
         Open the file and assess status
        if self.X.assess_status():
            import tkMessageBox
            answer=tkMessageBox.askyesno('WHAT IF pKa calculation found',
                                          'A WHAT IF pKa calculation has been found for this PDB file.\nDo you want to load the results from this calculation?',
                                          parent=self.master)
            if answer:
                self.load_titration()
            else:
                self.pdbfilename_var.set('PDB file: %s' %os.path.split(pdbfilename)[1])
                self.pka_status_var.set('pKa calc status: No calculation performed')
                del self.calcs[pdbfilename]
        else:
            self.pdbfilename_var.set('PDB file: %s' %os.path.split(pdbfilename)[1])
            self.pka_status_var.set('pKa calc status: No calculation performed')
            del self.calcs[pdbfilename]
        return
def load_pdb ( self ) : import os if not self . pdbfile : pdbfilename = tkFileDialog . askopenfilename ( defaultextension = '.pdb' , initialdir = os . getcwd ( ) , filetypes = [ ( "PDB file" , "*.pdb" ) , ( "All files" , "*.*" ) ] , parent = self . master ) if not pdbfilename : return else : pdbfilename = self . pdbfile self . pdbfilename = os . path . join ( os . getcwd ( ) , pdbfilename ) if not os . path . isfile ( self . pdbfilename ) : tkMessageBox . showwarning ( "File not found" , 'File not found: %s' % pdbfilename , parent = self . master ) return self . label_count = 0 self . labels = 'ABCDEFGHIJKLMNOP' label = self . labels [ self . label_count ] import Protool self . Protool_instance = Protool . structureIO ( ) self . Protool_instance . readpdb ( self . pdbfilename ) import pKaIO self . calcs [ self . pdbfilename ] = { 'instance' : pKaIO . pKaIO ( self . pdbfilename ) , 'selected_groups' : [ ] , 'label' : label } self . label_count = self . label_count + 1 self . X = self . calcs [ self . pdbfilename ] [ 'instance' ] if self . X . assess_status ( ) : import tkMessageBox answer = tkMessageBox . askyesno ( 'WHAT IF pKa calculation found' , 'A WHAT IF pKa calculation has been found for this PDB file.\nDo you want to load the results from this calculation?' , parent = self . master ) if answer : self . load_titration ( ) else : self . pdbfilename_var . set ( 'PDB file: %s' % os . path . split ( pdbfilename ) [ 1 ] ) self . pka_status_var . set ( 'pKa calc status: No calculation performed' ) del self . calcs [ pdbfilename ] else : self . pdbfilename_var . set ( 'PDB file: %s' % os . path . split ( pdbfilename ) [ 1 ] ) self . pka_status_var . set ( 'pKa calc status: No calculation performed' ) del self . calcs [ pdbfilename ] return
Open a window to load a PDB file with the aim of calculating pKa values
Get the PDB file, and see if a calculation has been carried out
Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file and see if a calculation has been carried out
"""Open a window to load a PDB file with the aim of calculating pKa values

        Get the PDB file, and see if a calculation has been carried out""" # # # # # Set the name for it # # # Load the PDB file in Protool # # # Setup the calculation arrays # # # Open the file and assess status #
self