*/
public void run()
{
+ details.append("PCA Calculation Mode is "+(jvCalcMode ? "Jalview variant" : "Original SeqSpace")+"\n");
Matrix mt = m.transpose();
details.append(" --- OrigT * Orig ---- \n");
- // eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
- eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
+ if (!jvCalcMode)
+ {
+ eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
+ }
+ else
+ {
+ eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
+ }
PrintStream ps = new PrintStream(System.out)
{
* ps.print(","+component(seq, ev)); } ps.println(); }
*/
}
+
+ boolean jvCalcMode = true;
+
+ public void setJvCalcMode(boolean calcMode)
+ {
+ this.jvCalcMode = calcMode;
+ }
}
nuclSetting.setSelected(pcaModel.isNucleotide());
protSetting.setSelected(!pcaModel.isNucleotide());
top=pcaModel.getTop();
+ jvVersionSetting.setSelected(pcaModel.isJvCalcMode());
} catch (OutOfMemoryError er)
{
if (pcaModel.isNucleotide())
{
pcaModel.setNucleotide(false);
+ Thread worker = new Thread(this);
+ worker.start();
+ }
+ }
+
+ @Override
+ protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
+ {
+ pcaModel.setJvCalcMode(jvVersionSetting.isSelected());
Thread worker = new Thread(this);
worker.start();
- }
}
+
/**
* DOCUMENT ME!
*/
protected JMenu calcSettings=new JMenu();
protected JCheckBoxMenuItem nuclSetting=new JCheckBoxMenuItem();
protected JCheckBoxMenuItem protSetting=new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem jvVersionSetting=new JCheckBoxMenuItem();
protected JLabel statusBar = new JLabel();
protected GridLayout statusPanelLayout = new GridLayout();
{
protSetting_actionPerfomed(arg0);
}
- });calcSettings.add(nuclSetting);
+ });
+ jvVersionSetting.setText("Jalview PCA Calculation");
+ jvVersionSetting.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent arg0)
+ {
+ jvVersionSetting_actionPerfomed(arg0);
+ }
+ });
+ calcSettings.add(jvVersionSetting);
+ calcSettings.add(nuclSetting);
calcSettings.add(protSetting);
statusPanel.setLayout(statusPanelLayout);
statusBar.setFont(new java.awt.Font("Verdana",0,12));
{
}
+
+ protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
}
nucleotide=nucleotide2;
}
- PCA pca;
+ private volatile PCA pca;
int top;
private Vector<SequencePoint> points;
+ private boolean jvCalcMode=true;
+
+ public boolean isJvCalcMode()
+ {
+ return jvCalcMode;
+ }
+
public void run()
{
pca = new PCA(seqstrings.getSequenceStrings(' '), nucleotide);
+ pca.setJvCalcMode(jvCalcMode);
pca.run();
// Now find the component coordinates
return pts;
}
+ public void setJvCalcMode(boolean state)
+ {
+ jvCalcMode=state;
+ }
+
}