import os, sys import SeqUtil, Report if not os.path.exists('aligns'): os.mkdir('aligns') if not os.path.exists('Bayes'): os.mkdir('Bayes') #if not os.path.exists('ML'): # os.mkdir('ML') out= sys.argv[1] query = sys.argv[2] SeqUtil.rename('Data/bac-'+out+'.fas') if not os.path.exists('aligns/bac-'+out+'.best.nex'): os.system('prank -d=Data/bac-'+out+' -o=aligns/bac-'+out+' -f=nexus -quiet') SeqUtil.bayesinNex('aligns/bac-'+out+'.best.nex') #SeqUtil.splicealign('aligns/bac-'+out+'.best.nex','Bayes/bac-'+out+'-mod.nxs') #models=SeqUtil.bestmod('Bayes/bac-'+out+'-mod.nxs') models_ori=SeqUtil.bestmod('aligns/bac-'+out+'.best.nex') if not os.path.exists('Bayes/bac-'+out+'-bayes.nxs'): SeqUtil.bayesfile('aligns/bac-'+out+'.best.nex',models_ori,'Bayes/bac-'+out+'-bayes.nxs') #SeqUtil.bayesfile('Bayes/bac-'+out+'-mod.nxs',models,'Bayes/bac-'+out+'-bayes.nxs') os.system('mb Bayes/bac-'+out+'-bayes.nxs') #SeqUtil.pamlseqnex('Bayes/bac-'+out+'-mod.nxs','ML/bac-'+out) #for mod in models.keys(): # SeqUtil.pamlinput('ML/bac-'+out,'ML/bac-'+out+'.out','ML/bac-'+out+'.ctl',{models.keys()[mod].split('+')[0]:models[models.keys()[mod]][1]}) # os.system('codeml ML/bac-'+out+'.ctl') # SeqUtil.extractMLtree('ML/bac-'+out+'.out') Report.generateReport(out,query,models_ori,'bac')
import os, sys import SeqUtil, Report if not os.path.exists('aligns'): os.mkdir('aligns') if not os.path.exists('Bayes'): os.mkdir('Bayes') #if not os.path.exists('ML'): # os.mkdir('ML') out= sys.argv[1] query = sys.argv[2] SeqUtil.rename('Data/euk-'+out+'.fas') if not os.path.exists('aligns/euk-'+out+'.best.nex'): os.system('prank -d=Data/euk-'+out+' -o=aligns/euk-'+out+' -f=nexus -quiet') SeqUtil.bayesinNex('aligns/euk-'+out+'.best.nex') #SeqUtil.splicealign('aligns/euk-'+out+'.best.nex','Bayes/euk-'+out+'-mod.nxs') #models=SeqUtil.bestmod('Bayes/euk-'+out+'-mod.nxs') models_ori=SeqUtil.bestmod('aligns/euk-'+out+'.best.nex') if not os.path.exists('Bayes/euk-'+out+'-bayes.nxs'): SeqUtil.bayesfile('aligns/euk-'+out+'.best.nex',models_ori,'Bayes/euk-'+out+'-bayes.nxs') #SeqUtil.bayesfile('Bayes/euk-'+out+'-mod.nxs',models,'Bayes/euk-'+out+'-bayes.nxs') os.system('mb Bayes/euk-'+out+'-bayes.nxs') #SeqUtil.pamlseqnex('Bayes/euk-'+out+'-mod.nxs','ML/euk-'+out) #for mod in models.keys(): # SeqUtil.pamlinput('ML/euk-'+out,'ML/euk-'+out+'.out','ML/euk-'+out+'.ctl',{models.keys()[mod].split('+')[0]:models[models.keys()[mod]][1]}) # os.system('codeml ML/euk-'+out+'.ctl') # SeqUtil.extractMLtree('ML/euk-'+out+'.out') Report.generateReport(out,query,models_ori,'euk')
import os, sys import SeqUtil, Report if not os.path.exists('aligns'): os.mkdir('aligns') if not os.path.exists('Bayes'): os.mkdir('Bayes') #if not os.path.exists('ML'): # os.mkdir('ML') out= sys.argv[1] query = sys.argv[2] SeqUtil.rename('Data/arch-'+out+'.fas') if not os.path.exists('aligns/arch-'+out+'.best.nex'): os.system('prank -d=Data/arch-'+out+' -o=aligns/arch-'+out+' -f=nexus -quiet') SeqUtil.bayesinNex('aligns/arch-'+out+'.best.nex') #SeqUtil.splicealign('aligns/arch-'+out+'.best.nex','Bayes/arch-'+out+'-mod.nxs') #models=SeqUtil.bestmod('Bayes/arch-'+out+'-mod.nxs') models_ori=SeqUtil.bestmod('aligns/arch-'+out+'.best.nex') if not os.path.exists('Bayes/arch-'+out+'-bayes.nxs'): SeqUtil.bayesfile('aligns/arch-'+out+'.best.nex',models_ori,'Bayes/arch-'+out+'-bayes.nxs') #SeqUtil.bayesfile('Bayes/arch-'+out+'-mod.nxs',models,'Bayes/arch-'+out+'-bayes.nxs') os.system('mb Bayes/arch-'+out+'-bayes.nxs') #SeqUtil.pamlseqnex('Bayes/arch-'+out+'-mod.nxs','ML/arch-'+out) #for mod in models.keys(): # SeqUtil.pamlinput('ML/arch-'+out,'ML/arch-'+out+'.out','ML/arch-'+out+'.ctl',{models.keys()[mod].split('+')[0]:models[models.keys()[mod]][1]}) # os.system('codeml ML/arch-'+out+'.ctl') # SeqUtil.extractMLtree('ML/arch-'+out+'.out') Report.generateReport(out,query,models_ori,'arch')
if not os.path.exists('aligns'): os.mkdir('aligns') if not os.path.exists('Bayes'): os.mkdir('Bayes') #if not os.path.exists('ML'): # os.mkdir('ML') out=sys.argv[1] query=sys.argv[2] try: paml=sys.argv[3] paml= paml=='-y' except IndexError: paml=False print "Beginning alignment" SeqUtil.rename('Data/all-'+out+'.fas') os.system('prank -d=Data/all-'+out+' -o=aligns/all-'+out+' -f=nexus -quiet') SeqUtil.bayesinNex('aligns/all-'+out+'.best.nex') #SeqUtil.splicealign('aligns/all-'+out+'.best.nex','Bayes/all-'+out+'-mod.nxs') print "Alignment complete.\nCalculating best model for tree finding" models_ori=SeqUtil.bestmod('aligns/all-'+out+'.best.nex') #models=SeqUtil.bestmod('Bayes/all-'+out+'-mod.nxs') #print models_ori, models if paml: for mod in models.keys(): SeqUtil.pamlseqnex('Bayes/all-'+out+'-mod.nxs','ML/all-'+out+mod.split('+')[0]) if models[mod][0]=='0' and models[mod][1]=='0': os.system('phyml -i ML/all-'+out+mod.split('+')[0]+' -d aa -b 100 -m '+mod.split('+')[0]+ ' -f e -s BEST -u aligns/all-'+out+'.ed.2.dnd -o tl') elif models[mod][0]=='0': os.system('phyml -i '+'ML/all-'+out+mod.split('+')[0]+' -d aa -b 100 -m '+mod.split('+')[0]+