1 Clazz.declarePackage ("jalview.datamodel");
\r
2 Clazz.load (["java.util.HashMap"], "jalview.datamodel.AlignmentAnnotation", ["jalview.analysis.Rna", "jalview.datamodel.Annotation", "$.GraphLine", "jalview.schemes.ResidueProperties", "java.lang.Double", "$.Error", "$.Long", "$.StringBuffer", "$.StringBuilder", "java.util.Collections"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.autoCalculated = false;
\r
5 this.annotationId = null;
\r
6 this.sequenceRef = null;
\r
8 this.description = null;
\r
9 this.annotations = null;
\r
11 this._rnasecstr = null;
\r
12 this.invalidrnastruc = -2;
\r
13 this.sequenceMapping = null;
\r
17 this.$hasScore = false;
\r
18 this.threshold = null;
\r
19 this.editable = false;
\r
20 this.hasIcons = false;
\r
21 this.hasText = false;
\r
22 this.visible = true;
\r
23 this.graphGroup = -1;
\r
26 this.graphHeight = 40;
\r
27 this.padGaps = false;
\r
28 this.belowAlignment = true;
\r
29 this.groupRef = null;
\r
30 this.showAllColLabels = false;
\r
31 this.scaleColLabel = false;
\r
32 this.centreColLabels = false;
\r
34 if (!Clazz.isClassDefined ("jalview.datamodel.AlignmentAnnotation.AnnotCharSequence")) {
\r
35 jalview.datamodel.AlignmentAnnotation.$AlignmentAnnotation$AnnotCharSequence$ ();
\r
37 this._lastrnaannot = -1;
\r
39 this.properties = null;
\r
40 this._linecolour = null;
\r
41 Clazz.instantialize (this, arguments);
\r
42 }, jalview.datamodel, "AlignmentAnnotation");
\r
43 Clazz.prepareFields (c$, function () {
\r
44 this.properties = new java.util.HashMap ();
\r
46 Clazz.defineMethod (c$, "_updateRnaSecStr",
\r
47 ($fz = function (RNAannot) {
\r
49 this._rnasecstr = jalview.analysis.Rna.GetBasePairs (RNAannot);
\r
50 this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
\r
51 this.invalidrnastruc = -1;
\r
53 if (Clazz.exceptionOf (px, jalview.analysis.WUSSParseException)) {
\r
54 this.invalidrnastruc = px.getProblemPos ();
\r
59 if (this.invalidrnastruc > -1) {
\r
61 }jalview.analysis.Rna.HelixMap (this._rnasecstr);
\r
62 if (this._rnasecstr != null && this._rnasecstr.length > 0) {
\r
64 this.showAllColLabels = true;
\r
65 this.scaleColLabel = true;
\r
66 this._markRnaHelices ();
\r
67 }}, $fz.isPrivate = true, $fz), "CharSequence");
\r
68 Clazz.defineMethod (c$, "_markRnaHelices",
\r
69 ($fz = function () {
\r
71 for (var x = 0; x < this._rnasecstr.length; x++) {
\r
74 val = (Integer.$valueOf (this._rnasecstr[x].getFeatureGroup ())).intValue ();
\r
78 if (Clazz.exceptionOf (q, NumberFormatException)) {
\r
83 ;this.annotations[this._rnasecstr[x].getBegin ()].value = val;
\r
84 this.annotations[this._rnasecstr[x].getEnd ()].value = val;
\r
86 this.setScore (mxval);
\r
87 }, $fz.isPrivate = true, $fz));
\r
88 Clazz.defineMethod (c$, "finalize",
\r
90 this.sequenceRef = null;
\r
91 this.groupRef = null;
\r
92 Clazz.superCall (this, jalview.datamodel.AlignmentAnnotation, "finalize", []);
\r
94 c$.getGraphValueFromString = Clazz.defineMethod (c$, "getGraphValueFromString",
\r
96 if (string.equalsIgnoreCase ("BAR_GRAPH")) {
\r
98 } else if (string.equalsIgnoreCase ("LINE_GRAPH")) {
\r
103 Clazz.defineMethod (c$, "ConcenStru",
\r
104 function (RNAannot) {
\r
105 this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
\r
106 }, "CharSequence");
\r
107 Clazz.makeConstructor (c$,
\r
108 function (label, description, annotations) {
\r
109 this.setAnnotationId ();
\r
110 this.editable = true;
\r
111 this.label = label;
\r
112 this.description = description;
\r
113 this.annotations = annotations;
\r
114 this.validateRangeAndDisplay ();
\r
116 Clazz.defineMethod (c$, "areLabelsSecondaryStructure",
\r
118 var nonSSLabel = false;
\r
119 this.isrna = false;
\r
120 var rnastring = new StringBuffer ();
\r
121 var firstChar = String.fromCharCode (0);
\r
122 for (var i = 0; i < this.annotations.length; i++) {
\r
123 if (this.annotations[i] == null) {
\r
125 }if (this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'E') {
\r
126 this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
\r
128 if (this.annotations[i].secondaryStructure == '(' || this.annotations[i].secondaryStructure == '[' || this.annotations[i].secondaryStructure == '<' || this.annotations[i].secondaryStructure == '{' || this.annotations[i].secondaryStructure == 'A' || this.annotations[i].secondaryStructure == 'B' || this.annotations[i].secondaryStructure == 'C' || this.annotations[i].secondaryStructure == 'D' || this.annotations[i].secondaryStructure == 'E' || this.annotations[i].secondaryStructure == 'F' || this.annotations[i].secondaryStructure == 'G' || this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'I' || this.annotations[i].secondaryStructure == 'J' || this.annotations[i].secondaryStructure == 'K' || this.annotations[i].secondaryStructure == 'L' || this.annotations[i].secondaryStructure == 'M' || this.annotations[i].secondaryStructure == 'N' || this.annotations[i].secondaryStructure == 'O' || this.annotations[i].secondaryStructure == 'P' || this.annotations[i].secondaryStructure == 'Q' || this.annotations[i].secondaryStructure == 'R' || this.annotations[i].secondaryStructure == 'S' || this.annotations[i].secondaryStructure == 'T' || this.annotations[i].secondaryStructure == 'U' || this.annotations[i].secondaryStructure == 'V' || this.annotations[i].secondaryStructure == 'W' || this.annotations[i].secondaryStructure == 'X' || this.annotations[i].secondaryStructure == 'Y' || this.annotations[i].secondaryStructure == 'Z') {
\r
129 this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
\r
130 this.isrna = new Boolean (this.isrna | true).valueOf ();
\r
131 }}if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.length == 0) {
\r
132 rnastring.append ('.');
\r
134 }if (this.annotations[i].displayCharacter.length == 1) {
\r
135 firstChar = this.annotations[i].displayCharacter.charAt (0);
\r
136 if (this.annotations[i].secondaryStructure != ' ' && !this.hasIcons && firstChar != ' ' && firstChar != '$' && firstChar.charCodeAt (0) != 0xCE && firstChar != '(' && firstChar != '[' && firstChar != '>' && firstChar != '{' && firstChar != 'A' && firstChar != 'B' && firstChar != 'C' && firstChar != 'D' && firstChar != 'E' && firstChar != 'F' && firstChar != 'G' && firstChar != 'H' && firstChar != 'I' && firstChar != 'J' && firstChar != 'K' && firstChar != 'L' && firstChar != 'M' && firstChar != 'N' && firstChar != 'O' && firstChar != 'P' && firstChar != 'Q' && firstChar != 'R' && firstChar != 'S' && firstChar != 'T' && firstChar != 'U' && firstChar != 'V' && firstChar != 'W' && firstChar != 'X' && firstChar != 'Y' && firstChar != 'Z' && firstChar != '-' && firstChar.charCodeAt (0) < jalview.schemes.ResidueProperties.aaIndex.length) {
\r
137 if (jalview.schemes.ResidueProperties.aaIndex[firstChar.charCodeAt (0)] < 23) {
\r
140 rnastring.append (this.annotations[i].displayCharacter.charAt (1));
\r
141 }if (this.annotations[i].displayCharacter.length > 0) {
\r
142 this.hasText = true;
\r
145 this.hasIcons = false;
\r
146 for (var j = 0; j < this.annotations.length; j++) {
\r
147 if (this.annotations[j] != null && this.annotations[j].secondaryStructure != ' ') {
\r
148 this.annotations[j].displayCharacter = String.valueOf (this.annotations[j].secondaryStructure);
\r
149 this.annotations[j].secondaryStructure = ' ';
\r
153 this._updateRnaSecStr (Clazz.innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null));
\r
155 Clazz.defineMethod (c$, "getRNAStruc",
\r
158 var rnastruc = Clazz.innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null).toString ();
\r
159 if (this._lastrnaannot != rnastruc.hashCode ()) {
\r
160 this._lastrnaannot = rnastruc.hashCode ();
\r
161 this._updateRnaSecStr (rnastruc);
\r
165 Clazz.makeConstructor (c$,
\r
166 function (label, description, annotations, min, max, graphType) {
\r
167 this.setAnnotationId ();
\r
168 this.editable = graphType == 0;
\r
169 this.label = label;
\r
170 this.description = description;
\r
171 this.annotations = annotations;
\r
172 this.graph = graphType;
\r
173 this.graphMin = min;
\r
174 this.graphMax = max;
\r
175 this.validateRangeAndDisplay ();
\r
176 }, "~S,~S,~A,~N,~N,~N");
\r
177 Clazz.defineMethod (c$, "validateRangeAndDisplay",
\r
179 if (this.annotations == null) {
\r
180 this.visible = false;
\r
182 }var graphType = this.graph;
\r
183 var min = this.graphMin;
\r
184 var max = this.graphMax;
\r
185 var drawValues = true;
\r
186 this._linecolour = null;
\r
189 for (var i = 0; i < this.annotations.length; i++) {
\r
190 if (this.annotations[i] == null) {
\r
192 }if (drawValues && this.annotations[i].displayCharacter != null && this.annotations[i].displayCharacter.length > 1) {
\r
193 drawValues = false;
\r
194 }if (this.annotations[i].value > max) {
\r
195 max = this.annotations[i].value;
\r
196 }if (this.annotations[i].value < min) {
\r
197 min = this.annotations[i].value;
\r
198 }if (this._linecolour == null && this.annotations[i].colour != null) {
\r
199 this._linecolour = this.annotations[i].colour;
\r
206 }}}this.graphMin = min;
\r
207 this.graphMax = max;
\r
208 this.areLabelsSecondaryStructure ();
\r
209 if (!drawValues && graphType != 0) {
\r
210 for (var i = 0; i < this.annotations.length; i++) {
\r
211 if (this.annotations[i] != null) {
\r
212 this.annotations[i].displayCharacter = "";
\r
215 Clazz.makeConstructor (c$,
\r
216 function (annotation) {
\r
217 this.setAnnotationId ();
\r
218 this.label = String.instantialize (annotation.label);
\r
219 if (annotation.description != null) {
\r
220 this.description = String.instantialize (annotation.description);
\r
221 }this.graphMin = annotation.graphMin;
\r
222 this.graphMax = annotation.graphMax;
\r
223 this.graph = annotation.graph;
\r
224 this.graphHeight = annotation.graphHeight;
\r
225 this.graphGroup = annotation.graphGroup;
\r
226 this.groupRef = annotation.groupRef;
\r
227 this.editable = annotation.editable;
\r
228 this.autoCalculated = annotation.autoCalculated;
\r
229 this.hasIcons = annotation.hasIcons;
\r
230 this.hasText = annotation.hasText;
\r
231 this.height = annotation.height;
\r
232 this.label = annotation.label;
\r
233 this.padGaps = annotation.padGaps;
\r
234 this.visible = annotation.visible;
\r
235 this.centreColLabels = annotation.centreColLabels;
\r
236 this.scaleColLabel = annotation.scaleColLabel;
\r
237 this.showAllColLabels = annotation.showAllColLabels;
\r
238 this.calcId = annotation.calcId;
\r
239 if (annotation.properties != null) {
\r
240 this.properties = new java.util.HashMap ();
\r
241 for (var val, $val = annotation.properties.entrySet ().iterator (); $val.hasNext () && ((val = $val.next ()) || true);) {
\r
242 this.properties.put (val.getKey (), val.getValue ());
\r
244 }if (this.$hasScore = annotation.$hasScore) {
\r
245 this.score = annotation.score;
\r
246 }if (annotation.threshold != null) {
\r
247 this.threshold = new jalview.datamodel.GraphLine (annotation.threshold);
\r
248 }var ann = annotation.annotations;
\r
249 if (annotation.annotations != null) {
\r
250 this.annotations = new Array (ann.length);
\r
251 for (var i = 0; i < ann.length; i++) {
\r
252 if (ann[i] != null) {
\r
253 this.annotations[i] = new jalview.datamodel.Annotation (ann[i]);
\r
254 if (this._linecolour != null) {
\r
255 this._linecolour = this.annotations[i].colour;
\r
257 }if (annotation.sequenceRef != null) {
\r
258 this.sequenceRef = annotation.sequenceRef;
\r
259 if (annotation.sequenceMapping != null) {
\r
261 this.sequenceMapping = new java.util.HashMap ();
\r
262 var pos = annotation.sequenceMapping.keySet ().iterator ();
\r
263 while (pos.hasNext ()) {
\r
265 var a = annotation.sequenceMapping.get (p);
\r
268 }if (ann != null) {
\r
269 for (var i = 0; i < ann.length; i++) {
\r
270 if (ann[i] === a) {
\r
271 this.sequenceMapping.put (p, this.annotations[i]);
\r
275 this.sequenceMapping = null;
\r
277 }this.validateRangeAndDisplay ();
\r
278 }, "jalview.datamodel.AlignmentAnnotation");
\r
279 Clazz.defineMethod (c$, "restrict",
\r
280 function (startRes, endRes) {
\r
281 if (this.annotations == null) {
\r
283 }if (startRes < 0) {
\r
285 }if (startRes >= this.annotations.length) {
\r
286 startRes = this.annotations.length - 1;
\r
287 }if (endRes >= this.annotations.length) {
\r
288 endRes = this.annotations.length - 1;
\r
289 }if (this.annotations == null) {
\r
291 }var temp = new Array (endRes - startRes + 1);
\r
292 if (startRes < this.annotations.length) {
\r
293 System.arraycopy (this.annotations, startRes, temp, 0, endRes - startRes + 1);
\r
294 }if (this.sequenceRef != null) {
\r
295 var spos = this.sequenceRef.findPosition (startRes);
\r
296 var epos = this.sequenceRef.findPosition (endRes);
\r
297 if (this.sequenceMapping != null) {
\r
298 var newmapping = new java.util.HashMap ();
\r
299 var e = this.sequenceMapping.keySet ().iterator ();
\r
300 while (e.hasNext ()) {
\r
301 var pos = e.next ();
\r
302 if (pos.intValue () >= spos && pos.intValue () <= epos) {
\r
303 newmapping.put (pos, this.sequenceMapping.get (pos));
\r
305 this.sequenceMapping.clear ();
\r
306 this.sequenceMapping = newmapping;
\r
307 }}this.annotations = temp;
\r
309 Clazz.defineMethod (c$, "padAnnotation",
\r
310 function (length) {
\r
311 if (this.annotations == null) {
\r
313 }if (this.annotations.length < length) {
\r
314 var na = new Array (length);
\r
315 System.arraycopy (this.annotations, 0, na, 0, this.annotations.length);
\r
316 this.annotations = na;
\r
318 }return this.annotations.length > length;
\r
320 Clazz.overrideMethod (c$, "toString",
\r
322 var buffer = new StringBuilder (256);
\r
323 for (var i = 0; i < this.annotations.length; i++) {
\r
324 if (this.annotations[i] != null) {
\r
325 if (this.graph != 0) {
\r
326 buffer.append (this.annotations[i].value);
\r
327 } else if (this.hasIcons) {
\r
328 buffer.append (this.annotations[i].secondaryStructure);
\r
330 buffer.append (this.annotations[i].displayCharacter);
\r
331 }}buffer.append (", ");
\r
333 if (this.label.indexOf ("Consensus") == 0) {
\r
334 buffer.append ("\n");
\r
335 for (var i = 0; i < this.annotations.length; i++) {
\r
336 if (this.annotations[i] != null) {
\r
337 buffer.append (this.annotations[i].description);
\r
338 }buffer.append (", ");
\r
340 }return buffer.toString ();
\r
342 Clazz.defineMethod (c$, "setThreshold",
\r
344 this.threshold = line;
\r
345 }, "jalview.datamodel.GraphLine");
\r
346 Clazz.defineMethod (c$, "getThreshold",
\r
348 return this.threshold;
\r
350 Clazz.defineMethod (c$, "createSequenceMapping",
\r
351 function (seqRef, startRes, alreadyMapped) {
\r
352 if (seqRef == null) {
\r
354 }this.sequenceRef = seqRef;
\r
355 if (this.annotations == null) {
\r
357 }this.sequenceMapping = new java.util.HashMap ();
\r
359 for (var i = 0; i < this.annotations.length; i++) {
\r
360 if (this.annotations[i] != null) {
\r
361 if (alreadyMapped) {
\r
362 seqPos = seqRef.findPosition (i);
\r
364 seqPos = i + startRes;
\r
365 }this.sequenceMapping.put ( new Integer (seqPos), this.annotations[i]);
\r
367 }, "jalview.datamodel.SequenceI,~N,~B");
\r
368 Clazz.defineMethod (c$, "adjustForAlignment",
\r
370 if (this.sequenceRef == null) {
\r
372 }if (this.annotations == null) {
\r
375 var aSize = this.sequenceRef.getLength ();
\r
379 var temp = new Array (aSize);
\r
381 for (a = this.sequenceRef.getStart (); a <= this.sequenceRef.getEnd (); a++) {
\r
382 index = new Integer (a);
\r
383 if (this.sequenceMapping.containsKey (index)) {
\r
384 position = this.sequenceRef.findIndex (a) - 1;
\r
385 temp[position] = this.sequenceMapping.get (index);
\r
387 this.annotations = temp;
\r
389 Clazz.defineMethod (c$, "compactAnnotationArray",
\r
392 var iSize = this.annotations.length;
\r
393 while (i < iSize) {
\r
394 if (this.annotations[i] == null) {
\r
395 if (i + 1 < iSize) {
\r
396 System.arraycopy (this.annotations, i + 1, this.annotations, i, iSize - i - 1);
\r
401 var ann = this.annotations;
\r
402 this.annotations = new Array (i);
\r
403 System.arraycopy (ann, 0, this.annotations, 0, i);
\r
407 Clazz.defineMethod (c$, "setSequenceRef",
\r
408 function (sequenceI) {
\r
409 if (sequenceI != null) {
\r
410 if (this.sequenceRef != null) {
\r
411 var rIsDs = this.sequenceRef.getDatasetSequence () == null;
\r
412 var tIsDs = sequenceI.getDatasetSequence () == null;
\r
413 if (this.sequenceRef !== sequenceI && (rIsDs && !tIsDs && this.sequenceRef !== sequenceI.getDatasetSequence ()) && (!rIsDs && tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI) && (!rIsDs && !tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI.getDatasetSequence ()) && !this.sequenceRef.equals (sequenceI)) {
\r
414 this.sequenceRef = null;
\r
415 if (this.sequenceMapping != null) {
\r
416 this.sequenceMapping = null;
\r
417 }this.createSequenceMapping (sequenceI, 1, true);
\r
418 this.adjustForAlignment ();
\r
420 this.sequenceRef = sequenceI;
\r
422 this.createSequenceMapping (sequenceI, 1, true);
\r
423 this.adjustForAlignment ();
\r
425 this.sequenceMapping = null;
\r
426 this.sequenceRef = null;
\r
427 }}, "jalview.datamodel.SequenceI");
\r
428 Clazz.defineMethod (c$, "getScore",
\r
432 Clazz.defineMethod (c$, "setScore",
\r
434 this.$hasScore = true;
\r
435 this.score = score;
\r
437 Clazz.defineMethod (c$, "hasScore",
\r
439 return this.$hasScore || !Double.isNaN (this.score);
\r
441 Clazz.makeConstructor (c$,
\r
442 function (label, description, score) {
\r
443 this.construct (label, description, null);
\r
444 this.setScore (score);
\r
446 Clazz.makeConstructor (c$,
\r
447 function (alignmentAnnotation, colSel) {
\r
448 this.construct (alignmentAnnotation);
\r
449 if (this.annotations == null) {
\r
451 }colSel.makeVisibleAnnotation (this);
\r
452 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.ColumnSelection");
\r
453 Clazz.defineMethod (c$, "setPadGaps",
\r
454 function (padgaps, gapchar) {
\r
455 this.padGaps = padgaps;
\r
457 this.hasText = true;
\r
458 for (var i = 0; i < this.annotations.length; i++) {
\r
459 if (this.annotations[i] == null) {
\r
460 this.annotations[i] = new jalview.datamodel.Annotation (String.valueOf (gapchar), null, ' ', 0, null);
\r
461 } else if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.equals (" ")) {
\r
462 this.annotations[i].displayCharacter = String.valueOf (gapchar);
\r
465 Clazz.defineMethod (c$, "getDescription",
\r
466 function (seqname) {
\r
467 if (seqname && this.sequenceRef != null) {
\r
468 var i = this.description.toLowerCase ().indexOf ("<html>");
\r
470 return "<html>" + this.sequenceRef.getName () + " : " + this.description.substring (i + 6);
\r
471 }return this.sequenceRef.getName () + " : " + this.description;
\r
472 }return this.description;
\r
474 Clazz.defineMethod (c$, "isValidStruc",
\r
476 return this.invalidrnastruc == -1;
\r
478 Clazz.defineMethod (c$, "getInvalidStrucPos",
\r
480 return this.invalidrnastruc;
\r
482 Clazz.defineMethod (c$, "getCalcId",
\r
484 return this.calcId;
\r
486 Clazz.defineMethod (c$, "setCalcId",
\r
487 function (calcId) {
\r
488 this.calcId = calcId;
\r
490 Clazz.defineMethod (c$, "isRNA",
\r
494 Clazz.defineMethod (c$, "liftOver",
\r
495 function (sq, sp2sq) {
\r
496 if (sp2sq.getMappedWidth () != sp2sq.getWidth ()) {
\r
497 throw new Error ("liftOver currently not implemented for transfer of annotation between different types of seqeunce");
\r
498 }var mapIsTo = (sp2sq != null) ? (sp2sq.getTo () === sq || sp2sq.getTo () === sq.getDatasetSequence ()) : false;
\r
499 var mapForsq = new java.util.HashMap ();
\r
500 if (this.sequenceMapping != null) {
\r
501 if (sp2sq != null) {
\r
502 for (var ie, $ie = this.sequenceMapping.entrySet ().iterator (); $ie.hasNext () && ((ie = $ie.next ()) || true);) {
\r
503 var mpos = Integer.$valueOf (mapIsTo ? sp2sq.getMappedPosition ((ie.getKey ()).intValue ()) : sp2sq.getPosition ((ie.getKey ()).intValue ()));
\r
504 if ((mpos).intValue () >= sq.getStart () && (mpos).intValue () <= sq.getEnd ()) {
\r
505 mapForsq.put (mpos, ie.getValue ());
\r
507 this.sequenceMapping = mapForsq;
\r
508 this.sequenceRef = sq;
\r
509 this.adjustForAlignment ();
\r
511 }}}, "jalview.datamodel.SequenceI,jalview.datamodel.Mapping");
\r
512 Clazz.defineMethod (c$, "remap",
\r
513 function (newref, mapping, from, to, idxoffset) {
\r
514 if (mapping != null) {
\r
515 var old = this.sequenceMapping;
\r
516 var remap = new java.util.HashMap ();
\r
518 for (var mp, $mp = 0, $$mp = mapping; $mp < $$mp.length && ((mp = $$mp[$mp]) || true); $mp++) {
\r
523 ann = this.sequenceMapping.get (Integer.$valueOf (idxoffset + index));
\r
525 if (mp != null && mp.length > from) {
\r
526 ann = this.sequenceMapping.get (Integer.$valueOf (mp[from]));
\r
527 }}if (ann != null) {
\r
529 remap.put (Integer.$valueOf (idxoffset + index), ann);
\r
531 if (to > -1 && to < mp.length) {
\r
532 remap.put (Integer.$valueOf (mp[to]), ann);
\r
534 this.sequenceMapping = remap;
\r
536 if (newref != null) {
\r
537 this.sequenceRef = newref;
\r
538 }this.adjustForAlignment ();
\r
539 }}, "jalview.datamodel.SequenceI,~A,~N,~N,~N");
\r
540 Clazz.defineMethod (c$, "getProperty",
\r
541 function (property) {
\r
542 if (this.properties == null) {
\r
544 }return this.properties.get (property);
\r
546 Clazz.defineMethod (c$, "setProperty",
\r
547 function (property, value) {
\r
548 if (this.properties == null) {
\r
549 this.properties = new java.util.HashMap ();
\r
550 }this.properties.put (property, value);
\r
552 Clazz.defineMethod (c$, "hasProperties",
\r
554 return this.properties != null && this.properties.size () > 0;
\r
556 Clazz.defineMethod (c$, "getProperties",
\r
558 if (this.properties == null) {
\r
559 return java.util.Collections.emptyList ();
\r
560 }return this.properties.keySet ();
\r
562 Clazz.defineMethod (c$, "getAnnotationForPosition",
\r
563 function (position) {
\r
564 return this.sequenceMapping == null ? null : this.sequenceMapping.get (new Integer (position));
\r
566 Clazz.defineMethod (c$, "setAnnotationId",
\r
568 this.annotationId = "ann" + Long.toString (jalview.datamodel.AlignmentAnnotation.nextId ());
\r
570 c$.nextId = Clazz.defineMethod (c$, "nextId",
\r
572 return jalview.datamodel.AlignmentAnnotation.counter++;
\r
574 c$.$AlignmentAnnotation$AnnotCharSequence$ = function () {
\r
576 c$ = Clazz.decorateAsClass (function () {
\r
577 Clazz.prepareCallback (this, arguments);
\r
580 Clazz.instantialize (this, arguments);
\r
581 }, jalview.datamodel.AlignmentAnnotation, "AnnotCharSequence", null, CharSequence);
\r
582 Clazz.makeConstructor (c$,
\r
584 this.construct (0, this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length);
\r
586 Clazz.makeConstructor (c$,
\r
591 Clazz.overrideMethod (c$, "subSequence",
\r
593 return Clazz.innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null, this.offset + a, this.offset + b);
\r
595 Clazz.overrideMethod (c$, "length",
\r
597 return this.max - this.offset;
\r
599 Clazz.overrideMethod (c$, "charAt",
\r
601 return ((a + this.offset < 0) || (a + this.offset) >= this.max || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset] == null || (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure <= ' ') ? ' ' : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.charAt (0));
\r
603 Clazz.overrideMethod (c$, "toString",
\r
605 var a = Clazz.newCharArray (this.max - this.offset, '\0');
\r
606 var b = this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length;
\r
607 for (var c = this.offset; c < b; c++) {
\r
608 a[c] = (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c] == null || ((this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure).charCodeAt (0) <= 32)) ? ' ' : (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.charAt (0));
\r
610 return String.instantialize (a);
\r
614 Clazz.defineStatics (c$,
\r
615 "ANNOTATION_ID_PREFIX", "ann",
\r
616 "SEQUENCE_PROFILE", 0,
\r
617 "STRUCTURE_PROFILE", 1,
\r