...
  View open merge request
Commits (3)
...@@ -316,7 +316,7 @@ Clone.prototype = { ...@@ -316,7 +316,7 @@ Clone.prototype = {
* If it does not exist return null * If it does not exist return null
*/ */
getSegStartStop: function(field_name) { getSegStartStop: function(field_name) {
if (this.hasSeg(field_name) && if (this.sequence && this.hasSeg(field_name) &&
typeof this.seg[field_name].start !== 'undefined' && typeof this.seg[field_name].start !== 'undefined' &&
typeof this.seg[field_name].stop !== 'undefined') { typeof this.seg[field_name].stop !== 'undefined') {
return {'start': this.seg[field_name].start, return {'start': this.seg[field_name].start,
......
...@@ -817,7 +817,9 @@ Segment.prototype = { ...@@ -817,7 +817,9 @@ Segment.prototype = {
this.resetAlign() this.resetAlign()
if ( typeof this.sequence[id]=="undefined"){ if ( typeof this.sequence[id]=="undefined"){
this.sequence[id] = new genSeq(id, locus, this.m, this) this.sequence[id] = new genSeq(id, locus, this.m, this)
this.sequence[id].load("str") if ((!isNaN(Number(id)) && this.m.clones[id].sequence) || isNaN(Number(id)) ){
this.sequence[id].load("str")
}
var divParent = document.getElementById("listSeq"); var divParent = document.getElementById("listSeq");
var previous_li = divParent.getElementsByTagName("li"); var previous_li = divParent.getElementsByTagName("li");
if (previous_li && previous_li.length === 0) { if (previous_li && previous_li.length === 0) {
...@@ -832,9 +834,10 @@ Segment.prototype = { ...@@ -832,9 +834,10 @@ Segment.prototype = {
this.div_element(spanF, id); this.div_element(spanF, id);
var spanM = document.createElement('span'); var spanM = document.createElement('span');
spanM.id = "m" + id; spanM.id = "m" + id;
spanM.className = "seq-mobil"; spanM.className = "seq-mobil";
spanM.innerHTML = this.sequence[id].load(str).toString(this); if ((!isNaN(Number(id)) && this.m.clones[id].sequence) || isNaN(Number(id)) ) {
spanM.innerHTML = this.sequence[id].load(str).toString(this);
}
li.appendChild(spanF); li.appendChild(spanF);
li.appendChild(spanM); li.appendChild(spanM);
divParent.appendChild(li); divParent.appendChild(li);
...@@ -1492,7 +1495,7 @@ Sequence.prototype = Object.create(genSeq.prototype); ...@@ -1492,7 +1495,7 @@ Sequence.prototype = Object.create(genSeq.prototype);
str = typeof str !== 'undefined' ? str : this.m.clone(this.id).sequence; str = typeof str !== 'undefined' ? str : this.m.clone(this.id).sequence;
if (typeof this.m.clone(this.id).sequence == 'undefined' || this.m.clone(this.id).sequence === 0) { if (typeof this.m.clone(this.id).sequence == 'undefined' || this.m.clone(this.id).sequence === 0) {
str = this.m.clone(this.id).id str = "" // By default don't show ID as sequence if clone haven't sequence content
} }
this.seq = str.split("") this.seq = str.split("")
...@@ -1511,6 +1514,8 @@ Sequence.prototype = Object.create(genSeq.prototype); ...@@ -1511,6 +1514,8 @@ Sequence.prototype = Object.create(genSeq.prototype);
var stop = -1; var stop = -1;
var clone = this.m.clone(this.id); var clone = this.m.clone(this.id);
if (!clone.sequence) return
if (clone.hasSeg('cdr3')){ if (clone.hasSeg('cdr3')){
if (typeof clone.seg.cdr3.start != "undefined") { if (typeof clone.seg.cdr3.start != "undefined") {
start = this.pos[clone.seg.cdr3.start]; start = this.pos[clone.seg.cdr3.start];
......