PEATDB/Mutate.py
def enter_mut_data(self,event=None):
        """Process the data from the 'Add mutant' dialog and enter it into the Database"""

        orgres=None
        aa_number=self.DT.resnum.get() # Get the residue number
        seq=self.DB[self.parent.get()].aaseq
        if seq:
            for res in seq:
                num=int(res[0].split(':')[1])
                if num==aa_number:
                    orgres=res[1]
        else:
            import tkMessageBox
            tkMessageBox.showwarning('No sequence',
                                     'This parent protein does not have a sequence.\nI cannot add this mutant',
                                     parent=self.mut_win)
            return
        if not orgres:
            seq.sort()
            import tkMessageBox
            tkMessageBox.showwarning('Invalid sequence number',
                                     'Please give a sequence number from %s to %s' %(seq[0][0].split(':')[1],
                                                                                     seq[-1][0].split(':')[1]))
            return
        
        # Check the name        
        protein_name=self.new_name.get()
        if self.data['DBinstance'].is_known_protein(protein_name):
            import tkMessageBox
            tkMessageBox.showwarning('Name already in use',
                                     '%s is already in use. Please select a unique name' %protein_name)
            return 
        
        # Enter the data        
        self.enter_mut=1
        self.mut_win.destroy()
        return
Process the data from the 'Add mutant' dialog and enter it into the Database
Process the data from the 'Add mutant' dialog and enter it into the Database
Process the data from the ' Add mutant ' dialog and enter it into the Database
def enter_mut_data(self,event=None):
        orgres=None
        aa_number=self.DT.resnum.get() 
        seq=self.DB[self.parent.get()].aaseq
        if seq:
            for res in seq:
                num=int(res[0].split(':')[1])
                if num==aa_number:
                    orgres=res[1]
        else:
            import tkMessageBox
            tkMessageBox.showwarning('No sequence',
                                     'This parent protein does not have a sequence.\nI cannot add this mutant',
                                     parent=self.mut_win)
            return
        if not orgres:
            seq.sort()
            import tkMessageBox
            tkMessageBox.showwarning('Invalid sequence number',
                                     'Please give a sequence number from %s to %s' %(seq[0][0].split(':')[1],
                                                                                     seq[-1][0].split(':')[1]))
            return
        protein_name=self.new_name.get()
        if self.data['DBinstance'].is_known_protein(protein_name):
            import tkMessageBox
            tkMessageBox.showwarning('Name already in use',
                                     '%s is already in use. Please select a unique name' %protein_name)
            return 
        self.enter_mut=1
        self.mut_win.destroy()
        return
def enter_mut_data ( self , event = None ) : orgres = None aa_number = self . DT . resnum . get ( ) seq = self . DB [ self . parent . get ( ) ] . aaseq if seq : for res in seq : num = int ( res [ 0 ] . split ( ':' ) [ 1 ] ) if num == aa_number : orgres = res [ 1 ] else : import tkMessageBox tkMessageBox . showwarning ( 'No sequence' , 'This parent protein does not have a sequence.\nI cannot add this mutant' , parent = self . mut_win ) return if not orgres : seq . sort ( ) import tkMessageBox tkMessageBox . showwarning ( 'Invalid sequence number' , 'Please give a sequence number from %s to %s' % ( seq [ 0 ] [ 0 ] . split ( ':' ) [ 1 ] , seq [ - 1 ] [ 0 ] . split ( ':' ) [ 1 ] ) ) return protein_name = self . new_name . get ( ) if self . data [ 'DBinstance' ] . is_known_protein ( protein_name ) : import tkMessageBox tkMessageBox . showwarning ( 'Name already in use' , '%s is already in use. Please select a unique name' % protein_name ) return self . enter_mut = 1 self . mut_win . destroy ( ) return
Process the data from the 'Add mutant' dialog and enter it into the Database
Process the data from the ' Add mutant ' dialog and enter it into the Database
"""Process the data from the 'Add mutant' dialog and enter it into the Database""" # Get the residue number # Check the name         # Enter the data        
self
event