JAL-674 JAL-1569 mark RNA helix number in the value field
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 20 Nov 2014 14:52:22 +0000 (14:52 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 20 Nov 2014 14:52:51 +0000 (14:52 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index 0731991..0207575 100755 (executable)
@@ -110,10 +110,41 @@ public class AlignmentAnnotation
       isrna = true;
       showAllColLabels = true;
       scaleColLabel = true;
+      _markRnaHelices();
     }
     // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+
   }
 
+  private void _markRnaHelices()
+  {
+    // Figure out number of helices
+    // Length of rnasecstr is the number of pairs of positions that base pair
+    // with each other in the secondary structure
+    for (int x = 0; x < _rnasecstr.length; x++)
+    {
+
+      /*
+       * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+       * this.annotation._rnasecstr[x].getBegin());
+       */
+      // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+      int val = 0;
+      try
+      {
+        val = Integer.valueOf(_rnasecstr[x].getFeatureGroup());
+      } catch (NumberFormatException q)
+      {
+      }
+      ;
+
+      annotations[_rnasecstr[x].getBegin()].value = val;
+      annotations[_rnasecstr[x].getEnd()].value = val;
+
+      annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val;
+      annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val;
+    }
+  }
   /**
    * map of positions in the associated annotation
    */