JAL-1233 tidy up and use same RNA helix colours in colour by annotation and RNA helix...
[jalview.git] / src / jalview / datamodel / Alignment.java
index 482df7f..5d1fc60 100755 (executable)
@@ -1664,8 +1664,8 @@ public class Alignment implements AlignmentI
    * identically. If this is nucleotide and the other is protein, make 3 gaps
    * for each gap in the protein sequences. If this is protein and the other is
    * nucleotide, insert a gap for each 3 gaps (or part thereof) between
-   * nucleotide bases. Does nothing if alignment of protein from cDNA is
-   * requested (not yet implemented).
+   * nucleotide bases. If this is protein and the other is nucleotide, gaps
+   * protein to match the relative ordering of codons in the nucleotide.
    * 
    * Parameters control whether gaps in exon (mapped) and intron (unmapped)
    * regions are preserved. Gaps that connect introns to exons are treated
@@ -1697,6 +1697,9 @@ public class Alignment implements AlignmentI
             { thisGapChar, thisGapChar, thisGapChar }) : String
             .valueOf(thisGapChar);
 
+    // TODO handle intron regions? Needs a 'holistic' alignment of dna,
+    // not just sequence by sequence. But how to 'gap' intron regions?
+
     /*
      * Get mappings from 'that' alignment's sequences to this.
      */
@@ -1731,4 +1734,19 @@ public class Alignment implements AlignmentI
     }
     return names;
   }
+
+  @Override
+  public boolean hasValidSequence()
+  {
+    boolean hasValidSeq = false;
+    for (SequenceI seq : getSequences())
+    {
+      if ((seq.getEnd() - seq.getStart()) > 0)
+      {
+        hasValidSeq = true;
+        break;
+      }
+    }
+    return hasValidSeq;
+  }
 }