FORESTER 1.9

forester.tools
Class SDIse

java.lang.Object
  |
  +--forester.tools.SDI
        |
        +--forester.tools.SDIse

public class SDIse
extends SDI

Implements our algorithm for speciation - duplication inference (SDI).

Reference:

The initialization is accomplished by:

The recursion part is accomplished by this class' method "geneTreePostOrderTraversal(Node)".

Requires JDK 1.2 or greater.

Version:
1.102 -- last modified: 10/02/01
Author:
Christian M. Zmasek
See Also:
SDI.linkExtNodesOfG(), Tree.preorderReID(int), SDI.stripTree(Tree,Tree), geneTreePostOrderTraversal(Node)

Constructor Summary
SDIse(Tree gene_tree, Tree species_tree)
          Constructor which sets the gene tree and the species tree to be compared.
 
Method Summary
(package private)  void geneTreePostOrderTraversal(Node g)
          Traverses the subtree of Node g in postorder, calculating the mapping function M, and determines which nodes represent speciation events and which ones duplication events.
 int infer(boolean strip_species_tree)
          Infers for each Node of gene_tree (set in constructor) whether it represents a speciation or duplication event by calculating and interpreting the mapping function M.
(package private)  int updateM(boolean prev_root_was_dup, Node prev_root_c1, Node prev_root_c2)
          Updates the mapping function M after the root of the gene tree has been moved by one branch.
 
Methods inherited from class forester.tools.SDI
computeMappingCost, decreaseDuplications, getDuplications, getGeneTree, getMappingCost, getSpeciesTree, increaseDuplications, linkExtNodesOfG, main, setDuplicationsToZero, stripTree
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDIse

public SDIse(Tree gene_tree,
             Tree species_tree)
      throws java.lang.Exception
Constructor which sets the gene tree and the species tree to be compared. species_tree is the species tree to which the gene tree gene_tree will be compared to - with method "infer(boolean)". Both Trees must be completely binary and rooted. The actual inference is accomplished with method "infer(boolean)". The mapping cost L can then be calculated with method "computeMappingCost()".

(Last modified: 01/11/01)

Parameters:
gene_tree - reference to a rooted binary gene Tree to which assign duplication vs speciation, must have species names in the species name fields for all external nodes
species_tree - reference to a rooted binary species Tree which might get stripped in the process, must have species names in the species name fields for all external nodes
See Also:
infer(boolean), SDI.computeMappingCost()
Method Detail

infer

public int infer(boolean strip_species_tree)
          throws java.lang.Exception
Infers for each Node of gene_tree (set in constructor) whether it represents a speciation or duplication event by calculating and interpreting the mapping function M. The most parsimonious sequence of speciation and duplication events is assumed.

(Last modified: 01/11/01)

Overrides:
infer in class SDI
Parameters:
strip_species_tree - set to true to remove from the species tree species not found in the gene tree prior to analysis (optional)
Returns:
number of duplications which have been assigned in gene_tree
See Also:
SDIse(Tree,Tree)

geneTreePostOrderTraversal

void geneTreePostOrderTraversal(Node g)
Traverses the subtree of Node g in postorder, calculating the mapping function M, and determines which nodes represent speciation events and which ones duplication events.

Preconditions: Mapping M for external nodes must have been calculated and the species tree must be labelled in preorder.

(Last modified: 01/11/01)

Parameters:
g - starting node of a gene tree - normally the root

updateM

int updateM(boolean prev_root_was_dup,
            Node prev_root_c1,
            Node prev_root_c2)
Updates the mapping function M after the root of the gene tree has been moved by one branch. It calculates M for the root of the gene tree and one of its two children.

To be used ONLY by method "SDIunrooted.fastInfer(Tree,Tree)".

(Last modfied: 10/02/01)

Parameters:
prev_root_was_dup - true if the previous root was a duplication, false otherwise
prev_root_c1 - child 1 of the previous root
prev_root_c2 - child 2 of the previous root
Returns:
number of duplications which have been assigned in gene tree

FORESTER 1.9