X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignmentUtils.java;h=42c4b76b0058084ba1e8492a09a83d309fc4c0e8;hb=892e857760e779796e156b4fa36d97d8d31e73e1;hp=a1a7fefc70565e4ad216f15ef84b5b7fb5482635;hpb=c91960b43b7acd33dc76b9789bb61bafa05d3d09;p=jalview.git diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index a1a7fef..42c4b76 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -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 *