pKaTool/pKacalc_interface.py
def init_calc(self):
        """Initialise a pKa calculation

        This involves getting the titratable groups"""
        #
        # Do we have a PDB file?
        #
        #if not self.pdbfilename:
        #    import tkMessageBox
        #    tkMessageBox.showwarning('No PDB file',
        #                             'You have to load a PDB file before performing a pKa calculation')
        #    return
        #
        # Open the file manager dialog
        #
        self.file_manager_dialog()
        #
        # Open the window
        #
        self.initwin=Toplevel()
        self.initwin.transient(self.master)
        self.set_geometry(self.master,self.initwin)
        #
        #
        # Start window
        #
        self.initwin.title('Initialise pKa calculation')
        Label(self.initwin,text='Select the titratable groups you want to include in the calculation').grid(row=0,column=0,columnspan=5)
        Label(self.initwin,text='You cannot add or delete groups from this calculation once you click "Select these groups"').grid(row=1,column=0,columnspan=5)
        #
        # Listbox for all titratable groups
        #
        yscrollbar=Scrollbar(self.initwin,orient='vertical',width=10)
        yscrollbar.grid(row=2,column=2,rowspan=10,sticky='nws')
        height=10
        self.all_groups=Listbox(self.initwin,
                                bg='white',
                                fg='black',
                                height=height,width=15,
                                yscrollcommand=yscrollbar.set,
                                selectmode=MULTIPLE)
        self.all_groups.grid(row=2,column=0,columnspan=2,rowspan=10,sticky='news')
        yscrollbar.config(command=self.all_groups.yview)
        #
        # List containing the groups that are selected
        #
        self.calc_selected_list=[]
        #
        # Listbox for titratable groups to be included in calculation
        #
        yscrollbar2=Scrollbar(self.initwin,orient='vertical',width=10)
        yscrollbar2.grid(row=2,column=6,rowspan=10,sticky='nws')
        height=10
        self.calcgroups_selected=Listbox(self.initwin,
                                bg='white',
                                fg='black',
                                height=height,width=15,
                                yscrollcommand=yscrollbar2.set,
                                selectmode=MULTIPLE)
        self.calcgroups_selected.grid(row=2,column=4,columnspan=2,rowspan=10,sticky='news')
        yscrollbar2.config(command=self.calcgroups_selected.yview)
        #
        # Calculation engine setup
        #
        self.set_enecalc_engine(win=self.initwin,row=2,column=3,command=self.update_calcIF_selected_groups)
        self.update_calcIF_selected_groups()
        Button(self.initwin,text='Add -->',command=self.calcIF_select_group).grid(row=5,column=3)
        Button(self.initwin,text='<-- Remove',command=self.calcIF_remove_group).grid(row=6,column=3)
        #
        # pH start, stop and step
        #
        self.pHstart=0.1
        self.pHstop=12.0
        self.pHstep=0.1
        #
        # OK and Cancel buttons
        #
        Button(self.initwin,text='Select these groups',command=self.IFsetup_calc).grid(row=13,column=0,columnspan=2,sticky='news')
        Button(self.initwin,text='Select all groups',command=self.calcIF_selectall).grid(row=13,column=2,columnspan=2,sticky='news')
        Button(self.initwin,text='Add structure file(PDB/mol2)').grid(row=13,column=4)
        Button(self.initwin,text='Add extra titgroup in loaded structure')
        Button(self.initwin,text='Cancel',command=self.initwin.destroy).grid(row=13,column=5,sticky='news')
        self.status=StringVar()
        self.status.set('Waiting...')
        Label(self.initwin,text='Status:').grid(row=14,column=0)
        Label(self.initwin,textvariable=self.status).grid(row=14,column=1)
        #
        # Button for defining titratable groups
        #
        Button(self.initwin,text='Edit titgroup definitions').grid(row=14,column=0)
        return
Initialise a pKa calculation

        This involves getting the titratable groups
