- AlignmentAnnotation newAnnot =
- new AlignmentAnnotation(
- sequences[i].getAnnotation()[a].label,
- sequences[i].getAnnotation()[a].description,
- sequences[i].getAnnotation()[a].annotations,
- sequences[i].getAnnotation()[a].graphMin,
- sequences[i].getAnnotation()[a].graphMax,
- sequences[i].getAnnotation()[a].graph);
-
- sequences[i].getAnnotation()[a] = newAnnot;
- newAnnot.sequenceMapping = sequences[i].getAnnotation()[a].
- sequenceMapping;
- newAnnot.sequenceRef = sequences[i];
- newAnnot.adjustForAlignment();
- alignment.addAnnotation(newAnnot);
- alignment.setAnnotationIndex(newAnnot, a);
+ annotationAdded=true;
+ sequences[i].getAnnotation()[a].adjustForAlignment();
+ alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation was duplicated earlier
+ alignment.setAnnotationIndex(sequences[i].getAnnotation()[a], a);