basic support for multi-exon CDS features
[jalview.git] / src / jalview / datamodel / xdb / embl / EmblFeatureLocations.java
index 878042d..bbd3948 100644 (file)
@@ -45,6 +45,7 @@ public class EmblFeatureLocations {
     }\r
     /**\r
      * Return all location elements as start-end pairs on referenced sequence \r
+     * TODO: pass back complement and 'less than or more than' range information\r
      * @return int[] { start1, end1, ... }\r
      */\r
     public int[] getElementRanges() {\r
@@ -61,6 +62,23 @@ public class EmblFeatureLocations {
             }\r
             return se;\r
         }\r
+        if (locationType.equalsIgnoreCase("join")) {\r
+            int[] se = new int[locElements.size()*2];            \r
+            int sepos=0;\r
+            for (Iterator le=locElements.iterator();le.hasNext();) {\r
+                EmblFeatureLocElement loce = (EmblFeatureLocElement) le.next();\r
+                BasePosition bp[] = loce.getBasePositions();\r
+                if (bp.length==2) {\r
+                    se[sepos++] = Integer.parseInt(bp[0].getPos());\r
+                    se[sepos++] = Integer.parseInt(bp[1].getPos());\r
+                }\r
+            }\r
+            return se;\r
+        }\r
+        if (locationType!=null)\r
+        {\r
+          jalview.bin.Cache.log.error("EmbleFeatureLocations.getElementRanges cannot deal with locationType=='"+locationType+"'");\r
+        }\r
         return null;\r
     }\r
 }
\ No newline at end of file