Initialise a pKa calculation
This involves getting the titratable groups
Initialise a pKa calculation This involves getting the titratable groups
def init_calc(self):
         Do we have a PDB file?
        if not self.pdbfilename:
            import tkMessageBox
            tkMessageBox.showwarning('No PDB file',
                                     'You have to load a PDB file before performing a pKa calculation')
            return
         Open the file manager dialog
        self.file_manager_dialog()
         Open the window
        self.initwin=Toplevel()
        self.initwin.transient(self.master)
        self.set_geometry(self.master,self.initwin)
         Start window
        self.initwin.title('Initialise pKa calculation')
        Label(self.initwin,text='Select the titratable groups you want to include in the calculation').grid(row=0,column=0,columnspan=5)
        Label(self.initwin,text='You cannot add or delete groups from this calculation once you click "Select these groups"').grid(row=1,column=0,columnspan=5)
         Listbox for all titratable groups
        yscrollbar=Scrollbar(self.initwin,orient='vertical',width=10)
        yscrollbar.grid(row=2,column=2,rowspan=10,sticky='nws')
        height=10
        self.all_groups=Listbox(self.initwin,
                                bg='white',
                                fg='black',
                                height=height,width=15,
                                yscrollcommand=yscrollbar.set,
                                selectmode=MULTIPLE)
        self.all_groups.grid(row=2,column=0,columnspan=2,rowspan=10,sticky='news')
        yscrollbar.config(command=self.all_groups.yview)
         List containing the groups that are selected
        self.calc_selected_list=[]
         Listbox for titratable groups to be included in calculation
        yscrollbar2=Scrollbar(self.initwin,orient='vertical',width=10)
        yscrollbar2.grid(row=2,column=6,rowspan=10,sticky='nws')
        height=10
        self.calcgroups_selected=Listbox(self.initwin,
                                bg='white',
                                fg='black',
                                height=height,width=15,
                                yscrollcommand=yscrollbar2.set,
                                selectmode=MULTIPLE)
        self.calcgroups_selected.grid(row=2,column=4,columnspan=2,rowspan=10,sticky='news')
        yscrollbar2.config(command=self.calcgroups_selected.yview)
         Calculation engine setup
        self.set_enecalc_engine(win=self.initwin,row=2,column=3,command=self.update_calcIF_selected_groups)
        self.update_calcIF_selected_groups()
        Button(self.initwin,text='Add -->',command=self.calcIF_select_group).grid(row=5,column=3)
        Button(self.initwin,text='<-- Remove',command=self.calcIF_remove_group).grid(row=6,column=3)
         pH start, stop and step
        self.pHstart=0.1
        self.pHstop=12.0
        self.pHstep=0.1
         OK and Cancel buttons
        Button(self.initwin,text='Select these groups',command=self.IFsetup_calc).grid(row=13,column=0,columnspan=2,sticky='news')
        Button(self.initwin,text='Select all groups',command=self.calcIF_selectall).grid(row=13,column=2,columnspan=2,sticky='news')
        Button(self.initwin,text='Add structure file(PDB/mol2)').grid(row=13,column=4)
        Button(self.initwin,text='Add extra titgroup in loaded structure')
        Button(self.initwin,text='Cancel',command=self.initwin.destroy).grid(row=13,column=5,sticky='news')
        self.status=StringVar()
        self.status.set('Waiting...')
        Label(self.initwin,text='Status:').grid(row=14,column=0)
        Label(self.initwin,textvariable=self.status).grid(row=14,column=1)
         Button for defining titratable groups
        Button(self.initwin,text='Edit titgroup definitions').grid(row=14,column=0)
        return
