JAL-629 implementation of --tempfac options
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index a1a7fef..42c4b76 100644 (file)
@@ -184,10 +184,10 @@ public class AlignmentUtils
       // TODO use Character.toLowerCase to avoid creating String objects?
       char[] upstream = new String(ds
               .getSequence(s.getStart() - 1 - ustream_ds, s.getStart() - 1))
-                      .toLowerCase(Locale.ROOT).toCharArray();
+              .toLowerCase(Locale.ROOT).toCharArray();
       char[] downstream = new String(
               ds.getSequence(s_end - 1, s_end + dstream_ds))
-                      .toLowerCase(Locale.ROOT).toCharArray();
+              .toLowerCase(Locale.ROOT).toCharArray();
       char[] coreseq = s.getSequence();
       char[] nseq = new char[offset + upstream.length + downstream.length
               + coreseq.length];
@@ -1581,6 +1581,21 @@ public class AlignmentUtils
     }
   }
 
+  public static AlignmentAnnotation getFirstSequenceAnnotationOfType(
+          AlignmentI al, int graphType)
+  {
+    AlignmentAnnotation[] anns = al.getAlignmentAnnotation();
+    if (anns != null)
+    {
+      for (AlignmentAnnotation aa : anns)
+      {
+        if (aa.sequenceRef != null && aa.graph == graphType)
+          return aa;
+      }
+    }
+    return null;
+  }
+
   /**
    * Returns true if either sequence has a cross-reference to the other
    *