Commit 60c75892 authored by Mathieu Giraud's avatar Mathieu Giraud

clone.js, export.js: extract .getPrintableSize()

parent 4b086381
......@@ -163,6 +163,16 @@ Clone.prototype = {
var size = this.getSystemSize(time);
return this.m.formatSize(size, true)
},
/* return a printable size such as either '26.32%' or '26.32% (33.66% of IGH)' (when there are several systems) */
getPrintableSize: function (time) {
s = this.getStrSize(time)
if (this.m.system_available.length>1) {
s += ' (' + this.getStrSystemSize(time) + ' of ' + this.germline + ')'
}
return s
},
/*
*
......
......@@ -474,20 +474,10 @@ Report.prototype = {
var reads_stats = $('<span/>', {'class': 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var t = m.samples.order[i]
$('<span/>', {'text': m.clone(cloneID).getStrSize(t)+'\u00a0', 'class': 'clone_value'}).appendTo(reads_stats);
}
if (m.system_available.length>1){
var reads_system_stats = $('<span/>', {'class': 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var t = m.samples.order[i]
$('<span/>', {'text': m.clone(cloneID).getStrSystemSize(t)+'\u00a0', 'class': 'clone_value'}).appendTo(reads_system_stats);
}
$('<span/>', {'text': m.clone(cloneID).getPrintableSize(t)+'\u00a0', 'class': 'clone_value'}).appendTo(reads_stats);
}
}else{
if (m.system_available.length>1){
$('<span/>', {'text': '('+m.clone(cloneID).getStrSystemSize(time)+' of '+system+')\u00a0', 'class': 'float-right'}).appendTo(head);
}
$('<span/>', {'text': m.clone(cloneID).getStrSize(time)+'\u00a0', 'class': 'float-right'}).appendTo(head);
$('<span/>', {'text': m.clone(cloneID).getPrintableSize(time)+'\u00a0', 'class': 'float-right'}).appendTo(head);
}
//colorized clone sequence
......
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