Changeset 4980


Ignore:
Timestamp:
Sep 25, 2018, 9:28:29 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1054: Even more functionality in the Flagged alignment wizard

Display existing DoNotUse information for alignments. If a re-process option is selected from an item marked as DoNotUse a warning icon is displayed. In the "Resolve" mode alignments marked as DoNotUse can't be modified.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/flaggedalignment/search.js

    r4978 r4980  
    475475
    476476      var tb = tbody[itemNo] || { 'start': 1, 'end': 1 };
    477       var rowspan = tb.rowspan || cmp.messages.length || 1;
     477      var rowspan = tb.rowspan || (cmp ? cmp.messages.length : 0) || 1;
    478478      var tbodySpan = tb.tbodyspan || rowspan;
    479479     
     
    610610    }
    611611   
     612    var options = document.getElementsByClassName('reprocess-options');
     613    for (var i = 0; i < options.length; i++)
     614    {
     615      Events.addEventHandler(options[i], 'change', search.reprocessOptionOnChange);
     616    }
     617   
    612618    var options = document.getElementsByClassName('donotuse-options');
    613619    for (var i = 0; i < options.length; i++)
     
    645651      aligned.buglevel = 0;
    646652      aligned.bugText = [];
    647 
     653     
    648654      // We need to be able to lookup alignments by name and patient name
    649655      if (!aligned.specimen)
     
    670676        aligned.bugText[aligned.bugText.length] = aligned.lib ?
    671677          'No alignment from this Library' : 'No alignment from this RNA';
     678        var libOrRna = aligned.lib || aligned.rna || {};
     679        // Copy DO_NOT_USE information to make it easier to handle in other places
     680        aligned.DO_NOT_USE = libOrRna.DO_NOT_USE;
     681        aligned.DO_NOT_USE_COMMENT = libOrRna.DO_NOT_USE_COMMENT
    672682      }
    673683     
     
    698708        aligned.bugText[aligned.bugText.length] = 'High HET';
    699709      }
     710     
     711      if (aligned.DO_NOT_USE)
     712      {
     713        aligned.bugText[aligned.bugText.length] = '<span class="donotuse">['+Strings.encodeTags(aligned.DO_NOT_USE)+']</span> ' + Strings.encodeTags(aligned.DO_NOT_USE_COMMENT);
     714        if (!aligned.bugged)
     715        {
     716          aligned.bugged = 1;
     717          aligned.buglevel = 1;
     718        }
     719      }
     720     
    700721    }
    701722  }
     
    814835  }
    815836 
     837  /**
     838    Display a warning icon if the selected re-process option is marked 'donotuse'.
     839  */
     840  search.reprocessOptionOnChange = function(event)
     841  {
     842    var opt = event.currentTarget[event.currentTarget.selectedIndex];
     843    var tmpId = event.currentTarget.id.replace('reprocess.', '');
     844    Doc.addOrRemoveClass('section.'+tmpId, 'reprocess-warning', opt.classList.contains('donotuse'));
     845  }
     846 
    816847  // Enable/disable the DoNotUse list depending on if the OkToUse is checked or not
    817848  search.okToUseOnChange = function(event)
     
    884915    {
    885916      icons += '<img src="../images/comment.png" title="'+Strings.encodeTags(alignment.QC_GENOTYPE_COMMENT)+'">';
     917    }
     918    if (alignment.DO_NOT_USE)
     919    {
     920      icons += '<img src="../images/donotuse.png" title="DoNotUse-'+Strings.encodeTags(alignment.DO_NOT_USE+': '+alignment.DO_NOT_USE_COMMENT)+'">';
    886921    }
    887922    if (alignment.flagged)
     
    14691504    }
    14701505   
    1471     var html = '';
    1472     html += '<select id="'+id+'" name="'+id+'" '+(recommendReprocess? 'title="Re-processing is recommended"':'')+'>';
     1506    var html = '<span class="reprocess-wrapper">';
     1507    html += '<select id="'+id+'" class="reprocess-options" name="'+id+'" '+(recommendReprocess? 'title="Re-processing is recommended"':'')+'>';
    14731508    if (!currentReProcess) html += '<option value="" selected>&nbsp;';
    1474     html += '<option '+(currentReProcess=='Specimen'?'value="" selected':'value="specimen"')+'>Specimen';
    1475     html += '<option '+(currentReProcess=='Lysate'?'value="" selected':'value="lysate"')+'>Lysate';
    1476     html += '<option '+(currentReProcess=='RNA'?'value="" selected':'value="rna"')+'>RNA';
    1477     html += '</select>';
     1509    html += helper.reprocessOption('Specimen', 'specimen', currentReProcess, aligned.specimen.DO_NOT_USE);
     1510    html += helper.reprocessOption('Lysate', 'lysate', currentReProcess, aligned.lysate.DO_NOT_USE);
     1511    html += helper.reprocessOption('RNA', 'rna', currentReProcess, aligned.rna.DO_NOT_USE);
     1512    html += '</select></span>';
    14781513   
    14791514    if (currentReProcess != null)
     
    14831518   
    14841519    return html;
     1520  }
     1521 
     1522  helper.reprocessOption = function(text, value, currentReProcess, doNotUse)
     1523  {
     1524    var opt = '<option ';
     1525    if (currentReProcess==text)
     1526    {
     1527      opt += 'value="" selected';
     1528    }
     1529    else
     1530    {
     1531      opt += 'value="'+value+'"';
     1532    }
     1533    if (doNotUse) opt += ' class="donotuse" title="'+text+' is marked as DoNotUse"'; 
     1534    opt += '>'+text;
     1535    if (doNotUse) opt += ' (!)';
     1536    return opt;
    14851537  }
    14861538 
     
    15051557  helper.resolveOptions = function(aligned, filterType)
    15061558  {
    1507     var idDoNotUse = 'donotuse.'+aligned.tmpId;
    1508     var idOkToUse = 'oktouse.'+aligned.tmpId;
    1509    
    1510     var cls = aligned.flagged && filterType != 'HET' ? 'required' : '';
    1511 
    15121559    var html = '';
    1513     if (aligned.flagged)
    1514     {
    1515       var okValue = filterType == 'QIACUBE' ? 'ok-rna' : 'ok-library';
    1516       html += '<input type="checkbox" value="'+okValue+'" id="'+idOkToUse+'" name="'+idOkToUse+'" class="oktouse" title="Check this to indicate that the flagged item is ok to use.">';
     1560    if (aligned.DO_NOT_USE)
     1561    {
     1562      html += '<input type="checkbox" style="visibility: hidden;">';
     1563      html += aligned.DO_NOT_USE;
    15171564    }
    15181565    else
    15191566    {
    1520       // Dummy checkbox that is hidden. Used to make the selection lists align
    1521       html += '<input type="checkbox" style="visibility: hidden;">';
    1522     }
    1523    
    1524     html += '<select id="'+idDoNotUse+'" name="'+idDoNotUse+'" class="donotuse-options '+cls+'">';
    1525     html += '<option value="">&nbsp;';
    1526     if (filterType != 'QIACUBE')
    1527     {
    1528       html += '<option value="library">Library';
    1529     }
    1530     html += '<option value="rna">RNA';
    1531     html += '<option value="lysate">Lysate';
    1532     html += '<option value="specimen">Specimen';
    1533     html += '</select>';
     1567      var idDoNotUse = 'donotuse.'+aligned.tmpId;
     1568      var idOkToUse = 'oktouse.'+aligned.tmpId;
     1569      var cls = aligned.flagged && filterType != 'HET' ? 'required' : '';
     1570 
     1571      if (aligned.flagged)
     1572      {
     1573        var okValue = filterType == 'QIACUBE' ? 'ok-rna' : 'ok-library';
     1574        html += '<input type="checkbox" value="'+okValue+'" id="'+idOkToUse+'" name="'+idOkToUse+'" class="oktouse" title="Check this to indicate that the flagged item is ok to use.">';
     1575      }
     1576      else
     1577      {
     1578        // Dummy checkbox that is hidden. Used to make the selection lists align
     1579        html += '<input type="checkbox" style="visibility: hidden;">';
     1580      }
     1581     
     1582      html += '<select id="'+idDoNotUse+'" name="'+idDoNotUse+'" class="donotuse-options '+cls+'">';
     1583      html += '<option value="">&nbsp;';
     1584      if (filterType != 'QIACUBE')
     1585      {
     1586        html += '<option value="library">Library';
     1587      }
     1588      html += '<option value="rna">RNA';
     1589      html += '<option value="lysate">Lysate';
     1590      html += '<option value="specimen">Specimen';
     1591      html += '</select>';
     1592    }
    15341593
    15351594    return html;
     
    15381597  helper.resolveComment = function(aligned)
    15391598  {
    1540     var id = 'resolvecomment.'+aligned.tmpId;
    1541     html = '<input type="text" id="'+id+'" name="'+id+'" value="'+Strings.encodeTags(aligned.QC_GENOTYPE_COMMENT)+'">';
     1599    var html = '';
     1600    if (aligned.DO_NOT_USE)
     1601    {
     1602      html += Strings.encodeTags(aligned.DO_NOT_USE_COMMENT);
     1603    }
     1604    else
     1605    {
     1606      var id = 'resolvecomment.'+aligned.tmpId;
     1607      html += '<input type="text" id="'+id+'" name="'+id+'" value="'+Strings.encodeTags(aligned.QC_GENOTYPE_COMMENT)+'">';
     1608    }
     1609
    15421610    return html;
    15431611  }
  • extensions/net.sf.basedb.reggie/trunk/resources/flaggedalignment/search.jsp

    r4976 r4980  
    223223  border-right-width: 8px;
    224224  border-right-color: #2288AA;
     225}
     226
     227span.donotuse
     228{
     229  font-style: italic;
     230  color: #666666;
     231}
     232
     233option.donotuse
     234{
     235  color: #999999;
     236}
     237
     238.reprocess-warning .reprocess-wrapper:after
     239{
     240  content: url('../images/warning.png');
     241  vertical-align: bottom;
     242  padding: 2px;
    225243}
    226244</style>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/GenotypeServlet.java

    r4979 r4980  
    826826 
    827827
     828  private void loadLibraryAnnotations(DbControl dc, SnapshotManager manager, Library lib)
     829  {
     830    if (lib == null) return;
     831    Extract libExtract = lib.getExtract();
     832    lib.loadBioPlateLocation();
     833    lib.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null);
     834    lib.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null);
     835  }
     836 
    828837  private void loadRnaAnnotations(DbControl dc, SnapshotManager manager, Rna rna)
    829838  {
     
    834843    rna.loadAnnotations(dc, manager, "QIACUBE_POSITION", Annotationtype.QIACUBE_POSITION, null);
    835844    rna.loadAnnotations(dc, manager, "AutoProcessing", Annotationtype.AUTO_PROCESSING, null);
     845    rna.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null);
     846    rna.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null);
    836847    rna.setAnnotation("remainingQuantity", rnaExtract.getRemainingQuantity());
    837848    rna.setAnnotation("originalQuantity", rnaExtract.getOriginalQuantity());
     
    915926      as.loadAnnotations(dc, manager, "QC_GENOTYPE_VERIFIED", Annotationtype.QC_GENOTYPE_VERIFIED, null);
    916927      as.loadAnnotations(dc, manager, "QC_GENOTYPE_COMMENT", Annotationtype.QC_GENOTYPE_COMMENT, null);
     928      as.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null);
     929      as.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null);
    917930      as.setAnnotation("QC_GENOTYPE_STATUS", qcStatus);
    918931      as.setAnnotation("flagged", checker.isFlagged(as.getItem()));
    919932      Library lib = as.getLibrary(dc);
    920       lib.loadBioPlateLocation();
    921933      Rna rna = lib.getRna(dc, false);
    922934      Lysate lys = rna != null ? rna.getLysate() : null;
    923935      SpecimenTube sp = lys != null ? lys.getSpecimen() : null;
    924936     
     937      loadLibraryAnnotations(dc, manager, lib);
    925938      loadRnaAnnotations(dc, manager, rna);
    926939      loadLysateAnnotations(dc, manager, lys);
     
    973986        {
    974987          lib = Library.get(e);
    975           lib.loadBioPlateLocation();
    976988          rna = lib.getRna(dc, false);
    977989          // Can be null here if the library is external
     
    980992        }
    981993       
     994        loadLibraryAnnotations(dc, manager, lib);
    982995        loadRnaAnnotations(dc, manager, rna);
    983996        loadLysateAnnotations(dc, manager, lys);
Note: See TracChangeset for help on using the changeset viewer.