Merge branch 'Release_2_9_0b1_Branch'
[jalview.git] / src / jalview / datamodel / AlignedCodonFrame.java
index 8a9cd52..05492e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
  * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -399,13 +399,13 @@ public class AlignedCodonFrame
       return null;
     }
     MapList ml = null;
-    char[] dnaSeq = null;
+    SequenceI dnaSeq = null;
     for (int i = 0; i < dnaToProt.length; i++)
     {
       if (dnaToProt[i].to == protein)
       {
         ml = getdnaToProt()[i];
-        dnaSeq = dnaSeqs[i].getSequence();
+        dnaSeq = dnaSeqs[i];
         break;
       }
     }
@@ -423,8 +423,10 @@ public class AlignedCodonFrame
      * Read off the mapped nucleotides (converting to position base 0)
      */
     codonPos = MappingUtils.flattenRanges(codonPos);
-    return new char[] { dnaSeq[codonPos[0] - 1], dnaSeq[codonPos[1] - 1],
-        dnaSeq[codonPos[2] - 1] };
+    char[] dna = dnaSeq.getSequence();
+    int start = dnaSeq.getStart();
+    return new char[] { dna[codonPos[0] - start], dna[codonPos[1] - start],
+        dna[codonPos[2] - start] };
   }
 
   /**