Special note: Use the tree, observed states at the leaves, branch lengths and the JC69,  calculate the posterior probability of [A,G,C,T] at node 15. Build on the code already provided.  # Use this character state vector indicating # the nucleotide at leaf nodes 1-8 site1=["A","C","C","C","G","C","C","A"] # Use this tree structure tree4 = {     15: ['N',{"node": 14, "branch": 0.02}, {"node": 8, "branch": 1.1}],     14: ['N',{"node": 13, "branch": 0.11}, {"node": 7, "branch": 1.2}],     13: ['N',{"node": 12, "branch": 0.12}, {"node": 6, "branch": 0.8}],     12: ['N',{"node": 11, "branch": 0.64}, {"node": 9, "branch": 0.11}],     11: ['N',{"node": 3, "branch": 0.26}, {"node": 10, "branch": 0.24}],     10: ['N',{"node": 4, "branch": 0.02}, {"node": 5, "branch": 0.08}],     9: ['N',{"node": 1, "branch": 0.4}, {"node": 2, "branch": 0.6}] } for i in range(1, 9):     tree4[i] = ['L']      # JC69 model to generate Q matrix def JC69():     Q = np.full((4,4),0.25)     np.fill_diagonal(Q,-.75)     Q = Q/0.75     return Q # Initialize rate matrix Q = JC69() # Answer

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question


This is the 3rd time I am asking this question on this platform. Previous answers were wrong or incomplete.
Please, do not give me the same old wrong answers. Write a workable code to solve this problem and I will upvote

Special note: Use the tree, observed states at the leaves, branch lengths and the JC69, 
calculate the posterior probability of [A,G,C,T] at node 15. Build on the code already provided. 

# Use this character state vector indicating
# the nucleotide at leaf nodes 1-8
site1=["A","C","C","C","G","C","C","A"]

# Use this tree structure
tree4 = {
    15: ['N',{"node": 14, "branch": 0.02}, {"node": 8, "branch": 1.1}],
    14: ['N',{"node": 13, "branch": 0.11}, {"node": 7, "branch": 1.2}],
    13: ['N',{"node": 12, "branch": 0.12}, {"node": 6, "branch": 0.8}],
    12: ['N',{"node": 11, "branch": 0.64}, {"node": 9, "branch": 0.11}],
    11: ['N',{"node": 3, "branch": 0.26}, {"node": 10, "branch": 0.24}],
    10: ['N',{"node": 4, "branch": 0.02}, {"node": 5, "branch": 0.08}],
    9: ['N',{"node": 1, "branch": 0.4}, {"node": 2, "branch": 0.6}]
}
for i in range(1, 9):
    tree4[i] = ['L']
    
# JC69 model to generate Q matrix
def JC69():
    Q = np.full((4,4),0.25)
    np.fill_diagonal(Q,-.75)
    Q = Q/0.75
    return Q

# Initialize rate matrix
Q = JC69()

# Answer

Use the tree, observed states at the leaves, branch lengths and the JC69, calculate the posterior probability of [A,G,C,T] at node 15.
A
с
G
C
1
3
5
7
9
с
2
(12)
(11)
C
4
(10)
(13)
(14)
с
6
15
A
8
Transcribed Image Text:Use the tree, observed states at the leaves, branch lengths and the JC69, calculate the posterior probability of [A,G,C,T] at node 15. A с G C 1 3 5 7 9 с 2 (12) (11) C 4 (10) (13) (14) с 6 15 A 8
# Use this character state vector indicating
# the nucleotide at leaf nodes 1-8
sitel=["A","c","c","c","G","C","C","A"]
# Use this tree structure
tree4 {
"branch": 1.1}],
15: ['N', { "node": 14, "branch": 0.02}, {"node" : 8,
14: ['N', { "node": 13, "branch": 0.11}, {"node": 7, "branch": 1.2}],
13: ['N',{"node": 12, "branch": 0.12}, {"node": 6, "branch": 0.8}],
12: ['N',{"node": 11, "branch": 0.64}, {"node": 9, "branch": 0.11}],
11: ['N', { "node": 3, "branch": 0.26}, {"node": 10, "branch": 0.24}],
10: ['N', { "node": 4, "branch": 0.02}, {"node": 5, "branch": 0.08}],
9: ['N',{"node": 1, "branch": 0.4}, {"node": 2, "branch": 0.6}]
}
for i in range(1, 9):
tree4[i] = ['L']
#JC69 model to generate Q matrix
def JC69():
np. full ((4,4), 0.25)
np. fill_diagonal (0,-.75)
Q
Q/0.75
return Q
#Initialize rate matrix
JC69 ( )
# Answer
Transcribed Image Text:# Use this character state vector indicating # the nucleotide at leaf nodes 1-8 sitel=["A","c","c","c","G","C","C","A"] # Use this tree structure tree4 { "branch": 1.1}], 15: ['N', { "node": 14, "branch": 0.02}, {"node" : 8, 14: ['N', { "node": 13, "branch": 0.11}, {"node": 7, "branch": 1.2}], 13: ['N',{"node": 12, "branch": 0.12}, {"node": 6, "branch": 0.8}], 12: ['N',{"node": 11, "branch": 0.64}, {"node": 9, "branch": 0.11}], 11: ['N', { "node": 3, "branch": 0.26}, {"node": 10, "branch": 0.24}], 10: ['N', { "node": 4, "branch": 0.02}, {"node": 5, "branch": 0.08}], 9: ['N',{"node": 1, "branch": 0.4}, {"node": 2, "branch": 0.6}] } for i in range(1, 9): tree4[i] = ['L'] #JC69 model to generate Q matrix def JC69(): np. full ((4,4), 0.25) np. fill_diagonal (0,-.75) Q Q/0.75 return Q #Initialize rate matrix JC69 ( ) # Answer
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education