statalign.base
Class Tree

java.lang.Object
  extended by statalign.base.thread.Stoppable
      extended by statalign.base.Tree
All Implemented Interfaces:
DataType

public class Tree
extends Stoppable
implements DataType

This is the current tree in the MCMC run. It extends Stoppable, so the MCMC run can be terminated in graphical interface mode while it calls a function in the Tree class.

Author:
miklos, novak

Field Summary
 double heat
          The heat parameter for this MCMC chain.
 Hmm2 hmm2
          When two fragments of two sequences on two neighbor vertices of the tree are realigned, the proposed new alignment is drawn from a forward-backward sampling of this HMM.
 HmmSilent hmm3
          When two fragments of two sequences on two sibling vertices are realigned drawing a novel ancestral substring for their parent vertex, the proposed new alignment is drawn from a forward-backward sampling of this HMM.
 java.lang.String[] names
          The name of the sequences
 CNetwork network
           
 java.lang.String[] previousFullAlign
           
 Vertex root
          The root of the tree
 SubstitutionModel substitutionModel
          Characters on this tree undergo substitutions according to this model.
 java.lang.String title
          The name of the tree
 Vertex[] vertex
          The array of vertices of the tree.
 
Constructor Summary
Tree()
           
 
Method Summary
 void checkPointers()
           
 int countLeaves()
           
 void countSilentIndels()
           
 double getLogLike()
           
 double getLogPrior()
           
 RawSequences getSeqs()
           
 State getState()
          Returns a State object representing the current state.
 java.lang.String getSummaryAssociatedWith(java.lang.String sequenceName)
           
 int getTopVertexId(int ind)
           
 void makeRoot(java.lang.String taxonName)
          It roots the tree on a taxon
 boolean perSequenceData()
           
 java.lang.String printedTree()
          Generates a String contaning the description of the tree in Newick format.
 java.lang.String printedTreeWithNumbers()
           
 void recomputeCheckLogLike()
          Recomputes the likelihood from scratch and checks whether everything was correct before.
 void removeDataAssociatedWith(java.lang.String sequenceName)
           
 java.lang.String rowSequences()
          It generates the array of row sequences.
 void setSeqs(RawSequences rs)
           
 
Methods inherited from class statalign.base.thread.Stoppable
pausable, stoppable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

substitutionModel

public SubstitutionModel substitutionModel
Characters on this tree undergo substitutions according to this model.


hmm2

public Hmm2 hmm2
When two fragments of two sequences on two neighbor vertices of the tree are realigned, the proposed new alignment is drawn from a forward-backward sampling of this HMM. It is a simplified version of the TKF92 model.


hmm3

public HmmSilent hmm3
When two fragments of two sequences on two sibling vertices are realigned drawing a novel ancestral substring for their parent vertex, the proposed new alignment is drawn from a forward-backward sampling of this HMM. It is a pair-HMM having states emitting into the non-observable ancestral sequence.


vertex

public Vertex[] vertex
The array of vertices of the tree.


root

public Vertex root
The root of the tree


title

public java.lang.String title
The name of the tree


names

public java.lang.String[] names
The name of the sequences


heat

public double heat
The heat parameter for this MCMC chain.


network

public CNetwork network

previousFullAlign

public java.lang.String[] previousFullAlign
Constructor Detail

Tree

public Tree()
Method Detail

getSeqs

public RawSequences getSeqs()
Specified by:
getSeqs in interface DataType

setSeqs

public void setSeqs(RawSequences rs)
Specified by:
setSeqs in interface DataType

checkPointers

public void checkPointers()

getLogLike

public double getLogLike()

recomputeCheckLogLike

public void recomputeCheckLogLike()
Recomputes the likelihood from scratch and checks whether everything was correct before. Throws error if it finds inconsistency.


countLeaves

public int countLeaves()

countSilentIndels

public void countSilentIndels()

getTopVertexId

public int getTopVertexId(int ind)

getState

public State getState()
Returns a State object representing the current state. Assumes that leaves come first in the vertex array.


printedTree

public java.lang.String printedTree()
Generates a String contaning the description of the tree in Newick format.

Returns:
the string contaning the description of the tree in Newick format.

printedTreeWithNumbers

public java.lang.String printedTreeWithNumbers()

getLogPrior

public double getLogPrior()

rowSequences

public java.lang.String rowSequences()
It generates the array of row sequences. The format is sequence name TAB row sequence.

Returns:
The string array containing the sequence names and sequences.

perSequenceData

public boolean perSequenceData()
Specified by:
perSequenceData in interface DataType
Returns:
true if the DataType contains a List of items, each of which is associated with one of the input sequences, for example protein structure coordinates.

getSummaryAssociatedWith

public java.lang.String getSummaryAssociatedWith(java.lang.String sequenceName)
Specified by:
getSummaryAssociatedWith in interface DataType

removeDataAssociatedWith

public void removeDataAssociatedWith(java.lang.String sequenceName)
Specified by:
removeDataAssociatedWith in interface DataType

makeRoot

public void makeRoot(java.lang.String taxonName)
It roots the tree on a taxon

Parameters:
taxonName - Taxon on which to root tree