annotations = temp;\r
}\r
\r
+\r
+ public void addAnnotation(AlignmentAnnotation aa, SequenceI seqRef, int index)\r
+ {\r
+ aa.refSequence = seqRef;\r
+ if(seqRef!=null && index!=0)\r
+ {\r
+ int aSize = aa.annotations.length;\r
+ int newIndex;\r
+ Annotation [] temp = new Annotation[seqRef.getLength()];\r
+ for(int a=0; a<aSize; a++)\r
+ {\r
+ newIndex = seqRef.findIndex(a + index)-1;\r
+ temp[newIndex] = aa.annotations[a];\r
+ }\r
+\r
+ aa.annotations = temp;\r
+ }\r
+\r
+ addAnnotation(aa);\r
+ }\r
+\r
/**\r
* DOCUMENT ME!\r
*\r
\r
\r
AlignmentAnnotation[] temp = new AlignmentAnnotation[aSize];\r
- int i = 0;\r
+\r
+ temp[0] = aa;\r
+\r
+ int i = 1;\r
\r
if (aSize > 1)\r
{\r
- for (i = 0; i < (aSize - 1); i++)\r
+ for (i = 1; i < (aSize); i++)\r
{\r
- temp[i] = annotations[i];\r
+ temp[i] = annotations[i-1];\r
}\r
}\r
\r
- temp[i] = aa;\r
-\r
annotations = temp;\r
}\r
\r