def init_calc ( self ) : self . file_manager_dialog ( ) self . initwin = Toplevel ( ) self . initwin . transient ( self . master ) self . set_geometry ( self . master , self . initwin ) self . initwin . title ( 'Initialise pKa calculation' ) Label ( self . initwin , text = 'Select the titratable groups you want to include in the calculation' ) . grid ( row = 0 , column = 0 , columnspan = 5 ) Label ( self . initwin , text = 'You cannot add or delete groups from this calculation once you click "Select these groups"' ) . grid ( row = 1 , column = 0 , columnspan = 5 ) yscrollbar = Scrollbar ( self . initwin , orient = 'vertical' , width = 10 ) yscrollbar . grid ( row = 2 , column = 2 , rowspan = 10 , sticky = 'nws' ) height = 10 self . all_groups = Listbox ( self . initwin , bg = 'white' , fg = 'black' , height = height , width = 15 , yscrollcommand = yscrollbar . set , selectmode = MULTIPLE ) self . all_groups . grid ( row = 2 , column = 0 , columnspan = 2 , rowspan = 10 , sticky = 'news' ) yscrollbar . config ( command = self . all_groups . yview ) self . calc_selected_list = [ ] yscrollbar2 = Scrollbar ( self . initwin , orient = 'vertical' , width = 10 ) yscrollbar2 . grid ( row = 2 , column = 6 , rowspan = 10 , sticky = 'nws' ) height = 10 self . calcgroups_selected = Listbox ( self . initwin , bg = 'white' , fg = 'black' , height = height , width = 15 , yscrollcommand = yscrollbar2 . set , selectmode = MULTIPLE ) self . calcgroups_selected . grid ( row = 2 , column = 4 , columnspan = 2 , rowspan = 10 , sticky = 'news' ) yscrollbar2 . config ( command = self . calcgroups_selected . yview ) self . set_enecalc_engine ( win = self . initwin , row = 2 , column = 3 , command = self . update_calcIF_selected_groups ) self . update_calcIF_selected_groups ( ) Button ( self . initwin , text = 'Add -->' , command = self . calcIF_select_group ) . grid ( row = 5 , column = 3 ) Button ( self . initwin , text = '<-- Remove' , command = self . calcIF_remove_group ) . grid ( row = 6 , column = 3 ) self . pHstart = 0.1 self . pHstop = 12.0 self . pHstep = 0.1 Button ( self . initwin , text = 'Select these groups' , command = self . IFsetup_calc ) . grid ( row = 13 , column = 0 , columnspan = 2 , sticky = 'news' ) Button ( self . initwin , text = 'Select all groups' , command = self . calcIF_selectall ) . grid ( row = 13 , column = 2 , columnspan = 2 , sticky = 'news' ) Button ( self . initwin , text = 'Add structure file(PDB/mol2)' ) . grid ( row = 13 , column = 4 ) Button ( self . initwin , text = 'Add extra titgroup in loaded structure' ) Button ( self . initwin , text = 'Cancel' , command = self . initwin . destroy ) . grid ( row = 13 , column = 5 , sticky = 'news' ) self . status = StringVar ( ) self . status . set ( 'Waiting...' ) Label ( self . initwin , text = 'Status:' ) . grid ( row = 14 , column = 0 ) Label ( self . initwin , textvariable = self . status ) . grid ( row = 14 , column = 1 ) Button ( self . initwin , text = 'Edit titgroup definitions' ) . grid ( row = 14 , column = 0 ) return
Initialise a pKa calculation
This involves getting the titratable groups
Initialise a pKa calculation This involves getting the titratable groups
"""Initialise a pKa calculation

        This involves getting the titratable groups""" # # Do we have a PDB file? # #if not self.pdbfilename: #    import tkMessageBox #    tkMessageBox.showwarning('No PDB file', #                             'You have to load a PDB file before performing a pKa calculation') #    return # # Open the file manager dialog # # # Open the window # # # # Start window # # # Listbox for all titratable groups # # # List containing the groups that are selected # # # Listbox for titratable groups to be included in calculation # # # Calculation engine setup # # # pH start, stop and step # # # OK and Cancel buttons # # # Button for defining titratable groups #
self