+ 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