{
ala.graphGroup += graphGroup;
}
- SequenceI aseq = null;
-
- /**
+ SequenceI aseq = (ala.sequenceRef == null) ? null
+ : running.getSeqNames().get(ala.sequenceRef.getName());
+ /*
* transfer sequence refs and adjust gapmap
+ * Prepare an array for annotations and copy returned annotations to it
+ * according to gapMap if present.
*/
- if (ala.sequenceRef != null)
- {
- SequenceI seq = running.getSeqNames()
- .get(ala.sequenceRef.getName());
- aseq = seq;
- while (seq.getDatasetSequence() != null)
- {
- seq = seq.getDatasetSequence();
- }
- }
Annotation[] resAnnot = ala.annotations,
gappedAnnot = new Annotation[Math.max(
alignViewport.getAlignment().getWidth(),
gapMap.length)];
- for (int p = 0, ap = start; ap < gappedAnnot.length; ap++)
+ for (int p = 0, ap = 0; ap < gappedAnnot.length; ap++)
{
if (gapMap != null && gapMap.length > ap && !gapMap[ap])
{
}
}
ala.sequenceRef = aseq;
- ala.annotations = gappedAnnot;
AlignmentAnnotation newAnnot = getAlignViewport().getAlignment()
.updateFromOrCopyAnnotation(ala);
+ newAnnot.annotations = gappedAnnot;
if (aseq != null)
{
-
+ newAnnot.createSequenceMapping(aseq, aseq.findPosition(start), false);
aseq.addAlignmentAnnotation(newAnnot);
newAnnot.adjustForAlignment();