Index: etc/mast-to-html.xsl =================================================================== --- etc/mast-to-html.xsl (revision 4530) +++ etc/mast-to-html.xsl (working copy) @@ -395,6 +395,12 @@ seqDispSeq.style.height = "1.5em"; return seqDispSeq; } + function annobox_boundary() { + var seqDispSeq = document.createElement('div'); + seqDispSeq.className = "sequence"; + seqDispSeq.style.height = "1.5em"; + return seqDispSeq; + } function create_seq_handle(container, seqid, isleft, pos, max) { var vbar = document.createElement('div'); @@ -557,7 +563,7 @@ function set_data(start, width, show_rc_only, data, annobox) { var child = annobox.firstChild; var line_width = Math.min(wrap, width); - var num_per_wrap = 54; + var num_per_wrap = 65; var end = start + width; for (var i = start; i < end; i += line_width, line_width = Math.min(wrap, end - i)) { for (var j = 0; j < num_per_wrap; ++j) { @@ -575,13 +581,23 @@ child = annobox_matches(); break; case 3: - + + child = annobox_translations(); break; case 4: - child = annobox_sequence(); break; + case 5: + + + child = annobox_sequence(); + break; + case 4: + + + child = annobox_boundary(); + break; } annobox.appendChild(child); } @@ -596,13 +612,23 @@ data.append_matches(child, i, line_width, show_rc_only); break; case 3: - + + data.append_translation(child, i, line_width, show_rc_only); break; case 4: - data.append_seq(child, i, line_width, show_rc_only); break; + case 5: + + + data.append_seq(child, i, line_width, show_rc_only); + break; + case 4: + + + data.append_boundary(child, i, line_width, show_rc_only); + break; } child = child.nextSibling; } @@ -870,6 +896,7 @@ this.append_hits = Sequence_append_hits; this.append_matches = Sequence_append_matches; this.append_labels = Sequence_append_labels; + this.append_boundary = Sequence_append_boundary; //init var mysegs = document.getElementById(seqid + "_segs"); var lines = mysegs.value.split(/\n/); @@ -1176,6 +1203,47 @@ container.appendChild(oTable); } + + function Sequence_append_boundary(container, start, width, is_rc) { + if (start > this.length) { + alert("start: " + start + " length: " + this.length); + throw "INDEX_OUT_OF_BOUNDS"; + } + if ((start + width - 1) > this.length) { + alert("start: " + start + " width: " + width + " length: " + this.length); + throw "RANGE_OUT_OF_BOUNDS"; + } + //make a sub container to put the sequence in + var mycontainer = document.createElement('span'); + var pos = start; + var text = ""; + var iter = this.get_overlapping_hits(start, width, is_rc); + while (iter.has_next()) { + var o = iter.next(); + var end; + while (o.start > pos) { + text += " "; + ++pos; + } + if (o.start == o.hit.pos) { + text += "\\"; + ++pos; + } + end = o.start + o.length - 1; + while (end > pos) { + text += "_"; + ++pos; + } + if (end == (o.hit.pos + o.hit.width -1)) { + text += "/" + } else { + text += "_" + } + ++pos; + } + mycontainer.appendChild(document.createTextNode(text)); + container.appendChild(mycontainer); + } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // End Sequence Object //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1992,7 +2060,7 @@ &tab; &tab; - + +