PEATDB/Mutate.py
def update_mut_restext(self,event=None):
        """When adding a mutant: Update the text in the orgres field"""
        
        # Find the original residue in the sequence        
        if not self.parent.get():
            return
     
        CID=self.DT.chainID.get()        
        # Update the to and from bounds for the scale        
        seq=self.DB[self.parent.get()]
        thischain=[]
        for resnum,aa in seq:
            if resnum.split(':')[0]==CID:
                thischain.append([resnum,aa])
        if thischain==[]:
            self.DT.resname.set('Unknown')
            return
        min_resnum=thischain[0][0].split(':')[1]
        self.DT.mutscale.configure(from_=min_resnum)
        max_resnum=thischain[-1][0].split(':')[1]
        self.DT.mutscale.configure(to=max_resnum)
        #
        #
        orgres=None
        aa_number=self.DT.resnum.get() # Get the residue number
        import string
        search_resnum='%s:%s' %(CID,string.zfill(aa_number,4))

        for resnum,aa in thischain:
            if resnum==search_resnum:
                orgres=aa
        if orgres:
            self.DT.resname.set(orgres)
        else:
            self.DT.resname.set('Unknown')
        return
When adding a mutant: Update the text in the orgres field
When adding a mutant: Update the text in the orgres field
When adding a mutant : Update the text in the orgres field
def update_mut_restext(self,event=None):
        if not self.parent.get():
            return
        CID=self.DT.chainID.get()        
        seq=self.DB[self.parent.get()]
        thischain=[]
        for resnum,aa in seq:
            if resnum.split(':')[0]==CID:
                thischain.append([resnum,aa])
        if thischain==[]:
            self.DT.resname.set('Unknown')
            return
        min_resnum=thischain[0][0].split(':')[1]
        self.DT.mutscale.configure(from_=min_resnum)
        max_resnum=thischain[-1][0].split(':')[1]
        self.DT.mutscale.configure(to=max_resnum)
        orgres=None
        aa_number=self.DT.resnum.get()  Get the residue number
        import string
        search_resnum='%s:%s' %(CID,string.zfill(aa_number,4))
        for resnum,aa in thischain:
            if resnum==search_resnum:
                orgres=aa
        if orgres:
            self.DT.resname.set(orgres)
        else:
            self.DT.resname.set('Unknown')
        return
def update_mut_restext ( self , event = None ) : if not self . parent . get ( ) : return CID = self . DT . chainID . get ( ) seq = self . DB [ self . parent . get ( ) ] thischain = [ ] for resnum , aa in seq : if resnum . split ( ':' ) [ 0 ] == CID : thischain . append ( [ resnum , aa ] ) if thischain == [ ] : self . DT . resname . set ( 'Unknown' ) return min_resnum = thischain [ 0 ] [ 0 ] . split ( ':' ) [ 1 ] self . DT . mutscale . configure ( from_ = min_resnum ) max_resnum = thischain [ - 1 ] [ 0 ] . split ( ':' ) [ 1 ] self . DT . mutscale . configure ( to = max_resnum ) orgres = None aa_number = self . DT . resnum . get ( ) import string search_resnum = '%s:%s' % ( CID , string . zfill ( aa_number , 4 ) ) for resnum , aa in thischain : if resnum == search_resnum : orgres = aa if orgres : self . DT . resname . set ( orgres ) else : self . DT . resname . set ( 'Unknown' ) return
When adding a mutant: Update the text in the orgres field
When adding a mutant : Update the text in the orgres field
"""When adding a mutant: Update the text in the orgres field""" # Find the original residue in the sequence         # Update the to and from bounds for the scale         # # # Get the residue number
self
event