FORESTER 1.92

forester.datastructures
Class BasketDataStructure

java.lang.Object
  |
  +--forester.datastructures.BasketDataStructure

public class BasketDataStructure
extends java.lang.Object

An implementation of the "Basket" datastructure. This datastructure is used in Eulenstein's algorithm for gene duplication inference ("forester/tools/OE").

Reference: Oliver Eulenstein (1998) Vorhersage von Genduplikationen und deren Entwicklung in der Evolution. GMD Research Series, No 20/1998 GMD - Forschungszentrum Informationstechnik GmbH. - Sankt Augustin (http://www.gmd.de/publications/research/1998/020/)

More information about FORESTER (including download) is available at: http://www.genetics.wustl.edu/eddy/people/zmasek/forester/

Version:
1.000 -- last modified: 10/12/00
Author:
Christian M. Zmasek

Field Summary
(package private)  int[] rank
           
 
Constructor Summary
BasketDataStructure(int s)
          Constructs a BasketDataStructure of size s.
 
Method Summary
 void createBasket(int g, int s)
          Creates a basket( s ), which is affiliated with the Node s of the species Tree and which contains the Node g of the gene Tree.
 int findBasket(int g)
          Finds the basket containing the Node g of the gene Tree.
 void insertIntoBasket(int g, int s)
          Inserts gene Tree Node g into basket( s ).
 void mergeBasket(int s1, int s2)
          Adds the elements of basket( s1 ) to the elements of basket( s2 ) and deletes basket( s1 ).
 void moveBasket(int s1, int s2)
          Changes the affiliation of basket( s1 ) from s1 to s2.
 java.lang.String toString()
          Transfers this to a String.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rank

int[] rank
Constructor Detail

BasketDataStructure

public BasketDataStructure(int s)
Constructs a BasketDataStructure of size s.
Parameters:
s - initial size
Method Detail

createBasket

public void createBasket(int g,
                         int s)
Creates a basket( s ), which is affiliated with the Node s of the species Tree and which contains the Node g of the gene Tree. (Corresponds to method makeSet of DisjointSet.)
Parameters:
g - a Node ID of the gene Tree
s - a Node ID of the species Tree which will become the representative of a basket

moveBasket

public void moveBasket(int s1,
                       int s2)
Changes the affiliation of basket( s1 ) from s1 to s2.
Parameters:
s1 - a Node ID of the species Tree and representative of a existing basket( s1 )
s2 - a Node ID of the species Tree

mergeBasket

public void mergeBasket(int s1,
                        int s2)
Adds the elements of basket( s1 ) to the elements of basket( s2 ) and deletes basket( s1 ). (Corresponds to method link of DisjointSet.)
Parameters:
s1 - a Node ID of the species Tree and representative of a existing basket( s1 )
s2 - a Node ID of the species Tree and representative of a existing basket( s2 )

findBasket

public int findBasket(int g)
Finds the basket containing the Node g of the gene Tree. (Corresponds to method findSet of DisjointSet.)
Parameters:
g - a Node ID of the gene Tree
Returns:
the representative of the basket containing gene Tree node g

insertIntoBasket

public void insertIntoBasket(int g,
                             int s)
Inserts gene Tree Node g into basket( s ).
Parameters:
g - a Node ID of the gene Tree
s - a Node ID of the species Tree and representative of a existing basket( s1 )

toString

public java.lang.String toString()
Transfers this to a String.
Overrides:
toString in class java.lang.Object

FORESTER 1.92