Commit ffe9f658 authored by Marc Duez's avatar Marc Duez
Browse files

segment.js : improve potential field to highlight detection

parent e178ff4e
...@@ -549,26 +549,30 @@ Segment.prototype = { ...@@ -549,26 +549,30 @@ Segment.prototype = {
findPotentialField : function () { findPotentialField : function () {
result = [""]; result = [""];
var clone = this.m.clone(1);
for (var i in this.m) { for (var i in this.m) {
if (this.isDNA(this.m[i])){ if (this.isDNA(this.m[i]) ||this.isDNA(m[i]) ){
result.push(i) if (result.indexOf(i) == -1) result.push(i);
} }
} }
for (var i in clone) { for (var j=0; (j<10 & j<this.m.clones.length) ; j++){
if (this.isDNA(clone[i])){ var clone = this.m.clone(j);
result.push(i) console.log(clone)
for (var i in clone) {
if (this.isDNA(clone[i]) || this.isPos(clone[i]) ){
if (result.indexOf(i) == -1) result.push(i);
}
} }
}
if (typeof clone.seg != 'undefined'){
for (var i in clone) { for (var i in clone.seg) {
if (this.isDNA(clone.seg[i])){ if (this.isDNA(clone.seg[i]) || this.isPos(clone.seg[i]) ){
result.push(i) if (result.indexOf(i) == -1) result.push(i);
}
}
} }
} }
return result; return result;
}, },
...@@ -585,6 +589,16 @@ Segment.prototype = { ...@@ -585,6 +589,16 @@ Segment.prototype = {
} }
}, },
isPos : function (obj) {
if (obj == null) {
return false;
}else if (typeof obj.start != 'undefined' && typeof obj.stop != 'undefined') {
return true;
}else{
return false;
}
},
isAA : function (string) { isAA : function (string) {
if (string == null) { if (string == null) {
return false; return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment