SequenceI seq = running.getSeqNames()
.get(ala.sequenceRef.getName());
aseq = seq;
+ // This part doesn't do anything. I suppose bad merge.
while (seq.getDatasetSequence() != null)
{
seq = seq.getDatasetSequence();
}
}
+ /* Prepare an array for annotations and copy returned annotations to it.
+ * Similar process happens in develop:JabawsCalcWorker#constructAnnotationFromScore.
+ * However, JabawsCalcWorker fills the array form the beginning, not
+ * the start position (start - column of the submitted region).
+ * Also, JabawsCalcWorker adds those annotations to an AlignmentAnnotation
+ * retrieved from the current alignment. */
Annotation[] resAnnot = ala.annotations,
gappedAnnot = new Annotation[Math.max(
alignViewport.getAlignment().getWidth(),
gappedAnnot[ap] = resAnnot[p++];
}
}
+ /* Annotations are set in-place on the AlignmentAnnotation object returned by the service.
+ * First, if #updateResultAnnotation is called again the output will be mangled
+ * Second, the mapping of positions to annotations held internally by
+ * the `ala` object is now incorrect. */
ala.sequenceRef = aseq;
ala.annotations = gappedAnnot;
AlignmentAnnotation newAnnot = getAlignViewport().getAlignment()
{
aseq.addAlignmentAnnotation(newAnnot);
+ /* adjustForAlignment is meant to move annotations to their columns
+ * according to the sequenceMapping.
+ * Since the mapping is carried from the alignment returned by the
+ * service it simply maps annotations to consecutive positions 1, 2, 3...
+ * Resulting in the annotation row being always aligned to the beginning
+ * of the alignment. */
newAnnot.adjustForAlignment();
AlignmentAnnotationUtils.replaceAnnotationOnAlignmentWith(