In [1]:
import sys
from ete3 import Tree, TreeStyle, NodeStyle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
fileT = "100.trees"
try:
f=open(fileT, 'r')
except IOError:
print ("Unknown file: " + fileT)
sys.exit()
allTrees = list()
for l in f:
allTrees.append( Tree( l.strip() ) )
In [17]:
#File where I store useful functions
exec (open("/Users/boussau/Programs/PythonCode/functions.py").read ())
id2Heights=list()
for t in allTrees:
node2Height,id2Height = getNodeHeights( t )
id2Heights.append(id2Height)
In [18]:
print(len(id2Heights))
# Creating a uniform weight vector
weights = [1] * len(id2Heights)
outputsWeightedChronogram (allTrees[0].copy(), id2Heights, "consensus100MT", weights)
In [ ]: