PEATDB/Actions.py
def checkPDBSequence(self, name):
        """Check the PDB sequence against a newly added structure, optional.
           Adds the amino acid seq of the PDB file, overwriting the old one"""
        # Extract the sequence
        import sequence_alignment
        pdb_1,ignored_res1=sequence_alignment.Protool2pir(self.X.sequence)
        print 'IGNORED',ignored_res1
        if ignored_res1!={}:
            igroups=ignored_res1.keys()
            igroups.sort()
            import tkMessageBox
            tkMessageBox.showwarning('Unknown entities in PDB file',
                                     'I ignored the following residue types/molecules in the PDB file:\n%s' %(str(igroups)))

        # Get the entry sequence
        accept_alignment_automatically=None
        record_AA = DB.get_AA_sequence(name)
        if record_AA:
            record_AA1,ignored_res=sequence_alignment.Protool2pir(record_AA)
        
        # If we do not have an amino acid sequence for the record, then
        # we simply use the one from the PDB file and accept the alignment
        # straight away
        accept_alignment_automatically=1
        import copy
        record_AA1=copy.deepcopy(pdb_1)

        # Also deposit the amino acid sequence in the protein record
        
        DB.data[name]['aaseq'] = copy.deepcopy(self.X.sequence)

        # Align the two sequences
        NW_align = sequence_alignment.NW(pdb_1,record_AA1)
        al_pdb,al_record,map_pdb,map_record = NW_align.Align()
        self.al_pdb = al_pdb
        self.al_record = al_record

        # Find regions of overlap

        ids=0
        for count in range(len(al_pdb)):
            res_pdb=al_pdb[count]
            res_rec=al_record[count]
            if res_pdb==res_rec:
                ids=ids+1
        print 'Sequence identity %5.3f' %(100.0*float(ids)/float(len(al_pdb)))
        AlignmentMap = {}
        AlignmentMap['OrigAa']=al_record
        AlignmentMap['AlignedAa']=al_pdb     

        #Make alignment window
        AlignWindow=Toplevel()
        self.AlingWindow=AlignWindow
        AlignWindow.geometry('+100+200')
        AlignWindow.title('Please check alignment')
        AlignWindow.button = Button(AlignWindow,
                                    {"text": "Alignment OK", "fg": "black",
                                     "command":storePDB})
        AlignWindow.button.grid(row=3,column=0)
        AlignWindow.button = Button(AlignWindow,
                                    {"text": "Alignment not OK", "fg": "black",
                                     "command": AlignWindow.destroy})
        AlignWindow.button.grid(row=3,column=1)
        AlignWindow.Slider=Scrollbar(AlignWindow,orient=HORIZONTAL)
        AlignWindow.Slider.grid(row=1,column=0,sticky='news',columnspan=2)

        listbox = Listbox(AlignWindow,{"height": 2,"width":80,"font":"courier 14"})
        listbox.insert('end',"PEAT_DB record: "+al_record)
        listbox.insert('end',"PDB file      : "+al_pdb)
        listbox.grid(row=0,column=0,columnspan=2)
        listbox.config(xscrollcommand=AlignWindow.Slider.set)
        AlignWindow.Slider.config(command=listbox.xview)
        return AlignmentMap
Check the PDB sequence against a newly added structure, optional.
           Adds the amino acid seq of the PDB file, overwriting the old one
Check the PDB sequence against a newly added structure, optional.
Adds the amino acid seq of the PDB file, overwriting the old one
Check the PDB sequence against a newly added structure optional . Adds the amino acid seq of the PDB file overwriting the old one
def checkPDBSequence(self, name):
        import sequence_alignment
        pdb_1,ignored_res1=sequence_alignment.Protool2pir(self.X.sequence)
        print 'IGNORED',ignored_res1
        if ignored_res1!={}:
            igroups=ignored_res1.keys()
            igroups.sort()
            import tkMessageBox
            tkMessageBox.showwarning('Unknown entities in PDB file',
                                     'I ignored the following residue types/molecules in the PDB file:\n%s' %(str(igroups)))
        accept_alignment_automatically=None
        record_AA = DB.get_AA_sequence(name)
        if record_AA:
            record_AA1,ignored_res=sequence_alignment.Protool2pir(record_AA)
        accept_alignment_automatically=1
        import copy
        record_AA1=copy.deepcopy(pdb_1)
        DB.data[name]['aaseq'] = copy.deepcopy(self.X.sequence)
        NW_align = sequence_alignment.NW(pdb_1,record_AA1)
        al_pdb,al_record,map_pdb,map_record = NW_align.Align()
        self.al_pdb = al_pdb
        self.al_record = al_record
        ids=0
        for count in range(len(al_pdb)):
            res_pdb=al_pdb[count]
            res_rec=al_record[count]
            if res_pdb==res_rec:
                ids=ids+1
        print 'Sequence identity %5.3f' %(100.0*float(ids)/float(len(al_pdb)))
        AlignmentMap = {}
        AlignmentMap['OrigAa']=al_record
        AlignmentMap['AlignedAa']=al_pdb     
        AlignWindow=Toplevel()
        self.AlingWindow=AlignWindow
        AlignWindow.geometry('+100+200')
        AlignWindow.title('Please check alignment')
        AlignWindow.button = Button(AlignWindow,
                                    {"text": "Alignment OK", "fg": "black",
                                     "command":storePDB})
        AlignWindow.button.grid(row=3,column=0)
        AlignWindow.button = Button(AlignWindow,
                                    {"text": "Alignment not OK", "fg": "black",
                                     "command": AlignWindow.destroy})
        AlignWindow.button.grid(row=3,column=1)
        AlignWindow.Slider=Scrollbar(AlignWindow,orient=HORIZONTAL)
        AlignWindow.Slider.grid(row=1,column=0,sticky='news',columnspan=2)
        listbox = Listbox(AlignWindow,{"height": 2,"width":80,"font":"courier 14"})
        listbox.insert('end',"PEAT_DB record: "+al_record)
        listbox.insert('end',"PDB file      : "+al_pdb)
        listbox.grid(row=0,column=0,columnspan=2)
        listbox.config(xscrollcommand=AlignWindow.Slider.set)
        AlignWindow.Slider.config(command=listbox.xview)
        return AlignmentMap
