final private int openCost = 100;
final private int extendCost = 5;
+
+ boolean dontRealign = false;
/*
* outputs
{
return dim;
}
+
+ public void setDontRealign(boolean dontRealign)
+ {
+ this.dontRealign = dontRealign;
+ }
}
private JCheckBox matchGaps;
+ private JCheckBox reuseAlignment;
+
private JCheckBox includeGappedColumns;
private JCheckBox shorterSequence;
paramsPanel.add(shorterSequence);
/*
+ * pasimap parameters
+ */
+ reuseAlignment = new JCheckBox("Use aligned similarity");
+ reuseAlignment.setSelected(false);
+ reuseAlignment.setVisible(false);
+ scoreModelPanel.add(reuseAlignment);
+
+
+ /*
* OK / Cancel buttons
*/
calculate = new JButton(MessageManager.getString("action.calculate"));
boolean checkAverageDistance = checkEnabled(averageDistance, size,
MIN_TREE_SELECTION);
+ reuseAlignment.setVisible(checkPasimap);
if (checkPca || checkPasimap || checkNeighbourJoining || checkAverageDistance)
{
calculate.setToolTipText(null);
* construct the panel and kick off its calculation thread
*/
pasimapPanel = new PaSiMapPanel(af.alignPanel, modelName);
+ pasimapPanel.setUseAlignment(reuseAlignment.isSelected());
new Thread(pasimapPanel).start();
}
private boolean working;
+ private boolean useObservedAlignment;
+
/**
* Constructor given sequence data, a similarity (or distance) score model
* name, and score calculation parameters
ScoreModelI scoreModel = ScoreModels.getInstance()
.getScoreModel(modelName, ap);
setPasimapModel(
- new PaSiMapModel(av, seqs, nucleotide, scoreModel));
+ new PaSiMapModel(av, seqs, nucleotide, useObservedAlignment, scoreModel));
PaintRefresher.Register(this, av.getSequenceSetId());
setRotatableCanvas(new RotatableCanvas(alignPanel));
GAP_OPEN_COST, GAP_EXTEND_COST, false);
System.out.println(pap != null);
setPairwiseAlignPanel(pap);
+ getPasimapModel().setUseObservedAlignment(useObservedAlignment);
getPasimapModel().calculate(pap);
xCombobox.setSelectedIndex(0);
{
return progressBar.getProgressBar(id);
}
+
+ /**
+ * enable or disable the pairwise alignment step
+ * @param selected
+ */
+ public void setUseAlignment(boolean selected)
+ {
+ useObservedAlignment = selected;
+ }
}
private ScoreModelI scoreModel;
private boolean nucleotide = false;
+
+ private boolean dontRealign = false;
/*
* outputs
* @param modelName
* @param params
*/
- public PaSiMapModel(AlignmentViewport seqData, SequenceI[] sqs, boolean nuc,
+ public PaSiMapModel(AlignmentViewport seqData, SequenceI[] sqs, boolean nuc, boolean dontRealign,
ScoreModelI modelName)
{
inputData = seqData;
seqs = sqs;
nucleotide = nuc;
+ this.dontRealign = dontRealign;
scoreModel = modelName;
}
public void calculate(PairwiseAlignPanel pap)
{
pasimap = new PaSiMap(inputData, scoreModel, pap);
+ pasimap.setDontRealign(dontRealign);
pasimap.run(); // executes in same thread, wait for completion
// Now find the component coordinates
{
pasimap = data;
}
+
+ public void setUseObservedAlignment(boolean useObservedAlignment)
+ {
+ dontRealign = useObservedAlignment;
+ }
}