Changeset 5802


Ignore:
Timestamp:
Dec 19, 2019, 2:16:20 PM (2 years ago)
Author:
Nicklas Nordborg
Message:

References #1216: Finalize the "Confirm MIPs demux" wizard

Number of reads is formatted dynamically instead of in "thousands". This is due to the range of values is big and it was confusing to see and understand values such as '1234', '25.2' and '0.45' and compare them quickly. Now they will be displayed as '1.2M', '25.2k' and '450' instead.

Location:
extensions/net.sf.basedb.reggie/trunk/resources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/mipsanalysis/demux_confirm.js

    r5797 r5802  
    227227    html += '<th></th>';
    228228    html += '<th class="dottedleft"></th>';
    229     html += '<th class="dottedleft" colspan="3">Reads (Thousands)</th>';
     229    html += '<th class="dottedleft" colspan="3">Reads</th>';
    230230    html += '<th class="dottedleft" colspan="2">Actions</th>';
    231231    html += '<th class="dottedleft">Comment</th>';
     
    261261      var img = isYellow ? yellowImg : '';
    262262
    263       var reads = merged.READS == null ? '-' : Reggie.formatNumber(merged.READS/1000, null, 2);
    264       var pfReads = merged.PF_READS == null ? '-' : Reggie.formatNumber(merged.PF_READS/1000, null, 2);
     263      var reads = merged.READS == null ? '-' : Reggie.formatCount(merged.READS);
     264      var pfReads = merged.PF_READS == null ? '-' : Reggie.formatCount(merged.PF_READS);
    265265
    266266      var flagChecked = false;
     
    288288      html += '<td>'+pfReads+'</td>';
    289289      html += '<td class="warning-col">';
     290      if (merged.PF_READS == null || merged.PF_READS < 10000)
     291      {
     292        html += '<img src="../images/warning.png" title="Less than 10k reads passed filter">';
     293      }
    290294      html += '</td>';
    291295
  • extensions/net.sf.basedb.reggie/trunk/resources/reggie-2.js

    r5780 r5802  
    113113  reggie.formatCount = function(count)
    114114  {
     115    var unit = '';
    115116    if (count > 1000000)
    116117    {
    117       count = Math.round(count / 1000000) + 'M';
     118      count = count / 1000000;
     119      unit = 'M';
    118120    }
    119121    else if (count > 1000)
    120122    {
    121       count = Math.round(count / 1000) + 'k';
    122     }
    123     return count;
     123      count = count / 1000;
     124      unit = 'k';
     125    }
     126    else
     127    {
     128      return count;
     129    }
     130    var numDecimals = count < 100 ? 1 : 0;
     131    return count.toFixed(numDecimals)+unit;
    124132  }
    125133 
Note: See TracChangeset for help on using the changeset viewer.