示例#1
0
sys.stdout.write("\nLoading tree... \r")
sys.stdout.flush()
t = Tree(args.filename)  #read the input tree.
nbsp = len(t)  ## get nb of tips
sys.stdout.write("Loading tree... DONE [the tree has %d tips] \n" % nbsp)
sys.stdout.flush()
##
sys.stdout.write("Storing tree nodes for faster lookup... \r")
sys.stdout.flush()
node2leaves = t.get_cached_content()
sys.stdout.write("Storing tree nodes for faster lookup... DONE\n")
sys.stdout.flush()

t.x = 6.0
t.y = 9.660254 - 10.0
t.alpha = 30.0
t.ray = 30.0
t.zoomview = np.ceil(np.log2(30 / t.ray))
maxZoomView = 0  ##

##FUNCTIONS
#getattr(t,n)


def rad(deg):
    return ((deg * np.pi) / 180)


def halfCircle(x, y, r, start, end, nsteps):
    rs = np.linspace(start, end, num=nsteps)
    xc = x + r * np.cos(rs)
示例#2
0
            )
            prg.close()
            sys.exit(1)
        the_id_of_the_row = str(a_fr_row['id'])
        the_csv_files_as_one_dict[the_id_of_the_row] = {}
        for a_key, a_fr_value in a_fr_row.items():
            the_csv_files_as_one_dict[the_id_of_the_row][a_key] = {
                'FR': a_fr_value
            }
        for a_key, a_en_value in an_en_row.items():
            the_csv_files_as_one_dict[the_id_of_the_row][a_key][
                'EN'] = a_en_value

t.x = 0.0
t.y = -15
t.alpha = 90.0
t.ray = 30.0
starti = 1

t.zoomview = 1

#species and node ids
nbsp = len(t)

prg.write('"nbtip": %d,' % (nbsp))
##this will contain the progress made by the code.

spid = starti
ndid = starti + nbsp
rootnb = ndid + 1
maxZoomView = 0