def checkPDBSequence ( self , name ) : import sequence_alignment pdb_1 , ignored_res1 = sequence_alignment . Protool2pir ( self . X . sequence ) print 'IGNORED' , ignored_res1 if ignored_res1 != { } : igroups = ignored_res1 . keys ( ) igroups . sort ( ) import tkMessageBox tkMessageBox . showwarning ( 'Unknown entities in PDB file' , 'I ignored the following residue types/molecules in the PDB file:\n%s' % ( str ( igroups ) ) ) accept_alignment_automatically = None record_AA = DB . get_AA_sequence ( name ) if record_AA : record_AA1 , ignored_res = sequence_alignment . Protool2pir ( record_AA ) accept_alignment_automatically = 1 import copy record_AA1 = copy . deepcopy ( pdb_1 ) DB . data [ name ] [ 'aaseq' ] = copy . deepcopy ( self . X . sequence ) NW_align = sequence_alignment . NW ( pdb_1 , record_AA1 ) al_pdb , al_record , map_pdb , map_record = NW_align . Align ( ) self . al_pdb = al_pdb self . al_record = al_record ids = 0 for count in range ( len ( al_pdb ) ) : res_pdb = al_pdb [ count ] res_rec = al_record [ count ] if res_pdb == res_rec : ids = ids + 1 print 'Sequence identity %5.3f' % ( 100.0 * float ( ids ) / float ( len ( al_pdb ) ) ) AlignmentMap = { } AlignmentMap [ 'OrigAa' ] = al_record AlignmentMap [ 'AlignedAa' ] = al_pdb AlignWindow = Toplevel ( ) self . AlingWindow = AlignWindow AlignWindow . geometry ( '+100+200' ) AlignWindow . title ( 'Please check alignment' ) AlignWindow . button = Button ( AlignWindow , { "text" : "Alignment OK" , "fg" : "black" , "command" : storePDB } ) AlignWindow . button . grid ( row = 3 , column = 0 ) AlignWindow . button = Button ( AlignWindow , { "text" : "Alignment not OK" , "fg" : "black" , "command" : AlignWindow . destroy } ) AlignWindow . button . grid ( row = 3 , column = 1 ) AlignWindow . Slider = Scrollbar ( AlignWindow , orient = HORIZONTAL ) AlignWindow . Slider . grid ( row = 1 , column = 0 , sticky = 'news' , columnspan = 2 ) listbox = Listbox ( AlignWindow , { "height" : 2 , "width" : 80 , "font" : "courier 14" } ) listbox . insert ( 'end' , "PEAT_DB record: " + al_record ) listbox . insert ( 'end' , "PDB file      : " + al_pdb ) listbox . grid ( row = 0 , column = 0 , columnspan = 2 ) listbox . config ( xscrollcommand = AlignWindow . Slider . set ) AlignWindow . Slider . config ( command = listbox . xview ) return AlignmentMap
Check the PDB sequence against a newly added structure, optional.
Check the PDB sequence against a newly added structure optional .
"""Check the PDB sequence against a newly added structure, optional.
           Adds the amino acid seq of the PDB file, overwriting the old one""" # Extract the sequence # Get the entry sequence # If we do not have an amino acid sequence for the record, then # we simply use the one from the PDB file and accept the alignment # straight away # Also deposit the amino acid sequence in the protein record # Align the two sequences # Find regions of overlap #Make alignment window
self
name