JAL-653 convenience method to resolve strand attribute for feature
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 19 Feb 2015 15:01:35 +0000 (15:01 +0000)
committerJames Procter <jprocter@ls30857.local>
Fri, 5 Jun 2015 11:56:46 +0000 (12:56 +0100)
src/jalview/datamodel/SequenceFeature.java

index 28ab82c..1b6498f 100755 (executable)
@@ -302,4 +302,23 @@ public class SequenceFeature
     return begin;
   }
 
+  public int getStrand()
+  {
+    String str;
+    if (otherDetails == null
+            || (str = otherDetails.get("STRAND").toString()) == null)
+    {
+      return 0;
+    }
+    if (str.equals("-"))
+    {
+      return -1;
+    }
+    if (str.equals("+"))
+    {
+      return 1;
+    }
+    return 0;
+  }
+
 }