{
}
;
- Object[] alAndColsel = pcaModel.getSeqtrings()
+ Object[] alAndColsel = pcaModel.getInputData()
.getAlignmentAndHiddenColumns(gc);
if (alAndColsel != null && alAndColsel[0] != null)
panel.pcaModel.setPCA(pca);
/*
+ * we haven't saved the input data! (JAL-2647 to do)
+ */
+ panel.setInputData(null);
+
+ /*
* add the sequence points for the PCA display
*/
List<jalview.datamodel.SequencePoint> seqPoints = new ArrayList<>();
printer.start();
}
+ /**
+ * If available, shows the data which formed the inputs for the PCA as a new
+ * alignment
+ */
@Override
public void originalSeqData_actionPerformed()
{
- // this was cut'n'pasted from the equivalent TreePanel method - we should
- // make this an abstract function of all jalview analysis windows
- if (pcaModel.getSeqtrings() == null)
+ // JAL-2647 disabled after load from project (until save to project done)
+ if (pcaModel.getInputData() == null)
{
Cache.log.info(
"Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
}
// decide if av alignment is sufficiently different to original data to
// warrant a new window to be created
- // create new alignmnt window with hidden regions (unhiding hidden regions
+ // create new alignment window with hidden regions (unhiding hidden regions
// yields unaligned seqs)
// or create a selection box around columns in alignment view
// test Alignment(SeqCigar[])
{
}
- Object[] alAndColsel = pcaModel.getSeqtrings()
+ Object[] alAndColsel = pcaModel.getInputData()
.getAlignmentAndHiddenColumns(gc);
if (alAndColsel != null && alAndColsel[0] != null)
{
showLabels.setSelected(show);
}
+
+ /**
+ * Sets the input data used to calculate the PCA. This is provided for
+ * 'restore from project', which does not currently support this (AL-2647), so
+ * sets the value to null, and hides the menu option for "Input Data...". J
+ *
+ * @param data
+ */
+ public void setInputData(AlignmentView data)
+ {
+ pcaModel.setInputData(data);
+ originalSeqData.setVisible(data != null);
+ }
}
protected JPanel statusPanel = new JPanel();
+ protected JMenuItem originalSeqData;
+
/**
* Constructor
*/
bgcolour_actionPerformed();
}
});
- JMenuItem originalSeqData = new JMenuItem();
+ originalSeqData = new JMenuItem();
originalSeqData.setText(MessageManager.getString("label.input_data"));
originalSeqData.addActionListener(new ActionListener()
{
/*
* inputs
*/
- private final AlignmentView seqstrings;
+ private AlignmentView inputData;
private final SequenceI[] seqs;
public PCAModel(AlignmentView seqData, SequenceI[] sqs, boolean nuc,
ScoreModelI modelName, SimilarityParamsI params)
{
- seqstrings = seqData;
+ inputData = seqData;
seqs = sqs;
nucleotide = nuc;
scoreModel = modelName;
*/
public void calculate()
{
- pca = new PCA(seqstrings, scoreModel, similarityParams);
+ pca = new PCA(inputData, scoreModel, similarityParams);
pca.run(); // executes in same thread, wait for completion
// Now find the component coordinates
return pca.getDetails();
}
- public AlignmentView getSeqtrings()
+ public AlignmentView getInputData()
{
- return seqstrings;
+ return inputData;
+ }
+
+ public void setInputData(AlignmentView data)
+ {
+ inputData = data;
}
public String getPointsasCsv(boolean transformed, int xdim, int ydim,