Ejemplo n.º 1
0
 def test_run_slr(self):
     if which('Slr'):
         tree = EvolTree('((seq1,seq2),seq3);')
         tree.link_to_alignment('>seq1\nCTGATTCTT\n>seq2\nCTGATTCTT\n>seq3\nATGATTCTT\n')
         tree.run_model('SLR')
         self.assert_('Sitewise Likelihood R' in tree.get_evol_model('SLR').run)
         self.assert_('Positively selected s' in tree.get_evol_model('SLR').run)
         self.assert_('Conserved sites' in tree.get_evol_model('SLR').run)
         self.assert_('lnL' in tree.get_evol_model('SLR').run)
Ejemplo n.º 2
0
 def test_run_codeml(self):
     if which('codeml'):
         tree = EvolTree('((seq1,seq2),seq3);')
         tree.link_to_alignment('>seq1\nATGCTG\n>seq2\nATGCTG\n>seq3\nTTGATG\n')
         tree.run_model('fb')
         self.assert_('CODONML' in tree.get_evol_model('fb').run)
         self.assert_('Time used:' in tree.get_evol_model('fb').run)
         self.assert_('end of tree file' in tree.get_evol_model('fb').run)
         self.assert_('lnL' in tree.get_evol_model('fb').run)
         self.assert_(tree.get_descendants()[0].w > 0)
Ejemplo n.º 3
0
print T
print '\n         ----> and an alignment from: \n'+ALG_PATH+'\n\n'
T.link_to_alignment(ALG_PATH)
raw_input("         ====> hit some key to see the Tree with alignment")
T.show()

###
# run free-branch model, and display result
print '\n\n\n         ----> We define now our working directory, that will be created:', \
      WORKING_PATH
T.workdir = (WORKING_PATH)
print '\n            ----> and run the free-branch model with run_model function:\n\n%s\n%s\n%s\n'\
      % ('*'*10 + ' doc ' + '*'*10, T.run_model.func_doc, '*'*30)

raw_input("         ====> Hit some key to start free-branch computation with codeml...\n")
T.run_model('fb')
T.show()

###
# 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