Beispiel #1
0
 def __init__(self, path):
     Tree.__init__(self, path)
     for root, dirs, files in os.walk(path):
         node = self.find_node(self.root, str(root))
         for dir_ in dirs:
             node.add_child(os.path.join(root, dir_))
         for file_ in files:
             node.add_child(os.path.join(root, file_))
Beispiel #2
0
 def __init__(self):
     Tree.__init__(self,
                   root=HyperCategory(hid=Autogen.root_hid,
                                      name='All goods'))
     self.add_children({
         HyperCategory(hid=Autogen.default_hid, name='Default category'):
         {}
     })
Beispiel #3
0
    def __init__(self, tree, mp='', ml=''):
        """
        Convert sequences in MSA file into ancestral state for each site and attach them to each node

        @param tree: string, a newick format string or a filename of a newick format file (in this version this only accept a newick format file generated by FastML instead of a untouched newick format file which only contains aligned sequence for all terminal nodes)
        @param mp: string, filename of a MSA file, MP method only
        @param ml: string, filename of a MSA file, ML method only
        """
        Tree.__init__(self, tree, mp, ml)
Beispiel #4
0
    def __init__(self, tree, mp='', ml='', save=False, outdir=''):
        """
        Reconstruct ancestral state by MP method for a given tree in newick format and a MSA file in fasta format

        @param tree: string, a newick format string or a filename of a newick format file
        @param mp: string, filename of a MSA file, MP method only
        @param ml: string, filename of a MSA file, ML method only
        @param save: bool, save result to a file or print it out (default), default: False
        @param outdir: string, a directory name (with absoluter or relative path) to save result.
        """
        Tree.__init__(self, tree, mp, ml)
        self.save = save
        self.outdir = outdir if outdir else os.getcwd()
Beispiel #5
0
    def __init__(self,
                 master,
                 root,
                 iconsManager=None,
                 idleRedraw=True,
                 nodeHeight=15,
                 headerHeight=0,
                 treeWidth=160,
                 **kw):

        Tree.__init__(self,
                      master,
                      root,
                      iconsManager=iconsManager,
                      idleRedraw=idleRedraw,
                      nodeHeight=nodeHeight,
                      headerHeight=headerHeight,
                      **kw)

        self.objectToNode = {}  # key is object, values if Node instance
        self.objectToNode[root.object] = root

        self.nbCol = 0  # number of columns of buttons
        self.columns = []  # list of ColumnDescriptor instance
        self.balloon = Balloon(master)

        self.colLabIds = []

        self.colWidth = 17  # width of each column in pixels
        w = self.treeWidth = treeWidth  # width of the tree part of the widget
        self.newTreeWidth = 0  # used to widen tree whebn labels gets long
        self.prevX = 0
        self.prevY = 0

        # draw the divider between tree and buttons
        canvas = self.canvas

        id_ = canvas.create_line(w - 6, 0, w - 6, 1000, fill='grey75', width=3)
        self.dividerCanvasId = id_
        canvas.tag_bind(id_, "<Enter>", self.enterDivider_cb)
        canvas.tag_bind(id_, "<Leave>", self.leaveDivider_cb)
        canvas.tag_bind(id_, "<Button-1>", self.dividePress_cb)
        canvas.tag_bind(id_, "<ButtonRelease-1>", self.divideRelease_cb)
        #id_ = canvas.create_line( w+1, 0, w+1, 1000, fill='grey75')
        #self.dividerCanvasIds.append(id_)

        self.crosshairTk = None
        self.canvas.bind("<Leave>", self.leave_cb)
        self.circlesForOnOff = True
        self.lastHighligted = None
        self.minTreeWidth = 0  # width of buttons above tree
 def __init__(self, client, *args, **kwargs):
     kwargs['draw_zebra'] = False
     self.client = client
     self.directory = get_platform_root_dir()
     self.content = content = os.walk(self.directory)
     if client is not None and hasattr(client, 'directory'):
         self.directory = client.directory
     self.directory = kwargs.pop('directory', self.directory)
     self.data = data = {}
     d = {}
     for dirpath, dirnames, filenames in content:
         for name in dirnames:
             d[name] = self.parse_path(name, os.path.join(dirpath, name))
         data[dirpath] = d
         break
     kwargs['data'] = data
     Tree.__init__(self, *args, **kwargs)
     del self.menu
     self.set_directory(self.directory)
 def __init__(self, client, *args, **kwargs):
     kwargs["draw_zebra"] = False
     self.client = client
     self.directory = get_platform_root_dir()
     self.content = content = os.walk(self.directory)
     if client is not None and hasattr(client, "directory"):
         self.directory = client.directory
     self.directory = kwargs.pop("directory", self.directory)
     self.data = data = {}
     d = {}
     for dirpath, dirnames, filenames in content:
         for name in dirnames:
             d[name] = self.parse_path(name, os.path.join(dirpath, name))
         data[dirpath] = d
         break
     kwargs["data"] = data
     Tree.__init__(self, *args, **kwargs)
     del self.menu
     self.set_directory(self.directory)
    def __init__(self, master, root, iconsManager=None, idleRedraw=True,
                 nodeHeight=20, **kw):
        Tree.__init__(self, master, root, iconsManager=None, idleRedraw=True,
                      nodeHeight=20, **kw)
        self.objectToNode = {}  # key is object, values if Node instance
        self.objectToNode[root.object] = root
        
        self.nbCol = 0  # number of columns of buttons
        self.columns = [] # list of ColumnDescriptor instance
        self.balloon = Balloon(master)

        self.colLabIds = []

        self.colWidth = 25 # width of each column in pixels
        self.treeWidth = 180 # width of the tree part of the widget
        self.prevX = 0
        self.prevY = 0

        self.crosshairTk = None
        self.canvas.bind("<Leave>", self.leave_cb)
    def __init__(self, master, root, iconsManager=None, idleRedraw=True,
                 nodeHeight=15, headerHeight=30, treeWidth=160, **kw):

        Tree.__init__(self, master, root, iconsManager=iconsManager,
                      idleRedraw=idleRedraw, nodeHeight=nodeHeight,
                      headerHeight=headerHeight, **kw)

        self.objectToNode = {}  # key is object, values if Node instance
        self.objectToNode[root.object] = root
        
        self.nbCol = 0  # number of columns of buttons
        self.columns = [] # list of ColumnDescriptor instance
        self.balloon = Balloon(master)

        self.colLabIds = []

        self.colWidth = 17 # width of each column in pixels
        w = self.treeWidth = treeWidth # width of the tree part of the widget
        self.newTreeWidth = 0 # used to widen tree whebn labels gets long
        self.prevX = 0
        self.prevY = 0

        # draw the divider between tree and buttons
        canvas = self.canvas

        id_ = canvas.create_line( w-6, 0, w-6, 1000, fill='grey75', width=3)
        self.dividerCanvasId = id_
        canvas.tag_bind(id_,"<Enter>", self.enterDivider_cb)
        canvas.tag_bind(id_,"<Leave>", self.leaveDivider_cb)
        canvas.tag_bind(id_,"<Button-1>", self.dividePress_cb)
        canvas.tag_bind(id_,"<ButtonRelease-1>", self.divideRelease_cb)
        #id_ = canvas.create_line( w+1, 0, w+1, 1000, fill='grey75')
        #self.dividerCanvasIds.append(id_)
        
        self.crosshairTk = None
        self.canvas.bind("<Leave>", self.leave_cb)
        self.circlesForOnOff = True
        self.lastHighligted = None
 def __init__(self):
     Tree.__init__(self)
