addAnnotation with seqRef
authoramwaterhouse <Andrew Waterhouse>
Wed, 10 May 2006 12:56:02 +0000 (12:56 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 10 May 2006 12:56:02 +0000 (12:56 +0000)
src/jalview/datamodel/Alignment.java
src/jalview/datamodel/AlignmentI.java

index b0b04ca..c62d707 100755 (executable)
@@ -31,7 +31,6 @@ public class Alignment implements AlignmentI
     protected Alignment dataset;\r
     protected Vector sequences;\r
     protected Vector groups = new Vector();\r
-    protected Vector superGroup = new Vector();\r
     protected char gapCharacter = '-';\r
     protected int type = NUCLEOTIDE;\r
     public static final int PROTEIN = 0;\r
@@ -61,19 +60,7 @@ public class Alignment implements AlignmentI
         for (i = 0; i < seqs.length; i++)\r
         {\r
             sequences.addElement(seqs[i]);\r
-\r
-            if(seqs[i].getDatasetSequence()!=null\r
-            && seqs[i].getDatasetSequence().getAnnotation()!=null)\r
-            {\r
-\r
-              for(int a=0; a<seqs[i].getDatasetSequence().getAnnotation().length; a++)\r
-              {\r
-                       this.addAnnotation(seqs[i].getDatasetSequence().getAnnotation()[a], seqs[i]);\r
-              }\r
-            }\r
         }\r
-\r
-        getWidth();\r
     }\r
 \r
     /**\r
@@ -409,7 +396,6 @@ public class Alignment implements AlignmentI
     public void deleteAllGroups()\r
     {\r
         groups.removeAllElements();\r
-        superGroup.removeAllElements();\r
 \r
         int i = 0;\r
 \r
@@ -614,70 +600,6 @@ public class Alignment implements AlignmentI
         annotations = temp;\r
     }\r
 \r
-    /**\r
-     *\r
-     * @param aa AlignmentAnnotation\r
-     * @param seqRef The sequence to associate this annotation with\r
-     * @return The adjusted AlignmentAnnotation, with dataset sequence and annotation added\r
-     */\r
-    public AlignmentAnnotation addAnnotation(AlignmentAnnotation aa, SequenceI seqRef)\r
-    {\r
-      if(seqRef!=null)\r
-      {\r
-          //We can only add Annotations to the dataset sequences\r
-           if(seqRef.getDatasetSequence()==null)\r
-           {\r
-                  setDataset(null);\r
-            }\r
-\r
-        AlignmentAnnotation []  old = seqRef.getDatasetSequence().getAnnotation();\r
-\r
-        //First check if this is a new annotation or not. If it is new,\r
-        //we must add the annotation to the dataset\r
-        boolean newAnnotation = true;\r
-        if(seqRef.getDatasetSequence().getAnnotation()!=null)\r
-        {\r
-          for(int a=0; a<old.length; a++)\r
-          {\r
-            if(old[a] == aa)\r
-            {\r
-\r
-              newAnnotation = false;\r
-              break;\r
-            }\r
-          }\r
-        }\r
-\r
-        if(newAnnotation)\r
-         {\r
-           seqRef.getDatasetSequence().addAlignmentAnnotation(aa);\r
-         }\r
-\r
-          AlignmentAnnotation copy = null;\r
-          if (aa.graph > 0)\r
-            copy = new AlignmentAnnotation(\r
-                aa.label, aa.description, aa.annotations, aa.graphMin,\r
-                aa.graphMax, aa.graph\r
-                );\r
-          else\r
-            copy = new AlignmentAnnotation(\r
-                aa.label, aa.description, aa.annotations\r
-                );\r
-\r
-         copy.datasetAnnotation = aa;\r
-\r
-         addAnnotation(copy);\r
-\r
-         copy.sequenceRef = seqRef;\r
-\r
-         return copy;\r
-      }\r
-      else\r
-      {\r
-        addAnnotation(aa);\r
-        return aa;\r
-      }\r
-    }\r
 \r
     public void adjustSequenceAnnotations()\r
     {\r
index 7fe4627..ebfb0ce 100755 (executable)
@@ -225,11 +225,6 @@ public interface AlignmentI
      */\r
     public void addAnnotation(AlignmentAnnotation aa);\r
 \r
-    /**\r
-     * Adds a new AlignmentAnnotation to this alignment,\r
-     *  associated to Sequence starting at sequence index\r
-     */\r
-    public AlignmentAnnotation addAnnotation(AlignmentAnnotation aa, SequenceI seqRef);\r
 \r
     public void setAnnotationIndex(AlignmentAnnotation aa, int index);\r
 \r