diff --git a/browser/js/clone.js b/browser/js/clone.js index 822b6241fb033cd3e5c7a23d9c1d1b75d1a226b8..eb8decfdd4e63cc03b4c8ceb84f85f00c530dae8 100644 --- a/browser/js/clone.js +++ b/browser/js/clone.js @@ -48,21 +48,15 @@ function Clone(data, model, index, virtual) { } this.seg = this.m.convertSeg(this.seg) - - if (typeof (this.getSequence()) != 'undefined' && typeof (this.name) != 'undefined') { - this.shortName = this.name.replace(new RegExp('IGHV', 'g'), "VH"); - this.shortName = this.shortName.replace(new RegExp('IGHD', 'g'), "DH"); - this.shortName = this.shortName.replace(new RegExp('IGHJ', 'g'), "JH"); - this.shortName = this.shortName.replace(new RegExp('TRG', 'g'), ""); - this.shortName = this.shortName.replace(new RegExp('\\*..', 'g'), ""); - } - + this.m.clusters[index]=[index] this.m.clones[index]=this this.tag = this.getTag(); this.computeGCContent() this.computeCoverage() this.computeEValue() + + this.computeShortName() } function nullIfZero(x) { return (x === 0 || x === '0') ? '' : x } @@ -110,7 +104,12 @@ Clone.prototype = { return size; }, - getShortName: function () { + + /** + * Compute a .shortName from .getName() + */ + + computeShortName: function () { name_items = this.getName().split(' ') short_name_items = [] @@ -172,7 +171,11 @@ Clone.prototype = { short_name_items.push(s) } - return short_name_items.join(' ') + this.shortName = short_name_items.join(' ') + }, + + getShortName: function () { + return this.shortName }, /** diff --git a/browser/js/model.js b/browser/js/model.js index 3a489a7687f133ec625b44afc747fd25a1055ccc..b333bcccf120d95c2a3424f1b73afc8fee4c616a 100644 --- a/browser/js/model.js +++ b/browser/js/model.js @@ -297,12 +297,18 @@ Model.prototype = { changeCloneNotation: function(cloneNotationType) { this.cloneNotationType = cloneNotationType; + + for (var i = 0; i < this.clones.length; i++) + this.clone(i).computeShortName() this.update(); }, changeAlleleNotation: function(alleleNotation) { this.alleleNotation = alleleNotation; + + for (var i = 0; i < this.clones.length; i++) + this.clone(i).computeShortName() this.update(); },