*/
Iterable<AlignmentAnnotation> findAnnotation(String calcId);
+ /**
+ * Returns an iterable collection of any annotations that match on given
+ * sequence ref, calcId and label (ignoring null values).
+ *
+ * @param seq
+ * null or reference sequence to select annotation for
+ * @param calcId
+ * null or the calcId to select annotation for
+ * @param label
+ * null or the label to select annotation for
+ */
Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
String calcId, String label);
* alignment, parent group).
*/
AnnotatedCollectionI getContext();
+
+ /**
+ * Returns the number of the highest annotation graph group attached to this
+ * alignment.
+ */
+ default int getLastGraphGroup()
+ {
+ var annots = getAlignmentAnnotation();
+ if (annots == null)
+ return 1;
+ int graphGroup = 1;
+ for (AlignmentAnnotation ala : annots)
+ {
+ graphGroup = Math.max(graphGroup, ala.graphGroup);
+ }
+ return graphGroup;
+ }
+
}