Beispiel #11
0
 def __init__(self):
     Tree.__init__(self)
     self._n_nodes = 0
     self._nodes = []  # _nodes is a list of dictionaries.
Beispiel #12
0
 def __init__(self):
     Tree.__init__(self)
     self.root = None        # Set up the tree with no root
     self._n_nodes = 0
Beispiel #13
0
 def __init__(self):
     Tree.__init__(self, get_widget_by_name('Project Explorer Tree'))
Beispiel #14
0
 def __init__(self):
     Tree.__init__(self)
     self._n_nodes = 0
     self._nodes = []    # _nodes is a list of dictionaries.
Beispiel #15
0
    def __init__(self):
        """"""
        DownloadManager.__init__(self, lambda x: x, [])
        Tree.__init__(self, [None], self)

        self.config = shared.configuration
Beispiel #16
0
 def __init__(self):
     Tree.__init__(self, get_widget_by_name('Project Explorer Tree'))
Beispiel #17
0
 def __init__(self, directory_or_file):
     Tree.__init__(self)
     self.counter = Counter(directory_or_file)
 def __init__(self, json):
     """
         Constructor.
         It simply calls GeneralTree constructor with specified json.
     """
     Tree.__init__(self, "", json)
Beispiel #19
0
 def __init__(self):
     Tree.__init__(self, root=HyperCategory(hid=Autogen.root_hid, name='All goods'))
     self.add_children({HyperCategory(hid=Autogen.default_hid, name='Default category'): {}})
Beispiel #20
0
 def __init__(self):
     Tree.__init__(self)
     self.root = None  # Set up the tree with no root
     self._n_nodes = 0
Beispiel #21
0
 def __init__(self):
     Tree.__init__(
         self, Region(name='Russia', type='country', rid=Autogen.root_rid))
Beispiel #22
0
 def __init__(self, end_node, prec, index, index_list=None):
     Tree.__init__(self, end_node, prec)
     if index_list is None:
         self._index_list = [index]
     else:
         self._index_list = index_list
Beispiel #23
0
 def __init__(self, height=0):
     Tree.__init__(self, height)
     self.type = "FoxtailPine"
Beispiel #24
0
 def __init__(self, height=0):
     Tree.__init__(self, height)
     self.type = "WhitebarkPine"
Beispiel #25
0
 def __init__(self, datasets, feature):
     Tree.__init__(self, datasets, feature)
     self.tree = None
Beispiel #26
0
 def __init__(self, label = "Genome", myObject = None):
     '''
     '''
     Tree.__init__(self, label, myObject)
     self.exonCnt, self.intronCnt, self.cdsCnt = 0, 0, 0
     self.splices = True # Print out splicing variants by default
Beispiel #27
0
 def __init__(self, id=0, **kwargs):
     Tree.__init__(self, root=NavCategory(**kwargs))
     self.__id = id
     self.__primaries = set()
     if self._root.primary:
         self.__primaries.add(self._root.hid)
Beispiel #28
0
 def __init__(self):
     Tree.__init__(self, Region(name='Russia', type='country', rid=Autogen.root_rid))
Beispiel #29
0
	def __init__(self):
		""""""
		DownloadManager.__init__(self, lambda x: x, [])
		Tree.__init__(self, [None], self)

		self.config = shared.configuration
Beispiel #30
0
    def __init__(self):
        Tree.__init__(self)

        self.root = None
        self.count = 0
Beispiel #31
0
 def __init__(self, end_node, prec, index):
     Tree.__init__(self, end_node, prec)
     self._index = index