X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=7990a5cfb6afb30796bdb60f1e1ca6945d1f0611;hb=7b286499500acfd548f601f1aa92f3f9019caac1;hp=b00f27ddcff599b5339baf0248ec895020b3e64d;hpb=5935396709349dbe2926fa1ad0dd24995712b77b;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index b00f27d..7990a5c 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -245,6 +245,7 @@ public class AlignmentAnnotation * * @see java.lang.Object#finalize() */ + @Override protected void finalize() throws Throwable { sequenceRef = null; @@ -957,6 +958,12 @@ public class AlignmentAnnotation } + /** + * When positional annotation and a sequence reference is present, clears and + * resizes the annotations array to the current alignment width, and adds + * annotation according to aligned positions of the sequenceRef given by + * sequenceMapping. + */ public void adjustForAlignment() { if (sequenceRef == null) @@ -1030,11 +1037,11 @@ public class AlignmentAnnotation } /** - * Associate this annotion with the aligned residues of a particular sequence. - * sequenceMapping will be updated in the following way: null sequenceI - - * existing mapping will be discarded but annotations left in mapped - * positions. valid sequenceI not equal to current sequenceRef: mapping is - * discarded and rebuilt assuming 1:1 correspondence TODO: overload with + * Associate this annotation with the aligned residues of a particular + * sequence. sequenceMapping will be updated in the following way: null + * sequenceI - existing mapping will be discarded but annotations left in + * mapped positions. valid sequenceI not equal to current sequenceRef: mapping + * is discarded and rebuilt assuming 1:1 correspondence TODO: overload with * parameter to specify correspondence between current and new sequenceRef * * @param sequenceI @@ -1298,7 +1305,8 @@ public class AlignmentAnnotation * @note caller should add the remapped annotation to newref if they have not * already */ - public void remap(SequenceI newref, int[][] mapping, int from, int to, + public void remap(SequenceI newref, HashMap mapping, + int from, int to, int idxoffset) { if (mapping != null) @@ -1306,7 +1314,7 @@ public class AlignmentAnnotation Map old = sequenceMapping; Map remap = new HashMap(); int index = -1; - for (int mp[] : mapping) + for (int mp[] : mapping.values()) { if (index++ < 0) {