ensured that seqeunce feature shift takes into account start position difference...
authorjprocter <Jim Procter>
Tue, 22 Jan 2008 16:14:54 +0000 (16:14 +0000)
committerjprocter <Jim Procter>
Tue, 22 Jan 2008 16:14:54 +0000 (16:14 +0000)
src/jalview/ws/DBRefFetcher.java

index c2d7ad5..ba6d57f 100644 (file)
@@ -438,13 +438,14 @@ public class DBRefFetcher implements Runnable
             SequenceFeature[] sf = sequence.getSequenceFeatures();\r
             int start = sequence.getStart();\r
             int end = sequence.getEnd();\r
+            int startShift = 1-absStart-start; // how much the features are to be shifted by\r
             for (int sfi = 0; sfi < sf.length; sfi++)\r
             {\r
               if (sf[sfi].getBegin() >= start && sf[sfi].getEnd() <= end)\r
               {\r
                 // shift feature along by absstart\r
-                sf[sfi].setBegin(sf[sfi].getBegin() + absStart);\r
-                sf[sfi].setEnd(sf[sfi].getEnd() + absStart);\r
+                sf[sfi].setBegin(sf[sfi].getBegin() + startShift);\r
+                sf[sfi].setEnd(sf[sfi].getEnd() + startShift);\r
               }\r
             }\r
           }\r