pKaTool/multiple_calc_analysis.py
def display_sequence(self,calculation,calculation_name,seq_num,alignedseq=None):
        """Display a single sequence in the window"""
        y_spacing=15
        y=20+seq_num*y_spacing
        x_start=100
        spacing=9
        count=0
        display_count=0
        aligncount=0
        self.canv.create_text(0,y,text=calculation_name,anchor='nw')
        for aanum,restype in calculation['sequence']:
            aa1=self.aas[restype]
            #
            # If we have an alignment then skip forward until we have a residue
            #
            if alignedseq:
                #print alignedseq[aligncount],aa1,count,aligncount
                if alignedseq[aligncount]==aa1:
                    pass
                else:
                    if alignedseq[aligncount]!='-':
                        #print alignedseq[aligncount]
                        #print alignedseq
                        print 'error in alignment'
                        #print calculation['sequence']
                        stop
                    else:
                        while alignedseq[aligncount]=='-':
                            x=x_start+display_count*spacing
                            self.sequencesobjs.append(self.canv.create_text(x,y,text='-',fill='black',anchor='nw'))
                            aligncount=aligncount+1
                            display_count=display_count+1
                            #print 'scanning, aligncount: ',aligncount,alignedseq[aligncount]
            #
            # Found the residue, now print
            #
            x=x_start+display_count*spacing

            colour_val=self.colour_function(calculation,aanum,restype)
            if colour_val=='nontit':
                colour='grey'
            elif colour_val:
                colour=self.get_colour_fromval(colour_val)
            else:
                colour='yellow'
                
            self.sequencesobjs.append(self.canv.create_rectangle(x,y,x+spacing,y+y_spacing,fill=colour,outline='white'))
            self.sequencesobjs.append(self.canv.create_text(x,y,text=aa1,fill='black',anchor='nw'))
            count=count+1
            display_count=display_count+1
            if alignedseq:
                aligncount=aligncount+1
        return
Display a single sequence in the window
Display a single sequence in the window
Display a single sequence in the window
def display_sequence(self,calculation,calculation_name,seq_num,alignedseq=None):
        y_spacing=15
        y=20+seq_num*y_spacing
        x_start=100
        spacing=9
        count=0
        display_count=0
        aligncount=0
        self.canv.create_text(0,y,text=calculation_name,anchor='nw')
        for aanum,restype in calculation['sequence']:
            aa1=self.aas[restype]
             If we have an alignment then skip forward until we have a residue
            if alignedseq:
                print alignedseq[aligncount],aa1,count,aligncount
                if alignedseq[aligncount]==aa1:
                    pass
                else:
                    if alignedseq[aligncount]!='-':
                        print alignedseq[aligncount]
                        print alignedseq
                        print 'error in alignment'
                        print calculation['sequence']
                        stop
                    else:
                        while alignedseq[aligncount]=='-':
                            x=x_start+display_count*spacing
                            self.sequencesobjs.append(self.canv.create_text(x,y,text='-',fill='black',anchor='nw'))
                            aligncount=aligncount+1
                            display_count=display_count+1
                            print 'scanning, aligncount: ',aligncount,alignedseq[aligncount]
             Found the residue, now print
            x=x_start+display_count*spacing
            colour_val=self.colour_function(calculation,aanum,restype)
            if colour_val=='nontit':
                colour='grey'
            elif colour_val:
                colour=self.get_colour_fromval(colour_val)
            else:
                colour='yellow'
            self.sequencesobjs.append(self.canv.create_rectangle(x,y,x+spacing,y+y_spacing,fill=colour,outline='white'))
            self.sequencesobjs.append(self.canv.create_text(x,y,text=aa1,fill='black',anchor='nw'))
            count=count+1
            display_count=display_count+1
            if alignedseq:
                aligncount=aligncount+1
        return
def display_sequence ( self , calculation , calculation_name , seq_num , alignedseq = None ) : y_spacing = 15 y = 20 + seq_num * y_spacing x_start = 100 spacing = 9 count = 0 display_count = 0 aligncount = 0 self . canv . create_text ( 0 , y , text = calculation_name , anchor = 'nw' ) for aanum , restype in calculation [ 'sequence' ] : aa1 = self . aas [ restype ] if alignedseq : if alignedseq [ aligncount ] == aa1 : pass else : if alignedseq [ aligncount ] != '-' : print 'error in alignment' stop else : while alignedseq [ aligncount ] == '-' : x = x_start + display_count * spacing self . sequencesobjs . append ( self . canv . create_text ( x , y , text = '-' , fill = 'black' , anchor = 'nw' ) ) aligncount = aligncount + 1 display_count = display_count + 1 x = x_start + display_count * spacing colour_val = self . colour_function ( calculation , aanum , restype ) if colour_val == 'nontit' : colour = 'grey' elif colour_val : colour = self . get_colour_fromval ( colour_val ) else : colour = 'yellow' self . sequencesobjs . append ( self . canv . create_rectangle ( x , y , x + spacing , y + y_spacing , fill = colour , outline = 'white' ) ) self . sequencesobjs . append ( self . canv . create_text ( x , y , text = aa1 , fill = 'black' , anchor = 'nw' ) ) count = count + 1 display_count = display_count + 1 if alignedseq : aligncount = aligncount + 1 return
Display a single sequence in the window
Display a single sequence in the window
"""Display a single sequence in the window""" # # If we have an alignment then skip forward until we have a residue # #print alignedseq[aligncount],aa1,count,aligncount #print alignedseq[aligncount] #print alignedseq #print calculation['sequence'] #print 'scanning, aligncount: ',aligncount,alignedseq[aligncount] # # Found the residue, now print #
self
calculation
calculation_name
seq_num
alignedseq