diff --git a/browser/js/clone.js b/browser/js/clone.js
index 64ef3a1cfd11cd081f4447224710c96b72a13098..64332a38f2ded123a21773abac35766155ad2898 100644
--- a/browser/js/clone.js
+++ b/browser/js/clone.js
@@ -1707,6 +1707,9 @@ Clone.prototype = {
html += row_1("locus", this.m.systemBox(this.germline).outerHTML + this.germline +
"
", undefined, time_length)
}
+ if (this.seg != undefined && this.seg.junction != undefined){
+ html += row_1("Productivity", this.getProductivityNameDetailed() + "", undefined, time_length)
+ }
if (this.hasSizeConstant() || (this.hasSizeDistrib() && this.getGene("5") != "undefined V")){
html += row_1("V gene (or 5')", this.getGene("5") +
"", undefined, time_length)
diff --git a/browser/js/model.js b/browser/js/model.js
index 210054a7d844f45c26393dfe9e99332e7b6d81da..213be7ba9706da869ef74be33e23ec89a803c3e1 100644
--- a/browser/js/model.js
+++ b/browser/js/model.js
@@ -729,8 +729,18 @@ changeAlleleNotation: function(alleleNotation, update, save) {
} else if (typeof this.diversity[key][time] != 'undefined') {
// Diversity may not be stored in an Array for retrocompatiblitiy reasons
// See #1941 and #3416
- if (this.diversity[key][time] != null) {
- return this.diversity[key][time].toFixed(3);
+ if (this.diversity[key][time] != null){
+ if (typeof this.diversity[key][time] == "number") {
+ // old case, one global diversity
+ return this.diversity[key][time].toFixed(3);
+ } else {
+ // case diversity by locus
+ var diversity_by_locus = {}
+ for (var locus in this.diversity[key][time]) {
+ diversity_by_locus[locus] = this.diversity[key][time][locus].toFixed(3)
+ }
+ return diversity_by_locus
+ }
} else {
return this.diversity[key][time]
}
@@ -1563,9 +1573,20 @@ changeAlleleNotation: function(alleleNotation, update, save) {
// Sub-table diversity
if ( typeof this.diversity != 'undefined') {
- html += "
"
+ html += "
"
for (var key_diversity in this.diversity) {
- html += " " + key_diversity.replace('index_', '') + " | " + this.getDiversity(key_diversity, timeID) + ' |
'
+ var diversity = this.getDiversity(key_diversity, timeID)
+ if (typeof diversity == "string" || diversity == null){
+ html += " " + translate_key_diversity(key_diversity) + " | " + diversity + ' |
'
+ } else if (typeof diversity == "object"){
+ html += ""+translate_key_diversity(key_diversity)+" |
"
+ var present_locus = this.getLocusPresentInTop(timeID)
+ for (var locus in diversity) {
+ if( present_locus.indexOf(locus) != -1 || locus == "all"){
+ html += " " + this.systemBox(locus).outerHTML + " "+locus+" | " + diversity[locus] + ' |
'
+ }
+ }
+ }
}
}
if ( typeof this.samples.diversity != 'undefined' && typeof this.samples.diversity[timeID] != 'undefined') {
@@ -1659,6 +1680,24 @@ changeAlleleNotation: function(alleleNotation, update, save) {
return html
},
+ /**
+ * Allow to know if a locus is present in clonotype of a sample
+ * include each clonotype of each clone inside the top limit and present with a least one read
+ * If a clone is share between sample, it will be present even in not in top limit of the sample (see fuse of top field)
+ */
+ getLocusPresentInTop: function(time){
+ var locus = []
+ for (var i = this.clones.length - 1; i >= 0; i--) {
+ var clone = this.clones[i]
+ if (clone.reads[time] && clone.top <= m.top){
+ if (locus.indexOf(clone.germline) == -1){
+ locus.push(clone.germline)
+ }
+ }
+ }
+ return Array.from( new Set(locus) )
+ },
+
////////////////////////////////////
//// clusters functions
diff --git a/browser/js/tools.js b/browser/js/tools.js
index aca759f5aa9e8824a68705a6abedca4e8bb8cdd7..02a348204c50ddef44235db06f483659cdc2ee78 100644
--- a/browser/js/tools.js
+++ b/browser/js/tools.js
@@ -938,6 +938,16 @@ function download_csv(csv, filename) {
}
+function translate_key_diversity(key_diversity){
+ var table = {
+ "index_H_entropy" : "Shannon's diversity",
+ "index_E_equitability" : "Shannon's equitability",
+ "index_Ds_diversity" : "Simpson's diversity"
+ }
+ return table[key_diversity]
+}
+
+
///////////////////////////
/// Fct to fill info table
///////////////////
diff --git a/browser/test/QUnit/testFiles/clone_test.js b/browser/test/QUnit/testFiles/clone_test.js
index 8fe2e8717b32565b2830e3edd1642d83939e6bfc..50692d29d6585c2395c779fc43bd1d37f6f15fba 100644
--- a/browser/test/QUnit/testFiles/clone_test.js
+++ b/browser/test/QUnit/testFiles/clone_test.js
@@ -284,8 +284,8 @@ QUnit.test("name, informations, getHtmlInfo", function(assert) {
"getHtmlInfo: segmentation information + modification button + manuallyChanged icon");
// locus | TRG |
// not tested (order of title/class)
-
-
+ assert.includes(html, "Productivity | ",
+ "getHtmlInfo: productivity information (if exist)");
// locus/genes content tests
// TODO correct this locus test/function for chromium/firefox (inversion des balises)
/*assert.includes(html, " |
locus | TRG |