JAL-1264 JAL-674 method to copy annotation on structure positions to associated seque...
[jalview.git] / src / jalview / structure / StructureMapping.java
index d2dcb34..9236331 100644 (file)
@@ -20,7 +20,8 @@
  */
 package jalview.structure;
 
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.SequenceI;
 
 public class StructureMapping
 {
@@ -98,4 +99,18 @@ public class StructureMapping
     }
     return -1;
   }
+
+  /**
+   * transfer a copy of an alignment annotation row in the PDB chain coordinate
+   * system onto the mapped sequence
+   * 
+   * @param ana
+   * @return the copy that was remapped to the mapped sequence
+   */
+  public AlignmentAnnotation transfer(AlignmentAnnotation ana)
+  {
+    AlignmentAnnotation ala_copy = new AlignmentAnnotation(ana);
+    ala_copy.remap(sequence, mapping, 0, -1, 1);
+    return ala_copy;
+  }
 }