+ /**
+ * Get a list of any annotations on the dataset sequences in the current
+ * selection group that are not also on the alignment.
+ * <p/>
+ * The criteria for 'on the alignment' is finding an annotation that matches
+ * on sequenceRef.datasetSequence, calcId and label.
+ *
+ * @return
+ */
+ protected List<AlignmentAnnotation> getDatasequenceAnnotationsNotOnAlignment(
+ SequenceGroup sg)
+ {
+ List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
+
+ for (SequenceI seq : sg.getSequences())
+ {
+ SequenceI dataset = seq.getDatasetSequence();
+ AlignmentAnnotation[] datasetAnnotations = dataset.getAnnotation();
+ if (datasetAnnotations != null)
+ {
+ for (AlignmentAnnotation dsann : datasetAnnotations)
+ {
+ /*
+ * If the alignment has no annotation that matches this one...
+ */
+ if (!ap.getAlignment()
+ .findAnnotation(dataset, dsann.getCalcId(), dsann.label)
+ .iterator().hasNext())
+ {
+ /*
+ * ...then add it to the result list
+ */
+ result.add(dsann);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Add any annotations on the sequence dataset to the alignment (that are not
+ * already copied to it).
+ */
+ protected void addReferenceAnnotations_actionPerformed(
+ List<AlignmentAnnotation> anns)
+ {
+ for (AlignmentAnnotation ann : anns)
+ {
+ // todo: copy, add, adjust...
+ }
+ }
+