Changeset 5812


Ignore:
Timestamp:
Jan 16, 2020, 8:35:19 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1221: Display more information in the Variant summary dialog

Long REF and ALT sequnces are cut after 5 characters (and ... is appended). The full sequence is available as a tooltip.

Count and display number of SNV, Insertions and Deletions.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/view_variants.js

    r5805 r5812  
    2222    var snpData = response.snpData;
    2323   
     24    var numIns = 0;
     25    var numDel = 0;
     26    var numSnv = 0;
     27   
    2428    var html = '';
    2529    for (var snpNo = 0; snpNo < snpData.length; snpNo++)
     
    2933      var cosmicId = info['cosmic_ID'];
    3034      var dbSnpId = info['dbsnp_ID'];
     35      var type = info['TYPE'];
     36      if (type == 'SNV') numSnv++;
     37      else if (type == 'Insertion') numIns++;
     38      else if (type == 'Deletion') numDel++;
    3139      html += '<tr class="snp highlight">';
    3240      html += '<td>'+Strings.encodeTags(snp.chromosome+':'+snp.position)+'</td>';
    33       html += '<td class="dottedleft ref">'+Strings.encodeTags(snp.ref+' › '+snp.alt)+'</td>';
    34       html += '<td class="dottedleft">'+Strings.encodeTags(info['TYPE'])+'</td>';
    35       html += '<td class="dottedleft">'+Strings.encodeTags(info['ncbiRefSeq'])+'</td>';
     41      html += '<td class="dottedleft ref">'+vgt.getRefAndAlt(snp.ref, snp.alt)+'</td>';
     42      html += '<td class="dottedleft">'+Strings.encodeTags(type)+'</td>';
     43      html += '<td class="dottedleft">'+vgt.getGenes(info['ncbiRefSeq'])+'</td>';
    3644      html += '<td class="dottedleft">'+vgt.getCosmicLink(cosmicId)+'</td>';
    3745      html += '<td class="dottedleft">'+vgt.getDbSnpLink(dbSnpId)+'</td>';
     
    4048    Doc.element('snp-list').innerHTML = html;
    4149    Doc.show('snp-table', 'table');
    42     Doc.element('snp-count').innerHTML = snpData.length + ' passed filter; ' + rba.VariantsRaw + ' raw variants';
     50    Doc.element('snp-count').innerHTML = snpData.length + ' passed filter ('+
     51      numSnv + ' SNV; ' + numIns + ' insertions; ' + numDel + ' deletions); ' +
     52      rba.VariantsRaw + ' raw variants';
    4353  }
    4454 
     
    5464   
    5565    return Strings.encodeTags(list.join(', '));
     66  }
     67 
     68  vgt.getGenes = function(genes)
     69  {
     70    if (!genes) return '';
     71    return Strings.encodeTags(genes.split(',').join(', '));
     72  }
     73 
     74  vgt.getRefAndAlt = function(ref, alt)
     75  {
     76    if (ref.length > 6) ref = '<span title="'+ref+'">'+ref.substring(0, 5)+'...</span>';
     77    if (alt.length > 6) alt = '<span title="'+alt+'">'+alt.substring(0, 5)+'...</span>';
     78    return ref + ' › ' + alt;
    5679  }
    5780 
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/view_variants.jsp

    r5805 r5812  
    5959{
    6060  text-align: center;
     61  white-space: nowrap;
    6162}
    6263</style>
Note: See TracChangeset for help on using the changeset viewer.