org.forester.sdi
Class SDIR

java.lang.Object
  extended by org.forester.sdi.SDIR

public class SDIR
extends Object


Constructor Summary
SDIR()
          Default contructor which creates an "empty" object..
 
Method Summary
static List<PhylogenyBranch> getBranchesInPreorder(Phylogeny t)
           
 int getCount()
          Returns the number of differently rooted trees which minimize the (rooting) "criterion" - as determined by method "infer".
 double getMinimalDiffInSubTreeHeights()
          Returns the (absolue value of the) minimal difference in tree heights of the two subtrees at the root (of the (re)rooted gene tree) - as determined by method "infer" - if minimize_height is set to true.
 int getMinimalDuplications()
          Returns the minimal number of duplications - as determined by method "infer".
 int getMinimalMappingCost()
          Returns the minimal mapping cost L - as determined by method "infer" - if minimize_mapping_cost is set to true.
 double getMinimalTreeHeight()
          Returns the minimal tree height - as determined by method "infer" - if minimize_height is set to true.
 long getTimeSumSDI()
          Returns the sum of times (in ms) needed to run method infer of class SDI.
 Phylogeny[] infer(Phylogeny gene_tree, Phylogeny species_tree, boolean minimize_mapping_cost, boolean minimize_sum_of_dup, boolean minimize_height, boolean return_trees, int max_trees_to_return)
          Infers gene duplications on a possibly unrooted gene Phylogeny gene_tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDIR

public SDIR()
Default contructor which creates an "empty" object..

Method Detail

getCount

public int getCount()
Returns the number of differently rooted trees which minimize the (rooting) "criterion" - as determined by method "infer".

Returns:
number of differently rooted trees which minimized the criterion
See Also:
#infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)

getMinimalDiffInSubTreeHeights

public double getMinimalDiffInSubTreeHeights()
Returns the (absolue value of the) minimal difference in tree heights of the two subtrees at the root (of the (re)rooted gene tree) - as determined by method "infer" - if minimize_height is set to true.

If a tree is midpoint rooted this number is zero.

IMPORTANT : If minimize_mapping_cost or minimize_sum_of_dup are also set to true, then this returns the minimal difference in tree heights of the trees which minimize the first criterion, and is therefore not necessarily zero.

(Last modified: 01/22/00)

Returns:
the minimal difference in tree heights -- IF calculated by "infer"
See Also:
#infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)

getMinimalDuplications

public int getMinimalDuplications()
Returns the minimal number of duplications - as determined by method "infer".

IMPORTANT : If the tree is not rooted by minimizing the sum of duplications or the mapping cost L, then this number is NOT NECESSARILY the MINIMAL number of duplications.

Returns:
(minimal) number of duplications
See Also:
#infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)

getMinimalMappingCost

public int getMinimalMappingCost()
Returns the minimal mapping cost L - as determined by method "infer" - if minimize_mapping_cost is set to true.

(Last modified: 11/07/00)

Returns:
the minimal mapping cost "L" -- IF calculated by "infer"
See Also:
#infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)

getMinimalTreeHeight

public double getMinimalTreeHeight()
Returns the minimal tree height - as determined by method "infer" - if minimize_height is set to true. IMPORTANT : If minimize_mapping_cost or minimize_sum_of_dup are also set to true, then this returns the minimal tree height of the trees which minimize the first criterion.

(Last modified: 01/12/00)

Returns:
the minimal tree height -- IF calculated by "infer"
See Also:
#infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)

getTimeSumSDI

public long getTimeSumSDI()
Returns the sum of times (in ms) needed to run method infer of class SDI. Final variable TIME needs to be set to true.

Returns:
sum of times (in ms) needed to run method infer of class SDI

infer

public Phylogeny[] infer(Phylogeny gene_tree,
                         Phylogeny species_tree,
                         boolean minimize_mapping_cost,
                         boolean minimize_sum_of_dup,
                         boolean minimize_height,
                         boolean return_trees,
                         int max_trees_to_return)
Infers gene duplications on a possibly unrooted gene Phylogeny gene_tree. The tree is rooted be minimizing either the sum of duplications, the mapping cost L, or the tree height (or combinations thereof). If return_trees is set to true, it returns an array of possibly more than one differently rooted Trees.
The maximal number of returned trees is set with max_trees_to_return.
Phylogeny species_tree is a species Phylogeny to which the gene Phylogeny gene_tree is compared to.
If both minimize_sum_of_dup and minimize_mapping_cost are true, the tree is rooted by minimizing the mapping cost L.
If minimize_sum_of_dup, minimize_mapping_cost, and minimize_height are false tree gene_tree is assumed to be alreadty rooted and no attempts at rooting are made, and only one tree is returned.

Conditions:

(Last modified: 10/01/01)

Parameters:
gene_tree - a binary (except deepest node) gene Phylogeny
species_tree - a rooted binary species Phylogeny
minimize_mapping_cost - set to true to root by minimizing the mapping cost L (and also the sum of duplications)
minimize_sum_of_dup - set to true to root by minimizing the sum of duplications
minimize_height - set to true to root by minimizing the tree height - if minimize_mapping_cost is set to true or minimize_sum_of_dup is set to true, then out of the resulting trees with minimal mapping cost or minimal number of duplications the tree with the minimal height is chosen
return_trees - set to true to return Array of Trees, otherwise null is returned
max_trees_to_return - maximal number of Trees to return (=maximal size of returned Array) must be no lower than 1
Returns:
array of rooted Trees with duplication vs. speciation assigned if return_trees is set to true, null otherwise

getBranchesInPreorder

public static List<PhylogenyBranch> getBranchesInPreorder(Phylogeny t)