Ejemplo n.º 1
0
	def __init__(self, parent, id):
	
		# object to store our cacluations over time
		self.plasmidstore 		= plasmidstore()		
		self.radius 			= 25								# cairo unit
		self.radiusI 			= self.radius - 0.013 * self.radius	# cairo unit
		self.radiusO 			= self.radius + 0.013 * self.radius	# cairo unit
		self.radiusLabels 		= self.radius + 17 					# cairo unit
		self.arrowWidth 		= 1.8 								# cairo unit
		self.labelHeight 		= 12 								# pixel
		

		self.Highlight 			= None								# store who to highlight
		self.enzymeGap			= "-|-"								# seperator to make unique hitname less unique
		
		#self.EnzymeMonitor = Monitor()
		
		# start the window
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)
		
		# bind events
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_MOTION, self.OnMotion)
		self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDouble)


		
	
		
		return None
Ejemplo n.º 2
0
	def __init__(self, parent, id):
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)

		genbank.dna_selection = (1,1)

		self.centre_x = 0
		self.centre_y = 0
		self.highlighted_feature = False
		
	

		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
		self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
		self.Bind(wx.EVT_MOTION, self.OnMotion)
		self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDouble)


		#determing which listening group from which to recieve messages about UI updates
		self.listening_group = 'from_feature_list' #needs to be assigned or will raise an error		
		pub.Publisher.subscribe(self.listen_to_updateUI, self.listening_group)

		self.listening_group2 = 'from_feature_edit'		
		pub.Publisher.subscribe(self.listen_to_updateUI, self.listening_group2)		

		self.listening_group3 = 'from_dna_edit'		
		pub.Publisher.subscribe(self.listen_to_updateUI, self.listening_group3)	

		self.listening_group4 = 'from_main'
		pub.Publisher.subscribe(self.listen_to_updateUI, self.listening_group4)

		self.listening_group5 = 'private_group_for_those_that_affect_DNA_selection_from_DNA_editor'
		pub.Publisher.subscribe(self.listen_to_updateUI, self.listening_group5)
Ejemplo n.º 3
0
	def __init__(self, parent, id):
		
		# load options into self.opt
		self.opt = options.options()

		# variables to store current events like highlight etc.
		# for hover and click
		self.hittest = {}			# to store the hittest paths
		self.Highlight 		= None		# hightlight this on move
		self.HighlightClick 	= None		# hightlight constantly
		
		# for selection
		self.selectionDrawing  		= []
		self.selectionDrawingDirection 	= "right"
		self.selectionDrawingDiff	= 0
		
		# initialise the window
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)

		self.parent = parent
	
		genbank.dna_selection = (1,1)

		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
		#self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
		self.Bind(wx.EVT_MOTION, self.OnMotion)
Ejemplo n.º 4
0
	def __init__(self, parent, id):
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)

		self.parent = parent
	
		genbank.dna_selection = (1,1)

		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
		self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
		self.Bind(wx.EVT_MOTION, self.OnMotion)
		self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDouble)
Ejemplo n.º 5
0
    def __init__(self, parent, id):

        #parent
        self.parent = parent

        # get data
        self.dna = genbank.gb.GetDNA()
        self.cdna = genbank.gb.GetDNA()

        # settings for the editor
        self.sY = 60  # offset top
        self.dX = 8  # border left and right
        self.textSpacing = 80  # seperation of lines
        self.fontsize = 9  # line size
        self.lineGap = 6

        # interactive cursor
        self.PositionPointer = 1
        self.PositionPointerEnd = False

        # initial minimal height of the editor
        self.minHeight = 200

        # storage dict, to prevent recalculating to much
        self.cairoStorage = {
            'features': None,  # feature Object
            'fPaths': [],  # path of alls features as List
            'cursorPath': None,
            'cursor': None,
            'enzymes': {},  # enzymes object
            'ePaths': [],  # enzymes drawn
            'ticks': None,  # ticks object --> self.dna
            'tPaths': []  # ticks drawn		
        }

        # call window
        DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)

        # bind events
        self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDouble)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
        self.Bind(wx.EVT_MOTION,
                  self.OnMotion)  # drag and drop, selection etc.
        self.Bind(
            wx.EVT_KEY_DOWN, self.OnKeyPress
        )  #This is important for controlling the input into the editor
Ejemplo n.º 6
0
	def __init__(self, parent, id):
		
		#parent
		self.parent = parent
		
		# get data
		self.dna 			= genbank.gb.GetDNA()
		self.cdna 			= genbank.gb.GetDNA()

		# settings for the editor 
		self.sY				= 60	# offset top
		self.dX				= 8 	# border left and right
		self.textSpacing 	= 80	# seperation of lines
		self.fontsize 		= 9		# line size
		self.lineGap 		= 6
		
		# interactive cursor
		self.PositionPointer 		= 1
		self.PositionPointerEnd 	= False
		
		# initial minimal height of the editor 
		self.minHeight = 200
		
		# storage dict, to prevent recalculating to much
		self.cairoStorage = {
				'features'	: None, # feature Object
				'fPaths' 	: [], 	# path of alls features as List
				'cursorPath': None,
				'cursor'	: None,
				'enzymes'	: {},	# enzymes object
				'ePaths'	: [],	# enzymes drawn
				'ticks'		: None,	# ticks object --> self.dna
				'tPaths'	: []	# ticks drawn		
		}
		
		
		
		# call window
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)

		# bind events
		self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDouble)
		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
		self.Bind(wx.EVT_MOTION, self.OnMotion) # drag and drop, selection etc.
		self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress) #This is important for controlling the input into the editor
Ejemplo n.º 7
0
	def __init__(self, parent, id):
		
		self.highlighted = False #a variable for keeping track of whether any object is highlighted
		self.codon = False
		self.target = []
		self.possible = []
		self.offtarget = []
		DNApyBaseDrawingClass.__init__(self, parent, wx.ID_ANY)


		self.xc = 0
		self.yc = 0
		self.highlighted = False #variable for keeping track of whether an amino acid is highlighted


#		self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
		self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
#		self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
		self.Bind(wx.EVT_MOTION, self.OnMotion)