statalign.base
Class AlignColumn

java.lang.Object
  extended by statalign.base.AlignColumn

public class AlignColumn
extends java.lang.Object

An AlignColumn is an object that represents an observed or a hidden character and stores a double array storing the Felsenstein likelihoods. AlignColumns are double chained to form an observed or hidden sequence. There are also links to their parent. If the character that AlignColumn represents is aligned to an ancestral characters, then the alignColumn is not orphan otherwise it is, and then its parent represents the first ancestral character to the right in the alignment column.

Author:
miklos, novak, herman

Field Summary
 int[] aligned
          Vector indicating which characters are aligned to this column at the leaves below.
 int[] alignedUpp
          Vector indicating which characters are aligned to the parent of this column.
 AlignColumn left
          This reference points to the left child of this AlignColumn
 AlignColumn next
          This reference points to the next AlignColumn in the alignment
 boolean orphan
          If true, then this AlignColumn is inserted, and its parent is the first ancestral character to the right in the alignment If it is false, then this AlignColumn is aligned to its parent
 Vertex owner
          The owner tells the tree vertex where this AlignColumn belongs to.
 AlignColumn parent
          This reference points to the parent of this AlignColumn
 AlignColumn prev
          This reference points to the previous AlignColumn in the alignment
 AlignColumn right
          This reference points to the right child of this Aligncolumn
 double[] seq
          This double array contains the Felsenstein Likelihoods
 double[] upp
          This double array contains the upper Likelihoods
 
Constructor Summary
AlignColumn(AlignColumn next)
           
AlignColumn(AlignColumn next, boolean newSeq)
          It creates a new AlignColumn, chains it to the next column (namely, it is used to generate a new ancestral sequence built in a traceback phase of a dynamic programming).
AlignColumn(Vertex owner)
          It constructs a new AlignColumn.
 
Method Summary
 AlignColumn clone()
          Creates a new column as a clone of the this, copying (or cloning) all fields except prev and next.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

public Vertex owner
The owner tells the tree vertex where this AlignColumn belongs to.


parent

public AlignColumn parent
This reference points to the parent of this AlignColumn


orphan

public boolean orphan

If true, then this AlignColumn is inserted, and its parent is the first ancestral character to the right in the alignment

If it is false, then this AlignColumn is aligned to its parent


prev

public AlignColumn prev
This reference points to the previous AlignColumn in the alignment


next

public AlignColumn next
This reference points to the next AlignColumn in the alignment


left

public AlignColumn left
This reference points to the left child of this AlignColumn


right

public AlignColumn right
This reference points to the right child of this Aligncolumn


seq

public double[] seq
This double array contains the Felsenstein Likelihoods


upp

public double[] upp
This double array contains the upper Likelihoods


aligned

public int[] aligned
Vector indicating which characters are aligned to this column at the leaves below.


alignedUpp

public int[] alignedUpp
Vector indicating which characters are aligned to the parent of this column.

Constructor Detail

AlignColumn

public AlignColumn(Vertex owner)
It constructs a new AlignColumn. Sets only the owner, other fields are filled in outside of the constructor

Parameters:
owner - The vertex where this AlignColumn belongs to.

AlignColumn

public AlignColumn(AlignColumn next,
                   boolean newSeq)
It creates a new AlignColumn, chains it to the next column (namely, it is used to generate a new ancestral sequence built in a traceback phase of a dynamic programming). the owner is set to the same vertex as the owner of the next AlignColumn.

Parameters:
next - The next AlignColumn in the sequence that is being generated
newSeq - If true, then the constructor allocates memory for the seq[] array that contains the Felsenstein likelihoods. If false, then the seq[] array of other AlignColumn is associated to this Aligncolumn and reused. For speeding-up purposes.

AlignColumn

public AlignColumn(AlignColumn next)
Method Detail

clone

public AlignColumn clone()
Creates a new column as a clone of the this, copying (or cloning) all fields except prev and next.

Overrides:
clone in class java.lang.Object