Esempio n. 1
0
  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]+
                   ' -f e -v '+models[mod][1]+' -s BEST '+
                   '-u aligns/all-'+out+'.ed.2.dnd -o tl')
     elif models[mod][1]=='0':
         os.system('phyml -i '+'ML/all-'+out+mod.split('+')[0]+' -d aa -b 100 -m '+mod.split('+')[0]+
                   ' -f e -a '+models[mod][0]+' -s BEST '+
                   '-u aligns/all-'+out+'.ed.2.dnd -o tl')
     else:
         os.system('phyml -i '+'ML/all-'+out+mod.split('+')[0]+' -d aa -b 100 -m '+mod.split('+')[0]+
                   ' -f e -v '+models[mod][1]+' -a '+models[mod][0]+' -s BEST '+
                   '-u aligns/all-'+out+'.ed.2.dnd -o tl')