JAL-2668 add tests for HMMER commands, annotation and io
[jalview.git] / src / jalview / datamodel / Sequence.java
index 130af40..0da30ba 100755 (executable)
@@ -51,15 +51,19 @@ public class Sequence extends ASequence implements SequenceI
 
   private char[] sequence;
 
+  int previousPosition;
+
   String description;
 
   int start;
 
   int end;
 
+  boolean hasInfo;
+
   HiddenMarkovModel hmm;
 
-  boolean isHMMConsensusSequence;
+  boolean isHMMConsensusSequence = false;
 
   Vector<PDBEntry> pdbIds;
 
@@ -69,8 +73,6 @@ public class Sequence extends ASequence implements SequenceI
 
   RNA rna;
 
-  ProfilesI hinformation;
-
   /**
    * This annotation is displayed below the alignment but the positions are tied
    * to the residues of this sequence
@@ -296,6 +298,10 @@ public class Sequence extends ASequence implements SequenceI
         this.addPDBId(new PDBEntry(pdb));
       }
     }
+    if (seq.getHMM() != null)
+    {
+      this.hmm = new HiddenMarkovModel(seq.getHMM());
+    }
   }
 
   @Override
@@ -1527,6 +1533,43 @@ public class Sequence extends ASequence implements SequenceI
     this.isHMMConsensusSequence = isHMMConsensusSequence;
   }
 
+  @Override
+  public boolean hasHMMAnnotation()
+  {
+    return hasInfo;
+    /*
+    if (annotation == null)
+    {
+      return false;
+    }
+    
+    for (AlignmentAnnotation annot : annotation)
+    {
+      if (annot.label.contains("_HMM"))
+      {
+        return true;
+      }
+    }
+    return false;
+    */
+  }
 
+  @Override
+  public void setHasInfo(boolean status)
+  {
+    hasInfo = true;
+  }
+
+  @Override
+  public int getPreviousPosition()
+  {
+    return previousPosition;
+  }
+
+  @Override
+  public void setPreviousPosition(int previousPosition)
+  {
+    this.previousPosition = previousPosition;
+  }
 
 }