DNATool2/Base.py
def drawRestrictionSite(self, name, positions):
        """Draw restriction site(s) for a single enzyme"""
        c = self.canvas
        font = restrfont = str(self.restrfont)+' '+str(self.seqfontsize-2)
        done=[]
        if len(positions) == 1:
            #font = font+' underline'
            fill = '#FF9999'
        else:
            fill = '#F6FCE1'
        for pos in positions:
            uid = name+str(pos[0])
            self.restrictionsites[uid] = pos[0]
            if pos[0] in done: continue
            done.append(pos[0])
            x = self.getBasePosition(pos[0])
            y = self.baserow-self.siterowstart
            text = self.create_text(x,y,text=name,tags=(uid,'sitelabel','restrsite'),
                                        font=font,anchor='nw')

            x1,y1,x2,y2 = box = c.bbox(text)
            rect = c.create_rectangle(box,fill=fill,outline='gray',
                                        tags=(uid,'rect','restrsite'))
            items = c.find_withtag(uid)
            overlapping = c.find_overlapping(x1,y1,x2,y2)[:-2]
            #print pos, items, overlapping
            inc=-10
            while len(overlapping) > 1:
                for i in items:
                    c.move(i,0,inc)
                x1,y1,x2,y2 = c.bbox(i)
                overlapping = c.find_overlapping(x1,y1,x2,y2)[:-2]
                y=y+inc
            c.lift(text)
            self.drawSiteConnector(x,y,uid)
        return text
Draw restriction site(s) for a single enzyme
Draw restriction site(s) for a single enzyme
Draw restriction site ( s ) for a single enzyme
def drawRestrictionSite(self, name, positions):
        c = self.canvas
        font = restrfont = str(self.restrfont)+' '+str(self.seqfontsize-2)
        done=[]
        if len(positions) == 1:
            fill = '#FF9999'
        else:
            fill = '#F6FCE1'
        for pos in positions:
            uid = name+str(pos[0])
            self.restrictionsites[uid] = pos[0]
            if pos[0] in done: continue
            done.append(pos[0])
            x = self.getBasePosition(pos[0])
            y = self.baserow-self.siterowstart
            text = self.create_text(x,y,text=name,tags=(uid,'sitelabel','restrsite'),
                                        font=font,anchor='nw')
            x1,y1,x2,y2 = box = c.bbox(text)
            rect = c.create_rectangle(box,fill=fill,outline='gray',
                                        tags=(uid,'rect','restrsite'))
            items = c.find_withtag(uid)
            overlapping = c.find_overlapping(x1,y1,x2,y2)[:-2]
            inc=-10
            while len(overlapping) > 1:
                for i in items:
                    c.move(i,0,inc)
                x1,y1,x2,y2 = c.bbox(i)
                overlapping = c.find_overlapping(x1,y1,x2,y2)[:-2]
                y=y+inc
            c.lift(text)
            self.drawSiteConnector(x,y,uid)
        return text
def drawRestrictionSite ( self , name , positions ) : c = self . canvas font = restrfont = str ( self . restrfont ) + ' ' + str ( self . seqfontsize - 2 ) done = [ ] if len ( positions ) == 1 : fill = '#FF9999' else : fill = '#F6FCE1' for pos in positions : uid = name + str ( pos [ 0 ] ) self . restrictionsites [ uid ] = pos [ 0 ] if pos [ 0 ] in done : continue done . append ( pos [ 0 ] ) x = self . getBasePosition ( pos [ 0 ] ) y = self . baserow - self . siterowstart text = self . create_text ( x , y , text = name , tags = ( uid , 'sitelabel' , 'restrsite' ) , font = font , anchor = 'nw' ) x1 , y1 , x2 , y2 = box = c . bbox ( text ) rect = c . create_rectangle ( box , fill = fill , outline = 'gray' , tags = ( uid , 'rect' , 'restrsite' ) ) items = c . find_withtag ( uid ) overlapping = c . find_overlapping ( x1 , y1 , x2 , y2 ) [ : - 2 ] inc = - 10 while len ( overlapping ) > 1 : for i in items : c . move ( i , 0 , inc ) x1 , y1 , x2 , y2 = c . bbox ( i ) overlapping = c . find_overlapping ( x1 , y1 , x2 , y2 ) [ : - 2 ] y = y + inc c . lift ( text ) self . drawSiteConnector ( x , y , uid ) return text
Draw restriction site(s) for a single enzyme
Draw restriction site ( s ) for a single enzyme
"""Draw restriction site(s) for a single enzyme""" #font = font+' underline' #print pos, items, overlapping
self
name
positions