private final AlignmentI dataset;
- private AlignmentView msa;
-
/**
* Constructor for the HMMAlignThread
*
long msgId = System.currentTimeMillis();
af.setProgressBar(MessageManager.getString("status.running_hmmalign"),
msgId);
- prepareAlignment();
- SequenceI[][] subAlignments = msa.getVisibleContigs('-');
+
+ AlignmentView msa = af.gatherSequencesForAlignment();
+ SequenceI[][] subAlignments = msa.getVisibleContigs(alignment.getGapCharacter());
List<AlignmentOrder> allOrders = new ArrayList<>();
job++;
}
- displayResults(allResults, allOrders);
+ String title = "hmmalign to " + hmm.getConsensusSequence().getName();
+ displayResults(allResults, allOrders, msa, title);
af.setProgressBar("", msgId);
}
* @throws IOException
*/
private boolean runCommand(File modelFile, File alignmentFile,
- File resultFile)
- throws IOException
+ File resultFile) throws IOException
{
String command = getCommandPath(HMMALIGN);
if (command == null)
}
/**
- * Gathers the sequences in preparation for the alignment.
- */
- private void prepareAlignment()
- {
- msa = af.gatherSequencesForAlignment();
- }
-
- /**
* Displays the results of all 'jobs' in a new frame
*
* @param allResults
*
* @param allOrders
+ * @param msa
+ * @param title
*/
private void displayResults(SequenceI[][] allResults,
- List<AlignmentOrder> allOrders)
+ List<AlignmentOrder> allOrders, AlignmentView msa, String title)
{
AlignmentOrder[] arrOrders = allOrders
.toArray(new AlignmentOrder[allOrders.size()]);
- Object[] newview = msa.getUpdatedView(allResults, arrOrders, '-');
+ Object[] newview = msa.getUpdatedView(allResults, arrOrders,
+ alignment.getGapCharacter());
SequenceI[] seqs = (SequenceI[]) newview[0];
HiddenColumns hidden = (HiddenColumns) newview[1];
Alignment al = new Alignment(seqs);
al.setDataset(dataset);
}
- displayInNewFrame(al, allOrders, hidden);
+ displayInNewFrame(al, allOrders, hidden, title);
}
/**
* run
* @param hidden
* Hidden columns in the previous alignment
+ * @param title
*/
private void displayInNewFrame(AlignmentI al,
- List<AlignmentOrder> alorders, HiddenColumns hidden)
+ List<AlignmentOrder> alorders, HiddenColumns hidden, String title)
{
AlignFrame alignFrame = new AlignFrame(al, hidden, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
+ alignFrame.setTitle(title);
FeatureRendererSettings featureSettings = af.getFeatureRenderer()
.getSettings();