import javax.swing.JOptionPane;
-public class HMMSearchThread extends HmmerCommand implements Runnable
+public class HMMSearch extends HmmerCommand
{
static final String HMMSEARCH = "hmmsearch";
*
* @param af
*/
- public HMMSearchThread(AlignFrame af, List<ArgumentI> args)
+ public HMMSearch(AlignFrame af, List<ArgumentI> args)
{
super(af, args);
}
/**
* Runs the HMMSearchThread: the data on the alignment or group is exported,
* then the command is executed in the command line and then the data is
- * imported and displayed in a new frame
+ * imported and displayed in a new frame. Call this method directly to execute
+ * synchronously, or via start() in a new Thread for asynchronously.
*/
@Override
public void run()
{
AlignmentI alignment = af.getViewport().getAlignment();
AlignmentI copy = new Alignment(alignment);
- List<SequenceI> hmms = copy.getHMMConsensusSequences();
- for (SequenceI seq : hmms)
+ SequenceI hmms = copy.getHmmConsensus();
+ if (hmms != null)
{
- copy.deleteSequence(seq);
+ copy.deleteSequence(hmms);
}
StockholmFile stoFile = new StockholmFile(copy);
stoFile.setSeqs(copy.getSequencesArray());
MessageManager.getString("label.trim_termini_desc"), true,
true, true, null));
}
- HMMAlignThread hmmalign = new HMMAlignThread(frame, alignArgs);
- hmmalign.hmmalignWaitTillComplete();
+ HMMAlign hmmalign = new HMMAlign(frame, alignArgs);
+ hmmalign.run();
frame = null;
hmmTemp.delete();
inputAlignmentTemp.delete();
}
}
- /**
- * Runs hmmsearch, and waits for the results to be imported before continuing
- */
- public void hmmsearchWaitTillComplete()
- {
- Thread loader = new Thread(this);
- loader.start();
-
- while (loader.isAlive())
- {
- try
- {
- Thread.sleep(500);
- } catch (Exception ex)
- {
- }
- }
-
- }
-
void readTable(File inputTableTemp) throws IOException
{
BufferedReader br = new BufferedReader(new FileReader(inputTableTemp));