From 68f76868b2bf0c59f4c185368cb00ab2bec3b5d5 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 Oct 2014 10:12:10 +0100 Subject: [PATCH] JAL-674 support preservation of any annotation created by the MCView PDB parser by application of liftOver method --- src/MCview/PDBfile.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 { -- 1.7.10.2