pKaTool/pKacalc_interface.py
def load_frompKD(self,event=None):
        """Load calculated pKa values from the pKD server"""
        self.pKD_IFwin=Toplevel()
        self.set_position(self.pKD_IFwin)
        self.pKD_IFwin.title('pKD server connection')
        self.URL='/cgi-bin/pKD/pKaDesign_server.py'
        self.HOST='enzyme.ucd.ie'
        self.PORT='80'
        Label(self.pKD_IFwin,text='pKD server at: http://%s:%s%s' %(self.HOST,self.PORT,self.URL),bg='green').grid(row=0,column=0)
        #
        # Get the list of proteins that are prepared
        #
        request ={}
        X=HTTP_handler(self.URL,self.HOST,self.PORT)
        request['action']='get_prepared_proteins'
        request['client']='PKATOOL'
        X.load(request)
        lines=X.request(return_type='file-object')
        #
        # Parse the XML
        #
        proteins=[]
        from xml.dom import minidom
        xmldoc=minidom.parse(lines)
        prot_sec=xmldoc.firstChild
        for calc in prot_sec.childNodes:
            ID=calc.attributes['id'].value
            for attr in calc.childNodes:
                if attr.nodeName=='info':
                    import string
                    if len(attr.childNodes)>0:
                        info=string.strip(attr.childNodes[0].data)
                    else:
                        info='No info'
            proteins.append([ID,info,None])
        import string
        #
        # Calculations found
        #
        Label(self.pKD_IFwin,text='Calculations on the pKD server').grid(row=1,column=0)
        row=2
        yscrollbar=Scrollbar(self.pKD_IFwin,orient='vertical',width=14)
        yscrollbar.grid(row=row,column=2,sticky='nws',rowspan=5)
        self.calculations=Listbox(self.pKD_IFwin,
                                  bg='white',
                                  fg='black',
                                  height=10,width=15,yscrollcommand=yscrollbar.set,
                                  selectmode=MULTIPLE)
        self.calculations.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,rowspan=5)
        yscrollbar.config(command=self.calculations.yview)
        #
        # Sort the calcs and insert them
        #
        self.calculations_ready=proteins
        self.calculations_ready.sort()
        self.calcs_displayed=self.calculations_ready
        for calcname,info,setup in self.calculations_ready:
            self.calculations.insert(END,'%6s: %25s' %(calcname,info[:45]))
        #
        # Box with details
        #
        self.searchtext=StringVar()
        l=Label(self.pKD_IFwin,text='Search ')
        l.grid(row=row,column=3,sticky='nes')
        self.searchbox=Entry(self.pKD_IFwin,textvariable=self.searchtext)
        self.searchbox.grid(row=row,column=4,sticky='w')
        self.searchbox.bind('<Return>',self.do_search)
        #
        #
        row=row+1
        lbl=Label(self.pKD_IFwin,text='this is where details on the calcs will go in the future')
        lbl.grid(row=row,column=3,columnspan=5)
        #
        # Buttons for selecting
        #
        row=row+6
        Button(self.pKD_IFwin,text='Select All',command=self.pKDselect_all).grid(row=row,column=0)
        Button(self.pKD_IFwin,text='Clear selection',command=self.pKDselect_none).grid(row=row,column=1)
        #
        # Button for loading calculation
        #
        row=row+1
        self.singlebutton=Button(self.pKD_IFwin,text='Load calculation(s)',command=self.do_load_pKDcalcs)
        self.singlebutton.grid(row=row,column=0)
        Button(self.pKD_IFwin,text='Cancel',command=self.pKD_IFwin.destroy).grid(row=row,column=1)
        return
Load calculated pKa values from the pKD server
Load calculated pKa values from the pKD server
Load calculated pKa values from the pKD server
def load_frompKD(self,event=None):
        self.pKD_IFwin=Toplevel()
        self.set_position(self.pKD_IFwin)
        self.pKD_IFwin.title('pKD server connection')
        self.URL='/cgi-bin/pKD/pKaDesign_server.py'
        self.HOST='enzyme.ucd.ie'
        self.PORT='80'
        Label(self.pKD_IFwin,text='pKD server at: http://%s:%s%s' %(self.HOST,self.PORT,self.URL),bg='green').grid(row=0,column=0)
         Get the list of proteins that are prepared
        request ={}
        X=HTTP_handler(self.URL,self.HOST,self.PORT)
        request['action']='get_prepared_proteins'
        request['client']='PKATOOL'
        X.load(request)
        lines=X.request(return_type='file-object')
         Parse the XML
        proteins=[]
        from xml.dom import minidom
        xmldoc=minidom.parse(lines)
        prot_sec=xmldoc.firstChild
        for calc in prot_sec.childNodes:
            ID=calc.attributes['id'].value
            for attr in calc.childNodes:
                if attr.nodeName=='info':
                    import string
                    if len(attr.childNodes)>0:
                        info=string.strip(attr.childNodes[0].data)
                    else:
                        info='No info'
            proteins.append([ID,info,None])
        import string
         Calculations found
        Label(self.pKD_IFwin,text='Calculations on the pKD server').grid(row=1,column=0)
        row=2
        yscrollbar=Scrollbar(self.pKD_IFwin,orient='vertical',width=14)
        yscrollbar.grid(row=row,column=2,sticky='nws',rowspan=5)
        self.calculations=Listbox(self.pKD_IFwin,
                                  bg='white',
                                  fg='black',
                                  height=10,width=15,yscrollcommand=yscrollbar.set,
                                  selectmode=MULTIPLE)
        self.calculations.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,rowspan=5)
        yscrollbar.config(command=self.calculations.yview)
         Sort the calcs and insert them
        self.calculations_ready=proteins
        self.calculations_ready.sort()
        self.calcs_displayed=self.calculations_ready
        for calcname,info,setup in self.calculations_ready:
            self.calculations.insert(END,'%6s: %25s' %(calcname,info[:45]))
         Box with details
        self.searchtext=StringVar()
        l=Label(self.pKD_IFwin,text='Search ')
        l.grid(row=row,column=3,sticky='nes')
        self.searchbox=Entry(self.pKD_IFwin,textvariable=self.searchtext)
        self.searchbox.grid(row=row,column=4,sticky='w')
        self.searchbox.bind('<Return>',self.do_search)
        row=row+1
        lbl=Label(self.pKD_IFwin,text='this is where details on the calcs will go in the future')
        lbl.grid(row=row,column=3,columnspan=5)
         Buttons for selecting
        row=row+6
        Button(self.pKD_IFwin,text='Select All',command=self.pKDselect_all).grid(row=row,column=0)
        Button(self.pKD_IFwin,text='Clear selection',command=self.pKDselect_none).grid(row=row,column=1)
         Button for loading calculation
        row=row+1
        self.singlebutton=Button(self.pKD_IFwin,text='Load calculation(s)',command=self.do_load_pKDcalcs)
        self.singlebutton.grid(row=row,column=0)
        Button(self.pKD_IFwin,text='Cancel',command=self.pKD_IFwin.destroy).grid(row=row,column=1)
        return
