PEATDB/Mutate.py
def update_mut_selection(self, event=None):        
        """Update the data for the rest of the application"""
        
        if not hasattr(self,'structure_displayed'):
            self.structure_displayed=False
        
        newparent = self.parent.get()
        if newparent=='Select parent':
            newparent=None
        if newparent:
            aaseq=self.DB.get_protein_sequence(newparent)
            if aaseq:
                aaseq.sort()
                
                # Here we should change to allow for multiple chains                
                if newparent!=self.old_parent:
                    import string
                    number=string.split(aaseq[0][0],':')[1]
                    self.DT.resnum.set(number)
                    self.old_parent=newparent
                    
                    # If Yasara is started then delete the objects present                    
                    if self.yasara:
                        self.yasara.run('DelAll')
                        
                
                # Should we show the structure
                if DBActions.yasara != None:
                    pass
                #if int(self.show_struct.get())>0: # and self.yasara
                    
                    '''if not self.yasara_started:
                        print 'Setting up Yasara'
                        protein= self.DB[newparent]
                        DB = self.DB
                        if DB[newparent].has_key('Structure'):
                            import os
                            pdbname=os.path.join(os.getcwd(),'._pdbpipe')
                            fd=open(pdbname,'w')
                            fd.writelines(DB[protein]['Structure'])
                            fd.close()'''
             
                '''if self.yasara:
                    if self.yasara_started==1 and int(self.show_struct.get())>0:
                        
                        # Get Yasara to load the PDB file
                        
                        self.yasara.run('DelAll')
                        self.yasara.run('obj=LoadPDB %s' %pdbname)
                        self.yasara.run('Style Stick')
                        self.yasara.run('HideRes Hoh')
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('HUD Off')
                        self.structure_displayed=True
                elif self.yasara and int(self.show_struct.get())>0 and self.structure_displayed:
                        #
                        # Rotate Yasara's view to the new residue and colour it red
                        #
                        number=self.DT.resnum.get()
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('ColorRes %s,red' %(number))
                        if self.zoom_on_res.get()==1:
                            self.yasara.run('ZoomResidue %s,10' %str(number))'''
                        
                #self.update_mut_restext()
                name=self.suggest_name(self.parent.get(),
                                          self.DT.resnum.get(),
                                          self.DT.new_res.get(),
                                          self.DT.resname.get(),
                                          self.DT.chainID.get())
                self.new_name.set(name)
            else:
                import tkMessageBox
                tkMessageBox.showwarning('No protein sequence',
                                         'This parent has no protein sequence associated with it.\nI need a sequence to construct mutations!',
                                         parent=self.mut_win)
                return
        return
Update the data for the rest of the application
Update the data for the rest of the application
Update the data for the rest of the application
def update_mut_selection(self, event=None):        
        if not hasattr(self,'structure_displayed'):
            self.structure_displayed=False
        newparent = self.parent.get()
        if newparent=='Select parent':
            newparent=None
        if newparent:
            aaseq=self.DB.get_protein_sequence(newparent)
            if aaseq:
                aaseq.sort()
                if newparent!=self.old_parent:
                    import string
                    number=string.split(aaseq[0][0],':')[1]
                    self.DT.resnum.set(number)
                    self.old_parent=newparent
                    if self.yasara:
                        self.yasara.run('DelAll')
                if DBActions.yasara != None:
                    pass
                name=self.suggest_name(self.parent.get(),
                                          self.DT.resnum.get(),
                                          self.DT.new_res.get(),
                                          self.DT.resname.get(),
                                          self.DT.chainID.get())
                self.new_name.set(name)
            else:
                import tkMessageBox
                tkMessageBox.showwarning('No protein sequence',
                                         'This parent has no protein sequence associated with it.\nI need a sequence to construct mutations!',
                                         parent=self.mut_win)
                return
        return
def update_mut_selection ( self , event = None ) : if not hasattr ( self , 'structure_displayed' ) : self . structure_displayed = False newparent = self . parent . get ( ) if newparent == 'Select parent' : newparent = None if newparent : aaseq = self . DB . get_protein_sequence ( newparent ) if aaseq : aaseq . sort ( ) if newparent != self . old_parent : import string number = string . split ( aaseq [ 0 ] [ 0 ] , ':' ) [ 1 ] self . DT . resnum . set ( number ) self . old_parent = newparent if self . yasara : self . yasara . run ( 'DelAll' ) if DBActions . yasara != None : pass '''if not self.yasara_started:
                        print 'Setting up Yasara'
                        protein= self.DB[newparent]
                        DB = self.DB
                        if DB[newparent].has_key('Structure'):
                            import os
                            pdbname=os.path.join(os.getcwd(),'._pdbpipe')
                            fd=open(pdbname,'w')
                            fd.writelines(DB[protein]['Structure'])
                            fd.close()''' '''if self.yasara:
                    if self.yasara_started==1 and int(self.show_struct.get())>0:
                        
                        # Get Yasara to load the PDB file
                        
                        self.yasara.run('DelAll')
                        self.yasara.run('obj=LoadPDB %s' %pdbname)
                        self.yasara.run('Style Stick')
                        self.yasara.run('HideRes Hoh')
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('HUD Off')
                        self.structure_displayed=True
                elif self.yasara and int(self.show_struct.get())>0 and self.structure_displayed:
                        #
                        # Rotate Yasara's view to the new residue and colour it red
                        #
                        number=self.DT.resnum.get()
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('ColorRes %s,red' %(number))
                        if self.zoom_on_res.get()==1:
                            self.yasara.run('ZoomResidue %s,10' %str(number))''' name = self . suggest_name ( self . parent . get ( ) , self . DT . resnum . get ( ) , self . DT . new_res . get ( ) , self . DT . resname . get ( ) , self . DT . chainID . get ( ) ) self . new_name . set ( name ) else : import tkMessageBox tkMessageBox . showwarning ( 'No protein sequence' , 'This parent has no protein sequence associated with it.\nI need a sequence to construct mutations!' , parent = self . mut_win ) return return
Update the data for the rest of the application
Update the data for the rest of the application
"""Update the data for the rest of the application""" # Here we should change to allow for multiple chains                 # If Yasara is started then delete the objects present                     # Should we show the structure #if int(self.show_struct.get())>0: # and self.yasara '''if not self.yasara_started:
                        print 'Setting up Yasara'
                        protein= self.DB[newparent]
                        DB = self.DB
                        if DB[newparent].has_key('Structure'):
                            import os
                            pdbname=os.path.join(os.getcwd(),'._pdbpipe')
                            fd=open(pdbname,'w')
                            fd.writelines(DB[protein]['Structure'])
                            fd.close()''' '''if self.yasara:
                    if self.yasara_started==1 and int(self.show_struct.get())>0:
                        
                        # Get Yasara to load the PDB file
                        
                        self.yasara.run('DelAll')
                        self.yasara.run('obj=LoadPDB %s' %pdbname)
                        self.yasara.run('Style Stick')
                        self.yasara.run('HideRes Hoh')
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('HUD Off')
                        self.structure_displayed=True
                elif self.yasara and int(self.show_struct.get())>0 and self.structure_displayed:
                        #
                        # Rotate Yasara's view to the new residue and colour it red
                        #
                        number=self.DT.resnum.get()
                        self.yasara.run('ColorAll Green')
                        self.yasara.run('ColorRes %s,red' %(number))
                        if self.zoom_on_res.get()==1:
                            self.yasara.run('ZoomResidue %s,10' %str(number))''' #self.update_mut_restext()
self
event