|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstatalign.mcmc.McmcModule
statalign.model.ext.ModelExtension
statalign.model.ext.plugins.StructAlign
public class StructAlign
Field Summary | |
---|---|
double |
angleP
Starting value for rotation proposal tuning parameter. |
double[] |
angles
Rotation angle for each protein along the rotation axis |
double[][] |
axes
Axis of rotation for each sequence |
double[][] |
bFactors
Crystallographic temperature factors, for weighting epsilon. |
double[][][] |
coords
Alpha-C atomic coordinate for each sequence and each residue |
java.lang.String[] |
curAlign
Current alignment between all leaf sequences |
double[][] |
distanceMatrix
Pairwise distances implied by current tree topology |
double |
epsilon
|
PriorDistribution<java.lang.Double> |
epsilonPrior
|
boolean |
fixedEpsilon
|
double |
fixedEpsilonValue
Value to fix epsilon at if we're not estimating it. |
boolean |
fixedSigma2
|
double |
fixedSigma2Value
Value to fix sigma at if we're not estimating it. |
double[][] |
fullCovar
Covariance matrix implied by current tree topology |
boolean |
globalSigma
|
boolean |
globalSigmaSpike
If globalSigma = false then this switches on a spike prior at sigma2Hier. |
java.lang.String |
linkType
|
boolean |
localEpsilon
|
double |
MIN_EPSILON
Minimum value for epsilon, to prevent numerical errors. |
java.util.HashMap<java.lang.Integer,MultiNormCholesky> |
multiNorms
|
java.util.HashMap<statalign.model.ext.plugins.StructAlign.Column,MultiNormCholesky> |
multiNormsLocal
|
double |
nu
|
GammaPrior |
nuPrior
|
java.lang.String[] |
oldAlign
|
double[][] |
oldCovar
|
double[][] |
oldDist
|
double |
oldLogLi
|
java.util.HashMap<statalign.model.ext.plugins.StructAlign.Column,MultiNormCholesky> |
oldMultiNormsLocal
|
double[][][] |
rotCoords
Alpha-C atomic coordinates under the current set of rotations/translations |
RotationProposal |
rotProp
independence rotation proposal distribution |
double[] |
sigma2
Parameters of structural drift |
double |
sigma2Hier
|
GammaPrior |
sigma2HPrior
|
PriorDistribution<java.lang.Double> |
sigma2Prior
|
double |
tau
|
InverseGammaPrior |
tauPrior
|
boolean |
useLibrary
|
double |
xlatP
Starting value for translation proposal tuning parameter. |
double[][] |
xlats
Translation vector for each protein |
Fields inherited from class statalign.mcmc.McmcModule |
---|
curLogLike, printExtraInfo |
Constructor Summary | |
---|---|
StructAlign()
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addEdgeLength(double[][] distMat,
int[] subTree,
double edgeLength)
|
void |
afterAlignChange(Tree tree,
Vertex selectRoot,
boolean accepted)
Called after an alignment change proposal (accepted or rejected). |
void |
afterContinuousParamChange(Tree tree,
boolean accepted)
|
void |
afterEdgeLenChange(Tree tree,
Vertex vertex,
boolean accepted)
Called after a proposed edge length change (accepted or rejected). |
void |
afterFirstHalfBurnin()
|
void |
afterTreeChange(Tree tree,
Vertex nephew,
boolean accepted)
Called after a proposed topology change (accepted or rejected). |
void |
beforeAlignChange(Tree tree,
Vertex selectRoot)
Called before an alignment change is proposed, but after the affected subtree has been selected. |
void |
beforeContinuousParamChange(Tree tree)
|
void |
beforeEdgeLenChange(Tree tree,
Vertex vertex)
Called before an edge length change is proposed, but after the affected edge is selected. |
void |
beforeSampling(Tree tree)
Called before the start of MCMC sampling, but after the initial tree, alignment etc. have been generated. |
void |
beforeTreeChange(Tree tree,
Vertex nephew)
Called before a topology change is proposed, but after the affected branches are selected. |
double |
calcAllColumnContrib()
|
int[] |
calcDistanceMatrix(Vertex vertex,
double[][] distMat)
|
int[] |
calcDistanceMatrix(Vertex vertex,
double[][] distMat,
boolean unweighted)
recursive algorithm to traverse tree and calculate distance matrix between leaves |
double[][] |
calcFullCovar(Tree tree)
return the full covariance matrix for the tree topology and branch lengths |
double |
calcLogEm(int[] aligned)
|
void |
calcRotation(int ind)
|
int[] |
calcUnweightedDistanceMatrix(Vertex vertex,
double[][] distMat)
|
double |
columnContrib(int[] col)
Calculates the structural likelihood contribution of a single alignment column |
double |
computeLogLikeFactor(Tree tree)
|
void |
connectRmsdTrace(RmsdTrace _rmsdTrace)
|
void |
connectStructTrace(StructTrace structTrace)
|
void |
dataAdded(java.io.File file,
DataType data)
|
int |
getParamChangeWeight()
Returns the weight for choosing a parameter change for this model extension in the MCMC kernel. |
java.lang.String |
getPluginID()
|
java.util.List<javax.swing.JComponent> |
getToolBarItems()
Override this to return the list of toolbar items to be added. |
java.lang.String |
getUsageInfo()
Prints the usage information for this plugin. |
void |
init()
Called during StatAlign startup, after all ModelExtension plugins have been loaded and command line arguments have been processed (if present). |
void |
initRun(InputData inputData)
Called during the initialisation of a run if plugin is active. |
double |
logLikeAlignChange(Tree tree,
Vertex selectRoot)
|
double |
logLikeContinuousParamChange(Tree tree)
|
double |
logLikeEdgeLenChange(Tree tree,
Vertex vertex)
|
double |
logLikeFactor(Tree tree)
This should return the log of the model's contribution to the likelihood, it will be added on to the log-likelihood of the current point in the MCMC state space. |
double |
logLikeIndelParamChange(Tree tree,
Hmm hmm,
McmcMove m)
|
double |
logLikeModExtParamChange(Tree tree,
ModelExtension ext)
Computes the change in likelihood to this ModelExtension, after a change to ext . |
double |
logLikeSubstParamChange(Tree tree,
SubstitutionModel model,
int ind)
|
double |
logLikeTreeChange(Tree tree,
Vertex nephew)
|
void |
printTree(Vertex v,
java.lang.String vname)
|
void |
setActive(boolean active)
Enables or disables this plugin. |
void |
setParam(java.lang.String paramName,
boolean paramValue)
|
void |
setParam(java.lang.String paramName,
java.lang.Number paramValue)
|
void |
setParam(java.lang.String paramName,
java.lang.String paramValue)
This function is called when command line arguments are specified for a plugin. |
boolean |
useInAlignmentProposals()
If true , then this plugin is able to compute a column-wise
contribution to the likelihood, and can be used to influence the alignment
proposals that are carried out by functions inside statalign.base.Vertex
By default this is false. |
Methods inherited from class statalign.model.ext.ModelExtension |
---|
addToFilenameExtension, afterIndelParamChange, afterModExtParamChange, afterSubstParamChange, beforeIndelParamChange, beforeModExtParamChange, beforeSubstParamChange, getFilenameExtension, getPluginList, isActive, isParamChangeAccepted, isSelectable, setManager |
Methods inherited from class statalign.mcmc.McmcModule |
---|
addMcmcMove, addMcmcMove, afterSampling, getLogLike, getMcmcInfo, getMcmcMove, getMcmcMoves, incrementWeights, isFirstHalfBurnin, logPrior, modifyProposalWidths, proposeParamChange, setAllMovesNotProposed, setLogLike, setMcmc, setWeight, zeroAllMoveCounts |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean globalSigma
public boolean useLibrary
public boolean fixedEpsilon
public boolean fixedSigma2
public boolean globalSigmaSpike
public boolean localEpsilon
public double[][][] coords
public double[][] bFactors
public double[][][] rotCoords
public double[][] axes
public double[] angles
public double[][] xlats
public double[] sigma2
public double sigma2Hier
public double nu
public double tau
public double epsilon
public double[][] distanceMatrix
public double[][] fullCovar
public java.lang.String[] curAlign
public RotationProposal rotProp
public double[][] oldCovar
public double[][] oldDist
public java.lang.String[] oldAlign
public double oldLogLi
public java.lang.String linkType
public PriorDistribution<java.lang.Double> sigma2Prior
public PriorDistribution<java.lang.Double> epsilonPrior
public InverseGammaPrior tauPrior
public GammaPrior sigma2HPrior
public GammaPrior nuPrior
public final double angleP
public final double xlatP
public double fixedSigma2Value
public double MIN_EPSILON
public double fixedEpsilonValue
public java.util.HashMap<java.lang.Integer,MultiNormCholesky> multiNorms
public java.util.HashMap<statalign.model.ext.plugins.StructAlign.Column,MultiNormCholesky> multiNormsLocal
public java.util.HashMap<statalign.model.ext.plugins.StructAlign.Column,MultiNormCholesky> oldMultiNormsLocal
Constructor Detail |
---|
public StructAlign()
Method Detail |
---|
public java.lang.String getPluginID()
getPluginID
in class ModelExtension
public boolean useInAlignmentProposals()
ModelExtension
true
, then this plugin is able to compute a column-wise
contribution to the likelihood, and can be used to influence the alignment
proposals that are carried out by functions inside statalign.base.Vertex
By default this is false.
useInAlignmentProposals
in class ModelExtension
public java.util.List<javax.swing.JComponent> getToolBarItems()
ModelExtension
null
.
getToolBarItems
in class ModelExtension
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public java.lang.String getUsageInfo()
ModelExtension
getUsageInfo
in class ModelExtension
public void setActive(boolean active)
ModelExtension
setActive
in class ModelExtension
active
- true
if plugin should be enabledpublic void setParam(java.lang.String paramName, java.lang.String paramValue)
ModelExtension
ModelExtension
does not override these methods
then it cannot handle any command line arguments, and so the default
error is returned. The overriding method should call
super.setParam(paramName,paramValue)
in the case that paramName
is unrecognised.
An overriding method can also include a call such as
addToFilenameExtension(paramName+"_"+paramValue);
which will result in an informative string being appended to the names
of any output files generated by the Postprocess
plugins.
setParam
in class ModelExtension
paramName
- The name of a parameter that is to be set.paramValue
- The value to which it will be set.public void setParam(java.lang.String paramName, java.lang.Number paramValue)
setParam
in class ModelExtension
public void setParam(java.lang.String paramName, boolean paramValue)
setParam
in class ModelExtension
public void init()
ModelExtension
init
in class ModelExtension
public void initRun(InputData inputData) throws java.lang.IllegalArgumentException
ModelExtension
initRun
in class ModelExtension
java.lang.IllegalArgumentException
- if the run should be terminated as input data is illegalpublic void beforeSampling(Tree tree)
McmcModule
beforeSampling
in class McmcModule
tree
- the starting treepublic void afterFirstHalfBurnin()
afterFirstHalfBurnin
in class McmcModule
public double computeLogLikeFactor(Tree tree)
public double logLikeFactor(Tree tree)
McmcModule
logLikeFactor
in class McmcModule
tree
- current tree
public double calcAllColumnContrib()
public double columnContrib(int[] col)
col
- the column, id of the residue for each sequence (or -1 if gapped in column)
public void calcRotation(int ind)
public double[][] calcFullCovar(Tree tree)
public void printTree(Vertex v, java.lang.String vname)
public int[] calcUnweightedDistanceMatrix(Vertex vertex, double[][] distMat)
public int[] calcDistanceMatrix(Vertex vertex, double[][] distMat)
public int[] calcDistanceMatrix(Vertex vertex, double[][] distMat, boolean unweighted)
public void addEdgeLength(double[][] distMat, int[] subTree, double edgeLength)
public int getParamChangeWeight()
ModelExtension
McmcModule.proposeParamChange(Tree)
from ever being called.
getParamChangeWeight
in class ModelExtension
public double logLikeModExtParamChange(Tree tree, ModelExtension ext)
ModelExtension
ext
.
logLikeModExtParamChange
in class ModelExtension
ext
- The ModelExtension
that just changed.
public void beforeAlignChange(Tree tree, Vertex selectRoot)
ModelExtension
beforeAlignChange
in class ModelExtension
tree
- the current treeselectRoot
- root of the selected subtreepublic double logLikeAlignChange(Tree tree, Vertex selectRoot)
logLikeAlignChange
in class ModelExtension
public void afterAlignChange(Tree tree, Vertex selectRoot, boolean accepted)
ModelExtension
afterAlignChange
in class ModelExtension
tree
- the current treeselectRoot
- root of the selected subtreeaccepted
- true if the change was acceptedpublic void beforeTreeChange(Tree tree, Vertex nephew)
ModelExtension
beforeTreeChange
in class ModelExtension
tree
- the current treenephew
- node that is proposed to be swapped with its "uncle"public double logLikeTreeChange(Tree tree, Vertex nephew)
logLikeTreeChange
in class ModelExtension
public void afterTreeChange(Tree tree, Vertex nephew, boolean accepted)
ModelExtension
afterTreeChange
in class ModelExtension
tree
- the tree after the changenephew
- the new nephew (this is the deepest lying node that was affected by the change if there was one)accepted
- true if the change was acceptedpublic void beforeContinuousParamChange(Tree tree)
public double logLikeContinuousParamChange(Tree tree)
public void afterContinuousParamChange(Tree tree, boolean accepted)
public double logLikeEdgeLenChange(Tree tree, Vertex vertex)
logLikeEdgeLenChange
in class ModelExtension
public void beforeEdgeLenChange(Tree tree, Vertex vertex)
ModelExtension
beforeEdgeLenChange
in class ModelExtension
tree
- the current treevertex
- the node whose edge to its parent is selected to be changedpublic void afterEdgeLenChange(Tree tree, Vertex vertex, boolean accepted)
ModelExtension
afterEdgeLenChange
in class ModelExtension
tree
- the current treevertex
- the node whose edge to its parent was selectedaccepted
- true if the change was acceptedpublic double logLikeIndelParamChange(Tree tree, Hmm hmm, McmcMove m)
logLikeIndelParamChange
in class ModelExtension
public double logLikeSubstParamChange(Tree tree, SubstitutionModel model, int ind)
logLikeSubstParamChange
in class ModelExtension
public double calcLogEm(int[] aligned)
calcLogEm
in class ModelExtension
aligned
- Vector indicating which characters are aligned to the current
column in the subtrees below.
public void connectStructTrace(StructTrace structTrace)
public void connectRmsdTrace(RmsdTrace _rmsdTrace)
public void dataAdded(java.io.File file, DataType data)
dataAdded
in class ModelExtension
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |