|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstatalign.base.Vertex
public class Vertex
This is a vertex of the tree. The 'hardcore' functions are implemented in this class, developers are suggested not change functions in it. The implemented functions are quite unreadable, since we opted for efficiency and not readability. You should be able to develop novel functionality of the software package (postprocessing, substitution models, etc.) without touching this class.
Field Summary | |
---|---|
double |
edgeLength
The length of the edge that connects this vertex with its parent. |
AlignColumn |
first
|
double |
indelLogLike
The log-sum of the cumulative insertion-deletion loglikelihoods up to this vertex (ie. summed over the subtree below this vertex.). |
int |
index
Index of this vertex in the Tree.vertex array |
int |
leafCount
|
Vertex |
left
This reference points to the left child of the vertex. |
java.lang.String |
name
The name of the sequence associated to the vertex. |
int |
nSilentIndels
|
double |
orphanLogLike
The log-sum of the Felsenstein's likelihoods of characters that are inserted into the sequence of this vertex. |
Vertex |
parent
This reference points to the parent of the vertex |
Vertex |
right
This reference points to the right child of the vertex. |
boolean |
selected
|
Constructor Summary | |
---|---|
Vertex(Tree tree)
|
|
Vertex(Vertex parent)
|
Method Summary | |
---|---|
void |
alignRestore()
Restores all the changes an alignment resampling on the currently selected subtree has produced. |
Vertex |
brother()
|
void |
calcAllUp()
Calculates Felsenstein and indel likelihoods up to root, starting from `parent' |
void |
calcFelsen()
|
void |
calcFelsenRecursively()
This function calculates the Felsenstein likelihood for the subtree below this . |
void |
calcIndelLogLike()
|
void |
calcIndelLogLikeRecursively()
|
void |
calcOrphan()
|
void |
calcOrphanRecursively()
|
void |
calcUpperFromRoot()
|
void |
calcUpperRecursively()
This function calculates the upper probability vectors, which contain the partial likelihoods for everything except this subtree. |
void |
calcUpperRecursivelyWithCheck()
|
double |
calcSumOfEdges()
Calculate the sum of branch lengths below on this vertex. |
void |
checkPointers()
this function checks if the pointers are all right... |
void |
computeWeights(statalign.base.Vertex.Neighbours curr,
double[] logProbs)
Computes the probability of all the possible imputations for parent and grandpa given the neighbouring AlignColumn objects. |
void |
edgeChangeUpdate()
|
void |
exciseAllSilentIndels()
|
double |
exciseSilentIndel()
|
double |
exciseSilentIndel(AlignColumn c)
|
double |
exciseSilentIndel(AlignColumn c,
boolean remove)
|
double |
exciseSilentIndelBlock(AlignColumn insert,
boolean remove)
|
void |
fastSwapBackUncle()
Restores the exact state just before the call of fastSwapWithUncle() . |
double |
fastSwapWithUncle()
Swaps this with its uncle, but keeps alignment columns where this , its parent,
the uncle node and its parent are all aligned unchanged with a given probability, and only
proposes new alignments between these selected alignment anchors columns. |
int |
favouredDestination(int state)
|
int |
getLength()
|
double |
hmm2AlignWithSave()
Samples a new alignment between `this' & `this.parent', taking window sizes into account. |
double |
hmm2AlignWithSave(double heat)
|
double |
insertSilentIndel()
|
double |
insertSilentIndel(AlignColumn c)
|
double |
insertSilentIndelBlock(AlignColumn c)
|
double |
maxDepth()
Calculate the maximum depth below on this vertex. |
double |
modifySilentIndel(boolean insert)
|
double |
nephewUncleSwapFixedColumns()
|
double |
nephewUncleSwapFixedColumns2()
|
double |
nephewUncleSwapFixedColumns3()
|
java.lang.String |
print(int digits)
|
void |
print(java.lang.StringBuffer b)
|
void |
print(java.lang.StringBuffer b,
boolean withNumbers)
|
static void |
printChildren(Vertex v)
|
java.lang.String[] |
printedAlignment()
|
java.lang.String[] |
printedAlignment(boolean inWindow)
|
static void |
printEdges(Vertex v)
|
void |
printPointers()
|
void |
printToScreenAlignment(int windowStart,
int windowEnd)
|
void |
printToScreenAlignment(int windowStart,
int windowEnd,
boolean printAll)
|
void |
printWithNumbers(java.lang.StringBuffer b)
|
double |
realignToParent()
|
double |
realignToParent(boolean useCurrentWin)
|
double |
realignToParent(boolean useCurrentWin,
double heat)
Samples a new alignment between the subtree rooted at this vertex and the rest of the sequences. |
double |
realignToParent(double heat)
|
void |
recomputeCheckLogLike()
|
void |
recomputeLogLike()
|
void |
recomputeLogLikeSelected()
|
void |
recursivelyUpdateHmm2Matrices()
|
void |
recursivelyUpdateHmm3Matrices()
|
void |
recursivelyUpdateHmmMatrices()
|
void |
restoreData()
|
void |
restoreFiveWay()
|
void |
restoreFiveWay(boolean swapNephewUncle)
|
void |
saveData()
|
double |
selectAndResampleAlignment()
This function cuts out a window and realigns in the selected subtree. |
void |
selectSubtree(double[] weights,
int level)
Selects a subtree |
void |
setEdgeLength(double x)
|
void |
swapBackUncleAlignToParent()
Restores the exact state just before the call to swapWithUncleAlignToParent() . |
double |
swapWithUncleAlignToParent()
Swaps this with its uncle, but proposes new alignments only between this node and its parent, and
the uncle node and its parent, every other alignment is kept fixed. |
void |
undoExciseSilentIndel()
|
void |
undoInsertSilentIndel()
|
void |
updateAligned()
|
void |
updateAlignedInWindow()
|
void |
updateAlignedParent()
|
void |
updateAlignedParentInWindow()
|
void |
updateAlignedRecursively()
|
void |
updateAlignedRecursivelyInWindow()
|
void |
updateAlignedRecursivelyInWindowWithCheck()
|
void |
updateAlignedRecursivelyWithCheck()
|
void |
updateHmm2Matrices()
|
void |
updateHmm2Matrix(double[] params)
|
void |
updateHmmMatrices()
|
void |
updateTransitionMatrix()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String name
public int index
public Vertex parent
public Vertex left
public Vertex right
public int nSilentIndels
public AlignColumn first
public boolean selected
public double edgeLength
public double orphanLogLike
public double indelLogLike
public int leafCount
Constructor Detail |
---|
public Vertex(Tree tree)
public Vertex(Vertex parent)
Method Detail |
---|
public Vertex brother()
public void updateTransitionMatrix()
public void updateHmm2Matrix(double[] params)
public void updateHmmMatrices()
public void recursivelyUpdateHmmMatrices()
public void updateHmm2Matrices()
public void recursivelyUpdateHmm2Matrices()
public void recursivelyUpdateHmm3Matrices()
public void setEdgeLength(double x)
public static void printChildren(Vertex v)
public static void printEdges(Vertex v)
public void edgeChangeUpdate()
public void printWithNumbers(java.lang.StringBuffer b)
public void print(java.lang.StringBuffer b)
public void print(java.lang.StringBuffer b, boolean withNumbers)
public java.lang.String print(int digits)
public void recomputeLogLike()
public void recomputeLogLikeSelected()
public void recomputeCheckLogLike()
public void calcUpperFromRoot()
public void calcUpperRecursively()
public void calcUpperRecursivelyWithCheck()
public void calcFelsenRecursively()
this
.
When called from the root, the result is stored in orphanLogLike
at the root.
public void calcFelsen()
public void calcOrphan()
public void calcOrphanRecursively()
public void calcIndelLogLikeRecursively()
public void calcIndelLogLike()
public double hmm2AlignWithSave()
public double hmm2AlignWithSave(double heat)
public void selectSubtree(double[] weights, int level)
public double selectAndResampleAlignment()
public double realignToParent(double heat)
public double realignToParent()
public double realignToParent(boolean useCurrentWin)
public double realignToParent(boolean useCurrentWin, double heat)
useCurrentWin
- if true then keeps the current window selection for this node
(backproposal and proposal for window selection must be computed by the caller)
public void updateAligned()
public void updateAlignedInWindow()
public void updateAlignedParentInWindow()
public void updateAlignedParent()
public void updateAlignedRecursively()
public void updateAlignedRecursivelyInWindow()
public void updateAlignedRecursivelyInWindowWithCheck()
public void updateAlignedRecursivelyWithCheck()
public void alignRestore()
public void restoreFiveWay()
public void restoreFiveWay(boolean swapNephewUncle)
public void computeWeights(statalign.base.Vertex.Neighbours curr, double[] logProbs)
curr
- Neighbours struct corresponding to current stateold
- Neighbours struct corresponding to original statepublic int favouredDestination(int state)
public void saveData()
public void restoreData()
public double insertSilentIndel()
public double insertSilentIndel(AlignColumn c)
public double insertSilentIndelBlock(AlignColumn c)
public void undoInsertSilentIndel()
public void undoExciseSilentIndel()
public double exciseSilentIndel()
public double exciseSilentIndel(AlignColumn c)
public double exciseSilentIndel(AlignColumn c, boolean remove)
public void exciseAllSilentIndels()
public double modifySilentIndel(boolean insert)
public double exciseSilentIndelBlock(AlignColumn insert, boolean remove)
public double nephewUncleSwapFixedColumns3()
public double nephewUncleSwapFixedColumns2()
public double nephewUncleSwapFixedColumns()
public double swapWithUncleAlignToParent()
this
with its uncle, but proposes new alignments only between this node and its parent, and
the uncle node and its parent, every other alignment is kept fixed. Slow because full sequence
alignment is done.
Assumes this
has a non-null grandparent.
public void swapBackUncleAlignToParent()
swapWithUncleAlignToParent()
.
Must be called on ex-uncle node.
Assumes this
has a non-null grandparent.
public double fastSwapWithUncle()
this
with its uncle, but keeps alignment columns where this
, its parent,
the uncle node and its parent are all aligned unchanged with a given probability, and only
proposes new alignments between these selected alignment anchors columns. Alignments between
other sequences than the above mentioned four are kept unchanged.
Assumes this
has a non-null grandparent.
public void fastSwapBackUncle()
fastSwapWithUncle()
.
Must be called on ex-uncle node.
Assumes this
has a non-null grandparent.
public void calcAllUp()
public java.lang.String[] printedAlignment(boolean inWindow)
public java.lang.String[] printedAlignment()
public void printPointers()
public void printToScreenAlignment(int windowStart, int windowEnd)
public void printToScreenAlignment(int windowStart, int windowEnd, boolean printAll)
public double calcSumOfEdges()
public double maxDepth()
public void checkPointers()
public int getLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |