createMapping alreadyMapped
authoramwaterhouse <Andrew Waterhouse>
Tue, 29 Aug 2006 15:24:22 +0000 (15:24 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 29 Aug 2006 15:24:22 +0000 (15:24 +0000)
src/jalview/gui/Jalview2XML.java
src/jalview/io/AnnotationFile.java
src/jalview/io/JnetAnnotationMaker.java

index 8cf676d..e65f37d 100755 (executable)
@@ -1089,7 +1089,7 @@ public class Jalview2XML
                 if(an[i].getSequenceRef()!=null)
                 {
                   jaa.createSequenceMapping(
-                      al.findName(an[i].getSequenceRef()), 1
+                      al.findName(an[i].getSequenceRef()), 1, true
                       );
                   al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa);
                 }
index d004c1a..08b5862 100755 (executable)
@@ -287,7 +287,7 @@ public class AnnotationFile
 \r
        if(refSeq!=null)\r
        {\r
-         annotation.createSequenceMapping(refSeq, refSeqIndex);\r
+         annotation.createSequenceMapping(refSeq, refSeqIndex, false);\r
          refSeq.addAlignmentAnnotation(annotation);\r
        }\r
 \r
index 862b578..60fb601 100755 (executable)
 */package jalview.io;\r
 \r
 import jalview.datamodel.*;\r
-import java.net.URL;\r
-import java.io.BufferedReader;\r
-import java.io.InputStreamReader;\r
-import java.io.FileReader;\r
-\r
 \r
 public class JnetAnnotationMaker\r
 {\r
@@ -57,6 +52,11 @@ public class JnetAnnotationMaker
     AlignmentAnnotation annot;\r
     Annotation[] annotations = null;\r
 \r
+    int existingAnnotations = 0;\r
+    if(al.getAlignmentAnnotation()!=null)\r
+       existingAnnotations = al.getAlignmentAnnotation().length;\r
+\r
+\r
     while (i < preds.length)\r
     {\r
       String id = preds[i].getName().toUpperCase();\r
@@ -111,11 +111,14 @@ public class JnetAnnotationMaker
 \r
         if (seqRef != null)\r
         {\r
-          annot.createSequenceMapping(seqRef, 0);\r
+          annot.createSequenceMapping(seqRef, 1, false);\r
           seqRef.addAlignmentAnnotation(annot);\r
         }\r
 \r
         al.addAnnotation(annot);\r
+        al.setAnnotationIndex(annot,\r
+                              al.getAlignmentAnnotation().\r
+                              length - existingAnnotations - 1);\r
 \r
         if (noMsa)\r
         {\r