20.181/Lecture3: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
 
mNo edit summary
Line 14: Line 14:
(in pseudocode)
(in pseudocode)


<blockquote><tt>
for each possible tree:
for each possible tree:
:calculate the score of (tree,data)<br>
:calculate the score of (tree,data)<br>
return tree with BEST score
return tree with BEST score
</tt></blockquote>


===Possible trees===
===Possible trees===
*how many trees are there?
*how many trees are there?
**how does the number of possible trees increase with the number of leaves? linearly? exponentially?  
**how does the number of possible trees increase with the number of leaves... linearly? ...exponentially?  
***start with the simplest unrooted tree, it has three leaves
***start with the simplest unrooted tree, it has three leaves
***how many ways are there to add another leaf? there are 3 ways- by adding the new leaf attached to each of the 3 existing branches (ignore the center leaf for now because we want to stick to binary trees)
***how many ways are there to add another leaf? there are 3 ways- by adding the new leaf attached to each of the 3 existing branches (ignore the center leaf for now because we want to stick to binary trees)
***now there are 5 places to add a leaf to a 4-leaf tree
***now there are 5 places to add a leaf to a 4-leaf tree
***every time you put a new branch down, you gain 2 more places to put a new branch: one from splitting an existing branch into two parts, and one from the new branch itself
***every time you put a new branch down, you gain 2 more places to put a new branch: one from splitting an existing branch into two parts, and one from the new branch itself
** f_trees(n) = f_trees(n-1) * (2n-5)
** <tt>f_trees(n) = f_trees(n-1) * (2n-5)
** for n leaves, f_trees(n) = (2n-3)!
** for n leaves, f_trees(n) = (2n-3)!!  
** for n=10 there are 34*10^6 trees, for n-50 there are 2.7*10^76
** f_trees(n=10)= 34*10^6 f_trees(n=50) = 2.7*10^76 </tt>
**Enumerating trees is not possible, so we are going to look only at a small number of possible trees. We need a search strategy. And the optimal search strategy will depend on the topology of the space you're looking at.
**Enumerating trees is not possible, so we are going to look only at a small number of possible trees. We need a search strategy. And the optimal search strategy will depend on the topology of the space you're looking at.



Revision as of 08:38, 13 September 2006

Phylogenetic trees

Input: (a multiple sequence alignment)

  1. AATGC
  2. TATGC
  3. GGTGG
  4. ACTCG

Output: tree, an abstract representation of the same data ((1,4),(2,3))

Overview of Approach

(in pseudocode)

for each possible tree:

calculate the score of (tree,data)

return tree with BEST score

Possible trees

  • how many trees are there?
    • how does the number of possible trees increase with the number of leaves... linearly? ...exponentially?
      • start with the simplest unrooted tree, it has three leaves
      • how many ways are there to add another leaf? there are 3 ways- by adding the new leaf attached to each of the 3 existing branches (ignore the center leaf for now because we want to stick to binary trees)
      • now there are 5 places to add a leaf to a 4-leaf tree
      • every time you put a new branch down, you gain 2 more places to put a new branch: one from splitting an existing branch into two parts, and one from the new branch itself
    • f_trees(n) = f_trees(n-1) * (2n-5)
    • for n leaves, f_trees(n) = (2n-3)!!
    • f_trees(n=10)= 34*10^6 f_trees(n=50) = 2.7*10^76
    • Enumerating trees is not possible, so we are going to look only at a small number of possible trees. We need a search strategy. And the optimal search strategy will depend on the topology of the space you're looking at.

Tree Data Structure

  • For each node, we need to store:
    1. names (and sequences?)
    2. pointers to its left and right subchildren
  • we're going to use a built-in dictionary as our data structure