def load_frompKD ( self , event = None ) : self . pKD_IFwin = Toplevel ( ) self . set_position ( self . pKD_IFwin ) self . pKD_IFwin . title ( 'pKD server connection' ) self . URL = '/cgi-bin/pKD/pKaDesign_server.py' self . HOST = 'enzyme.ucd.ie' self . PORT = '80' Label ( self . pKD_IFwin , text = 'pKD server at: http://%s:%s%s' % ( self . HOST , self . PORT , self . URL ) , bg = 'green' ) . grid ( row = 0 , column = 0 ) request = { } X = HTTP_handler ( self . URL , self . HOST , self . PORT ) request [ 'action' ] = 'get_prepared_proteins' request [ 'client' ] = 'PKATOOL' X . load ( request ) lines = X . request ( return_type = 'file-object' ) proteins = [ ] from xml . dom import minidom xmldoc = minidom . parse ( lines ) prot_sec = xmldoc . firstChild for calc in prot_sec . childNodes : ID = calc . attributes [ 'id' ] . value for attr in calc . childNodes : if attr . nodeName == 'info' : import string if len ( attr . childNodes ) > 0 : info = string . strip ( attr . childNodes [ 0 ] . data ) else : info = 'No info' proteins . append ( [ ID , info , None ] ) import string Label ( self . pKD_IFwin , text = 'Calculations on the pKD server' ) . grid ( row = 1 , column = 0 ) row = 2 yscrollbar = Scrollbar ( self . pKD_IFwin , orient = 'vertical' , width = 14 ) yscrollbar . grid ( row = row , column = 2 , sticky = 'nws' , rowspan = 5 ) self . calculations = Listbox ( self . pKD_IFwin , bg = 'white' , fg = 'black' , height = 10 , width = 15 , yscrollcommand = yscrollbar . set , selectmode = MULTIPLE ) self . calculations . grid ( row = row , column = 0 , columnspan = 2 , sticky = 'news' , padx = 2 , rowspan = 5 ) yscrollbar . config ( command = self . calculations . yview ) self . calculations_ready = proteins self . calculations_ready . sort ( ) self . calcs_displayed = self . calculations_ready for calcname , info , setup in self . calculations_ready : self . calculations . insert ( END , '%6s: %25s' % ( calcname , info [ : 45 ] ) ) self . searchtext = StringVar ( ) l = Label ( self . pKD_IFwin , text = 'Search ' ) l . grid ( row = row , column = 3 , sticky = 'nes' ) self . searchbox = Entry ( self . pKD_IFwin , textvariable = self . searchtext ) self . searchbox . grid ( row = row , column = 4 , sticky = 'w' ) self . searchbox . bind ( '<Return>' , self . do_search ) row = row + 1 lbl = Label ( self . pKD_IFwin , text = 'this is where details on the calcs will go in the future' ) lbl . grid ( row = row , column = 3 , columnspan = 5 ) row = row + 6 Button ( self . pKD_IFwin , text = 'Select All' , command = self . pKDselect_all ) . grid ( row = row , column = 0 ) Button ( self . pKD_IFwin , text = 'Clear selection' , command = self . pKDselect_none ) . grid ( row = row , column = 1 ) row = row + 1 self . singlebutton = Button ( self . pKD_IFwin , text = 'Load calculation(s)' , command = self . do_load_pKDcalcs ) self . singlebutton . grid ( row = row , column = 0 ) Button ( self . pKD_IFwin , text = 'Cancel' , command = self . pKD_IFwin . destroy ) . grid ( row = row , column = 1 ) return
Load calculated pKa values from the pKD server
Load calculated pKa values from the pKD server
"""Load calculated pKa values from the pKD server""" # # Get the list of proteins that are prepared # # # Parse the XML # # # Calculations found # # # Sort the calcs and insert them # # # Box with details # # # # # Buttons for selecting # # # Button for loading calculation #
self
event