Correction for sequences with start not equal to 1
authoramwaterhouse <Andrew Waterhouse>
Wed, 10 May 2006 13:30:10 +0000 (13:30 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 10 May 2006 13:30:10 +0000 (13:30 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index d75683c..ae3c5f9 100755 (executable)
@@ -254,7 +254,7 @@ public class AlignmentAnnotation
         if(startRes < sequenceRef.getStart())\r
           startRes = sequenceRef.getStart();\r
 \r
-        int seqPos, seqIndex;\r
+        int seqPos;\r
 \r
         int fileOffset = 0;\r
         if(startRes > sequenceRef.getStart())\r
@@ -264,16 +264,13 @@ public class AlignmentAnnotation
 \r
         for(int i = 0; i < annotations.length; i++)\r
         {\r
-            seqPos = sequenceRef.findPosition(i - fileOffset)-1;\r
+            seqPos = sequenceRef.findPosition(i + fileOffset);\r
             if(seqPos<annotations.length)\r
             {\r
-              if (annotations[seqPos] != null)\r
+              if (annotations[i] != null)\r
               {\r
-                seqIndex = sequenceRef.findIndex(i) + 1;\r
-\r
-                if(seqIndex>=startRes)\r
-                sequenceMapping.put(new Integer(seqIndex),\r
-                                    annotations[seqPos]);\r
+                  sequenceMapping.put(new Integer(seqPos),\r
+                                      annotations[i]);\r
               }\r
             }\r
          }\r