statalign.postprocess.plugins
Class CurrentAlignment

java.lang.Object
  extended by statalign.postprocess.Postprocess
      extended by statalign.postprocess.plugins.CurrentAlignment

public class CurrentAlignment
extends Postprocess

This is the postprocessmanager for showing the current alignment.

Author:
miklos, novak

Field Summary
 java.lang.String[] allAlignment
           
 java.lang.String[] leafAlignment
           
 javax.swing.JPanel pan
           
 boolean showFullAlignment
          Whether to plot the full alignment with internal nodes.
 java.lang.String title
           
 
Fields inherited from class statalign.postprocess.Postprocess
active, alignmentType, file, hasToolBar, mcmc, outputable, outputFile, postprocessable, postprocessWrite, rnaAssociated, sampling, screenable, selected, show
 
Constructor Summary
CurrentAlignment()
          It construct a postprocess that is screenable (=can be shown on the GUI), outputable (= can be written into th elog file) but not postprocessable (= cannot generate its own output file).
 
Method Summary
 void beforeFirstSample(InputData input)
          Initializes the graphical interface.
 java.lang.String getFileExtension()
          Returns default file extension that is to appended to the input file name to get the file this plugin is writing into.
 javax.swing.Icon getIcon()
          It generates a new icon based on the figure in file icons/calignment.gif
 javax.swing.JPanel getJPanel()
          It constructs a new JPanel, and returns with it
 java.lang.String getTabName()
          It returns with its tab name, 'Alignment'
 double getTabOrder()
          Specifies the order of the tab for this plugin in the GUI.
 java.lang.String getTip()
          It returns with the tip of the tabulated panel 'Current alignment in the Markov chain' (shown when mouse is moved over the panel)
 void newPeek(State state)
          Updates the alignment.
 void newSample(State state, int no, int total)
          At each mcmc sampling point, the current alignment is shown on the GUI.
 void setSampling(boolean enabled)
          Toggles sampling mode.
 void singleFilePrint(int no, int total)
          Temporary fileprinting method to generate single files containing the current alignment.
 
Methods inherited from class statalign.postprocess.Postprocess
addTrack, afterLastSample, getDependences, getModExtPlugins, getToolBarItems, getTracks, init, newSample, newStep, refToDependences, reloadPanel, setSelected
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pan

public javax.swing.JPanel pan

allAlignment

public java.lang.String[] allAlignment

leafAlignment

public java.lang.String[] leafAlignment

title

public java.lang.String title

showFullAlignment

public boolean showFullAlignment
Whether to plot the full alignment with internal nodes.

Constructor Detail

CurrentAlignment

public CurrentAlignment()
It construct a postprocess that is screenable (=can be shown on the GUI), outputable (= can be written into th elog file) but not postprocessable (= cannot generate its own output file).

Method Detail

getJPanel

public javax.swing.JPanel getJPanel()
It constructs a new JPanel, and returns with it

Specified by:
getJPanel in class Postprocess
Returns:
Returns with the panel of the GUI

getIcon

public javax.swing.Icon getIcon()
It generates a new icon based on the figure in file icons/calignment.gif

Specified by:
getIcon in class Postprocess
Returns:
Returns with the icon that will appear on the label of the tabulated panel.

getTabName

public java.lang.String getTabName()
It returns with its tab name, 'Alignment'

Specified by:
getTabName in class Postprocess
Returns:
Returns with the name that will appear on the label of the tabulated panel.

getTip

public java.lang.String getTip()
It returns with the tip of the tabulated panel 'Current alignment in the Markov chain' (shown when mouse is moved over the panel)

Specified by:
getTip in class Postprocess

getTabOrder

public double getTabOrder()
Description copied from class: Postprocess
Specifies the order of the tab for this plugin in the GUI.

E.g. we probably always want the "sequence input"-tab to appear first and therefore it returns a 1.0d here. The "current alignment"-tab returns 2.0d here and so if we want to make a tab get ordered between the "sequence input" and the "current alignment"-tabs we just make that plugin return 1.5d or something similar here. By default tabs get ordered last.

Overrides:
getTabOrder in class Postprocess
Returns:
the tab order of the tab associated with this plugin, if running in a GUI.

getFileExtension

public java.lang.String getFileExtension()
Description copied from class: Postprocess
Returns default file extension that is to appended to the input file name to get the file this plugin is writing into.

Overrides:
getFileExtension in class Postprocess

newPeek

public void newPeek(State state)
Updates the alignment.

Overrides:
newPeek in class Postprocess
Parameters:
state - A State object representing the current state of the chain

beforeFirstSample

public void beforeFirstSample(InputData input)
Initializes the graphical interface.

Overrides:
beforeFirstSample in class Postprocess

newSample

public void newSample(State state,
                      int no,
                      int total)
At each mcmc sampling point, the current alignment is shown on the GUI. Also, it writes the current alignment into the log file when in sampling mode.

Overrides:
newSample in class Postprocess
Parameters:
state - A State object representing the current state of the chain
no - The number of the current sample
total - The number of the total samples

singleFilePrint

public void singleFilePrint(int no,
                            int total)
Temporary fileprinting method to generate single files containing the current alignment. Used when testing the performance of cold and heated chains in mcmcmc.


setSampling

public void setSampling(boolean enabled)
Toggles sampling mode.

Specified by:
setSampling in class Postprocess
Parameters:
enabled - Set it true if you need samples.