예제 #1
0
raw_input('\n   alignment loaded, hit some key to see.\n')

tree.show()

print '''
we will run free-ratio model that is one of models available through
function run_model:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'''
print tree.run_model.__doc__ + '\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'

tree.run_model('fb.example')

raw_input('free-ratio model runned, all results are store in a Model object.')

fb = tree.get_evol_model('fb.example')

print 'Have a look to the parameters used to run this model on codeml: '
print fb.get_ctrl_string()
raw_input('hit some key...')

print 'Have a look to run message of codeml: '
print fb.run
raw_input('hit some key...')

print 'Have a look to log likelihood value of this model, and number of parameters:'
print 'lnL: %s and np: %s' % (fb.lnL, fb.np)
raw_input('hit some key...')

raw_input(
    'finally have a look to two layouts available to display free-ratio:')
예제 #2
0
파일: 7_slr.py 프로젝트: MikeTrizna/ete
06 Feb 2011

use slr to compute evolutionary rates
"""

__author__  = "Francois-Jose Serra"
__email__   = "*****@*****.**"
__licence__ = "GPLv3"
__version__ = "0.0"

from ete_dev import EvolTree


tree = EvolTree ("data/S_example/measuring_S_tree.nw")
tree.link_to_alignment ("data/S_example/alignment_S_measuring_evol.fasta")


tree.run_model ('SLR')

slr = tree.get_evol_model ('SLR')

slr.set_histface (up=False, kind='curve',errors=True,
                  hlines = [1.0,0.3], hlines_col=['black','grey'])

tree.show (histfaces=['SLR'])





예제 #3
0
print 'running model M1'
tree.run_model ('M1')
print 'running model M2'
tree.run_model ('M2')

print '\n\n comparison of models M1 and M2, p-value: ' + str(tree.get_most_likely ('M2','M1'))

#tree.show()

print 'by default the hist represented is this one:'

tree.show (histfaces=['M2'])

print 'but we can choose between many others...'

model2 = tree.get_evol_model ('M2')

col2 = {'NS' : 'black', 'RX' : 'black',
        'RX+': 'black', 'CN' : 'black',
        'CN+': 'black', 'PS' : 'black', 'PS+': 'black'}


model2.set_histface (up=False, kind='curve', colors=col2, ylim=[0,4], hlines = [2.5, 1.0, 4.0, 0.5], header = 'Many lines, error boxes, background black',
                     hlines_col=['orange', 'yellow', 'red', 'cyan'], errors=True)

tree.show(histfaces=['M2'])

model2.set_histface (up=False, kind='stick', hlines = [1.0,0.3], hlines_col=['black','grey'])
tree.show(histfaces=['M2'])

col = {'NS' : 'grey', 'RX' : 'black',
예제 #4
0
파일: 7_slr.py 프로젝트: tarah28/ete
#!/usr/bin/python
"""
06 Feb 2011

use slr to compute evolutionary rates
"""

__author__ = "Francois-Jose Serra"
__email__ = "*****@*****.**"
__licence__ = "GPLv3"
__version__ = "0.0"

from ete_dev import EvolTree

tree = EvolTree("data/S_example/measuring_S_tree.nw")
tree.link_to_alignment("data/S_example/alignment_S_measuring_evol.fasta")

tree.run_model('SLR')

slr = tree.get_evol_model('SLR')

slr.set_histface(up=False,
                 kind='curve',
                 errors=True,
                 hlines=[1.0, 0.3],
                 hlines_col=['black', 'grey'])

tree.show(histfaces=['SLR'])
예제 #5
0
raw_input('''Now we can do comparisons...
Compare first if we have one or 2 rates of evolution among phylogeny.
LRT between b_free and M0 (that is one or two rates of omega value)
p-value ofthis comparison is:''')
print tree.get_most_likely('b_free.137', 'M0')

raw_input('''
Now test if foreground rate is significantly different of 1.
(b_free with significantly better likelihood than b_neut)
if significantly different, and higher than one, we will be under
positive selection, if different and lower than 1 we will be under
negative selection. And finally if models are not significantly different
we should accept null hypothesis that omega value on marked branches is
equal to 1, what would be a signal of relaxation.
p-value for difference in rates between marked branches and the rest:''')
print tree.get_most_likely('b_free.137', 'M0')
print 'p-value representing significance that omega is different of 1:'
print tree.get_most_likely('b_free.137', 'b_neut.137')

print 'value of omega in marked branch (frg branch):'
b_free = tree.get_evol_model('b_free.137')
print b_free.branches[1]['w']

print 'and value of omega for background: '
print b_free.branches[2]['w']

print 'we will now run 2 branch models over this tree, one letting the omega \nvalue of foreground species to be free, and the other fixing it at one.\n'

print "The End."
예제 #6
0
raw_input ('\n   alignment loaded, hit some key to see.\n')

tree.show()

print '''
we will run free-ratio model that is one of models available through
function run_model:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'''
print tree.run_model.__doc__ +'\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'

tree.run_model ('fb.example')

raw_input ('free-ratio model runned, all results are store in a Model object.')

fb = tree.get_evol_model('fb.example')

print 'Have a look to the parameters used to run this model on codeml: '
print fb.get_ctrl_string()
raw_input ('hit some key...')


print 'Have a look to run message of codeml: '
print fb.run
raw_input ('hit some key...')

print 'Have a look to log likelihood value of this model, and number of parameters:'
print 'lnL: %s and np: %s' % (fb.lnL, fb.np)
raw_input ('hit some key...')

raw_input ('finally have a look to two layouts available to display free-ratio:')
예제 #7
0
LRT between b_free and M0 (that is one or two rates of omega value)
p-value ofthis comparison is:''')
print tree.get_most_likely ('b_free.137', 'M0')

raw_input ('''
Now test if foreground rate is significantly different of 1.
(b_free with significantly better likelihood than b_neut)
if significantly different, and higher than one, we will be under
positive selection, if different and lower than 1 we will be under
negative selection. And finally if models are not significantly different
we should accept null hypothesis that omega value on marked branches is
equal to 1, what would be a signal of relaxation.
p-value for difference in rates between marked branches and the rest:''')
print tree.get_most_likely ('b_free.137', 'M0')
print 'p-value representing significance that omega is different of 1:'
print tree.get_most_likely ('b_free.137', 'b_neut.137')

print 'value of omega in marked branch (frg branch):'
b_free = tree.get_evol_model ('b_free.137')
print b_free.branches[1]['w']

print 'and value of omega for background: '
print b_free.branches[2]['w']

print 'we will now run 2 branch models over this tree, one letting the omega \nvalue of foreground species to be free, and the other fixing it at one.\n'

print "The End."