def test_get_most_likely(self): tree = EvolTree (WRKDIR + 'tree.nw') tree.workdir = 'examples/evol/data/protamine/PRM1/paml/' tree.link_to_evol_model (WRKDIR + 'paml/M1/M1.out', 'M1') tree.link_to_evol_model (WRKDIR + 'paml/M2/M2.out', 'M2') self.assertEqual(round(tree.get_most_likely ('M2','M1'),16), round(6.3280740347111373e-10,16))
### # run site model, and display result print '\n\n\n ----> We are now goingn to run sites model M1 and M2 with run_model function:\n' raw_input(" ====> hit some key to start") for model in ['M1', 'M2']: print 'running model ' + model T.run_model(model) print '\n\n\n ----> and use the get_most_likely function to compute the LRT between those models:\n' print 'get_most_likely function: \n\n'+ '*'*10 + ' doc ' + '*'*10 print '\n' + T.get_most_likely.func_doc print '*'*30 raw_input("\n ====> Hit some key to launch LRT") pv = T.get_most_likely('M2', 'M1') if pv <= 0.05: print ' ----> -> most likely model is model M2, there is positive selection, pval: ',pv else: print ' ----> -> most likely model is model M1, pval: ',pv raw_input(" ====> Hit some key...") ### # tengo que encontrar un ejemplo mas bonito pero bueno.... :P print '\n\n\n ----> We now add histograms to our tree to repesent site models with add_histface function: \n\n%s\n%s\n%s\n'\ % ('*'*10 + ' doc ' + '*'*10, T.get_evol_model('M2').set_histface.func_doc,'*'*30) print 'Upper face is an histogram representing values of omega for each column in the alignment,' print '\ Colors represent significantly conserved sites(cyan to blue), neutral sites(greens), or under \n\