# This script launches PhyloPart on a series of nwk trees, with an additional fucntion to get running time
# M. Ragonnet
# 29th Nov 2012

import time
import subprocess as sub

RunningTimes = open('PhyloPart_runningTimes.txt','w')

for i in range(1,19):
	t1 = time.time()
	sub.call(["java", "-jar", "-Xmx1G", "phyloPart.jar", 
				"B2010_"+str(i)+"000.nwk", "0.05", "-b324000000","-o"+str(i)+"_PhyloPart_OUT.txt"])
	t2 = time.time()
	runningTime = str(t2-t1)
	print>>RunningTimes,i, runningTime
#print "done"

#print 'Analysis took %s ms' % ((t2-t1)*1000.0)