List<AlignmentAnnotation> annotations = new ArrayList<>();
for (AlignmentAnnotation ala : returnedAnnot)
{
- SequenceI seq = job.seqNames.get(ala.sequenceRef.getName());
- SequenceI aseq = seq.getRootDatasetSequence();
- Annotation[] gappedAnnots = createGappedAnnotations(ala.annotations, job.start, job.gapMap);
+ SequenceI aseq = null;
+ if (ala.sequenceRef != null) {
+ SequenceI seq = job.seqNames.get(ala.sequenceRef.getName());
+ aseq = seq.getRootDatasetSequence();
+ }
ala.sequenceRef = aseq;
+ Annotation[] gappedAnnots = createGappedAnnotations(ala.annotations, job.start, job.gapMap);
ala.annotations = gappedAnnots;
AlignmentAnnotation newAnnot = viewport.getAlignment()
.updateFromOrCopyAnnotation(ala);
- if (aseq != null) // I suspect it's always true
+ if (aseq != null)
{
aseq.addAlignmentAnnotation(newAnnot);
newAnnot.adjustForAlignment();