+ // transfer to dataset
+ for (AlignmentAnnotation alant : al.getAlignmentAnnotation())
+ {
+ if (alant.sequenceRef != null)
+ {
+ replaceAnnotationOnAlignmentWith(alant, alant.label,
+ "jalview.jws1.Jpred" + (this.msa == null ? "" : "MSA"),
+ alant.sequenceRef);
+ }
+ }
+ return new Object[] { al, alhidden }; // , FirstSeq, noMsa};
+ }
+
+ /**
+ * copied from JabawsCalcWorker
+ *
+ * @param newAnnot
+ * @param typeName
+ * @param calcId
+ * @param aSeq
+ */
+ protected void replaceAnnotationOnAlignmentWith(
+ AlignmentAnnotation newAnnot, String typeName, String calcId,
+ SequenceI aSeq)
+ {
+ SequenceI dsseq = aSeq.getDatasetSequence();
+ while (dsseq.getDatasetSequence() != null)
+ {
+ dsseq = dsseq.getDatasetSequence();
+ }
+ // look for same annotation on dataset and lift this one over
+ List<AlignmentAnnotation> dsan = dsseq.getAlignmentAnnotations(calcId,
+ typeName);
+ if (dsan != null && dsan.size() > 0)
+ {
+ for (AlignmentAnnotation dssan : dsan)
+ {
+ dsseq.removeAlignmentAnnotation(dssan);
+ }
+ }
+ AlignmentAnnotation dssan = new AlignmentAnnotation(newAnnot);
+ dsseq.addAlignmentAnnotation(dssan);
+ dssan.adjustForAlignment();