seqs.set(p, sq = matches.get(q));
sq.setName(sp.getName());
sq.setDescription(sp.getDescription());
- sq.transferAnnotation(sp, aligns.get(q).getMappingFromS1(false));
+ Mapping sp2sq;
+ sq.transferAnnotation(sp, sp2sq = aligns.get(q).getMappingFromS1(false));
int inspos = -1;
for (int ap = 0; ap < annotations.size();)
{
- if (((AlignmentAnnotation) annotations.get(ap)).sequenceRef == sp)
+ if (annotations.get(ap).sequenceRef == sp)
{
if (inspos == -1)
{
inspos = ap;
}
- annotations.remove(ap);
+ if (removeOldAnnots) {
+ annotations.remove(ap);
+ } else {
+ AlignmentAnnotation alan = annotations.get(ap);
+ alan.liftOver(sq, sp2sq);
+ alan.setSequenceRef(sq);
+ }
}
else
{