JAL-2629 removed SequenceI.get/setLastPosition and related code
[jalview.git] / src / jalview / hmmer / HMMSearchThread.java
index 16c7c68..d3f8968 100644 (file)
@@ -48,8 +48,6 @@ public class HMMSearchThread extends HmmerCommand implements Runnable
 
   long barID;
 
-  SequenceI hmmSeq;
-
   List<ArgumentI> params;
 
   File hmmTemp = null;
@@ -97,7 +95,7 @@ public class HMMSearchThread extends HmmerCommand implements Runnable
       hmm = af.getSelectedHMM();
     }
 
-    hmmSeq = af.getSelectedHMMSequence();
+    SequenceI hmmSeq = af.getSelectedHMMSequence();
     barID = System.currentTimeMillis();
     af.setProgressBar(MessageManager.getString("status.running_hmmsearch"),
             barID);
@@ -131,7 +129,7 @@ public class HMMSearchThread extends HmmerCommand implements Runnable
     }
     try
     {
-      importData();
+      importData(hmmSeq);
     } catch (IOException | InterruptedException e)
     {
       // TODO Auto-generated catch block
@@ -234,7 +232,11 @@ public class HMMSearchThread extends HmmerCommand implements Runnable
     {
       AlignmentI alignment = af.getViewport().getAlignment();
       AlignmentI copy = new Alignment(alignment);
-      copy.getHMMConsensusSequences(true);
+      List<SequenceI> hmms = copy.getHMMConsensusSequences();
+      for (SequenceI seq : hmms)
+      {
+        copy.deleteSequence(seq);
+      }
       StockholmFile stoFile = new StockholmFile(copy);
       stoFile.setSeqs(copy.getSequencesArray());
       String alignmentString = stoFile.print();
@@ -253,8 +255,11 @@ public class HMMSearchThread extends HmmerCommand implements Runnable
   /**
    * Imports the data from the temporary file to which the output of hmmsearch
    * is directed.
+   * 
+   * @param hmmSeq
    */
-  private void importData() throws IOException, InterruptedException
+  private void importData(SequenceI hmmSeq)
+          throws IOException, InterruptedException
   {
     BufferedReader br = new BufferedReader(
             new FileReader(inputAlignmentTemp));