From: Jim Procter Date: Wed, 15 Oct 2014 09:12:10 +0000 (+0100) Subject: JAL-674 support preservation of any annotation created by the MCView PDB parser by... X-Git-Tag: Jalview_2_9~169^2~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=68f76868b2bf0c59f4c185368cb00ab2bec3b5d5;p=jalview.git JAL-674 support preservation of any annotation created by the MCView PDB parser by application of liftOver method --- diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index bb01faf..086c4d9 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -364,17 +364,24 @@ public class PDBfile extends jalview.io.AlignFile 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 {