Changeset 4981


Ignore:
Timestamp:
Sep 25, 2018, 2:11:48 PM (4 years ago)
Author:
Nicklas Nordborg
Message:

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

Added an option to keep an alignment that was marked as DoNotUse available for future genotype checks (eg. QC_GENOTYPE_STATUS=Checked instead of QC_GENOTYPE_STATUS=Disabled).

For example, if we have a QiaCube shift on positions 8-12, a verified RNA on position 6 but no information about the RNA at position 7 (and no remaining specimen) we can mark it as DoNotUse but keep it enabled for genotype checks in case we get a second sample from the same patient in the future.

Note that there is no possibility yet to change the DoNotUse to OkToUse if the second sample confirms that the original sample was correct.

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

Legend:

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

    r4980 r4981  
    442442      html += '<th class="mode-reprocess num-col">RNA<br>(µg)</th>';
    443443      html += '<th class="mode-reprocess" id="reprocess-header">Re-process</th>';
    444       // Note! Two "mode-resolve" columns here to get the same order for grouping
    445       html += '<th class="mode-resolve dottedleft">Ok / Do not use?</th>';
     444      // Note! "mode-resolve" columns here to get the same order for grouping
     445      html += '<th class="mode-resolve dottedleft">Ok</th>';
     446      html += '<th class="mode-resolve">DoNotUse</th>';
     447      html += '<th class="mode-resolve">FutureGT</th>';
    446448      html += '<th class="mode-resolve comment-col">Comment</th>';
    447449
     
    536538          html += '<td rowspan="'+tbodySpan+'" class="mode-reprocess">'+(sp ? HTMLHelper.reprocessOptions(aligned, recommendReprocess) : '')+'</td>';
    537539
    538           html += '<td rowspan="'+tbodySpan+'" class="mode-resolve dottedleft">'+(sp ? HTMLHelper.resolveOptions(aligned, filterType) : '')+'</td>';
     540          html += '<td rowspan="'+tbodySpan+'" class="mode-resolve dottedleft">'+(sp ? HTMLHelper.okToUseOptions(aligned, filterType) : '')+'</td>';
     541          html += '<td rowspan="'+tbodySpan+'" class="mode-resolve">'+(sp ? HTMLHelper.resolveOptions(aligned, filterType) : '')+'</td>';
     542          html += '<td rowspan="'+tbodySpan+'" class="mode-resolve">'+(sp ? HTMLHelper.futureGtOptions(aligned, filterType) : '')+'</td>';
    539543          html += '<td rowspan="'+tbodySpan+'" class="mode-resolve comment-col dottedright">'+(sp ? HTMLHelper.resolveComment(aligned) : '')+'</td>';
    540544        }
     
    850854    var tmpId = event.currentTarget.id.replace('oktouse.', '');
    851855    var doNotUseList = Doc.element('donotuse.'+tmpId);
     856    var futureGtCheck = Doc.element('futuregt.'+tmpId);
    852857    var commentField = Doc.element('resolvecomment.'+tmpId);
    853858    if (event.currentTarget.checked)
     
    857862      Doc.removeClass(commentField, 'required');
    858863      doNotUseList.disabled = true;
     864      futureGtCheck.disabled = true;
    859865    }
    860866    else
     
    871877    var tmpId = event.currentTarget.id.replace('donotuse.', '');
    872878    var value = event.currentTarget.value;   
     879    var futureGtCheck = Doc.element('futuregt.'+tmpId);
     880    futureGtCheck.disabled = value == '';
    873881    var commentField = Doc.element('resolvecomment.'+tmpId);
    874882    Doc.addOrRemoveClass(commentField, 'required', value != '');
     
    935943    {
    936944      var img = bugIcons[alignment.buglevel];
    937       var imgTitle = alignment.buglevel > 0 && alignment.bugText.length > 0 ? alignment.bugText[0] : '';
     945      // .replace will strip simple HTML tags
     946      var imgTitle = alignment.buglevel > 0 && alignment.bugText.length > 0 ? alignment.bugText[0].replace(/<\/?[^>]+(>|$)/g, '') : '';
    938947      icons += '<img src="../images/'+img+'" title="'+imgTitle+'">';
    939948    }
     
    11161125      var okToUse = Doc.element('oktouse.'+aligned.tmpId);
    11171126      var doNotUse = Doc.element('donotuse.'+aligned.tmpId);
     1127      var futureGt = Doc.element('futuregt.'+aligned.tmpId);
    11181128      var comment = Doc.element('resolvecomment.'+aligned.tmpId);
    11191129     
     
    11531163          Doc.addClass('section.'+aligned.tmpId, 'invalid');
    11541164          numInvalid++;
     1165        }
     1166        if (doNotUse.value && futureGt)
     1167        {
     1168          item.futureGt = futureGt.checked;
    11551169        }
    11561170      }
     
    15511565  }
    15521566
     1567  helper.okToUseOptions = function(aligned, filterType)
     1568  {
     1569    var html = '';
     1570    if (aligned.flagged && !aligned.DO_NOT_USE)
     1571    {
     1572      var idOkToUse = 'oktouse.'+aligned.tmpId;
     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    return html;
     1577  }
     1578 
    15531579  /**
    15541580    We generate a checkbox (if the item is flagged) and a
     
    15601586    if (aligned.DO_NOT_USE)
    15611587    {
    1562       html += '<input type="checkbox" style="visibility: hidden;">';
    15631588      html += aligned.DO_NOT_USE;
    15641589    }
     
    15661591    {
    15671592      var idDoNotUse = 'donotuse.'+aligned.tmpId;
    1568       var idOkToUse = 'oktouse.'+aligned.tmpId;
    15691593      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      
     1594   
    15821595      html += '<select id="'+idDoNotUse+'" name="'+idDoNotUse+'" class="donotuse-options '+cls+'">';
    15831596      html += '<option value="">&nbsp;';
     
    15941607    return html;
    15951608  }
     1609 
     1610  helper.futureGtOptions = function(aligned, filterType)
     1611  {
     1612    var html = '';
     1613    if (!aligned.DO_NOT_USE)
     1614    {
     1615      var idFutureGt = 'futuregt.'+aligned.tmpId;
     1616      html += '<input type="checkbox" id="'+idFutureGt+'" name="'+idFutureGt+'" disabled title="Check this to use the alignment in future genotype checks.">';
     1617    }
     1618    return html;
     1619  }
     1620
    15961621
    15971622  helper.resolveComment = function(aligned)
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/GenotypeServlet.java

    r4980 r4981  
    531531        int numUnflagged = 0;
    532532        int numDisabled = 0;
     533        int numFutureGt = 0;
    533534        int numOkToUse = 0;
    534535        int numAutoUnflagged = 0;
     
    546547          String doNotUse = (String)jsonItem.get("doNotUse");
    547548          boolean okToUse = Boolean.TRUE.equals(jsonItem.get("okToUse"));
     549          boolean futureGt = Boolean.TRUE.equals(jsonItem.get("futureGt"));
    548550          String comment = (String)jsonItem.get("comment");
    549551         
     
    646648                if (doNotUse != null)
    647649                {
    648                   Annotationtype.QC_GENOTYPE_STATUS.setAnnotationValue(dc, dba, "Disabled");
    649                   jsonDebug.add("[Debug]Disabled: " + basicItem);
    650                   numDisabled++;
     650                  if (futureGt)
     651                  {
     652                    Annotationtype.QC_GENOTYPE_STATUS.setAnnotationValue(dc, dba, "Checked");
     653                    jsonDebug.add("[Debug]FutureGT: " + basicItem);
     654                    numFutureGt++;
     655                  }
     656                  else
     657                  {
     658                    Annotationtype.QC_GENOTYPE_STATUS.setAnnotationValue(dc, dba, "Disabled");
     659                    jsonDebug.add("[Debug]Disabled: " + basicItem);
     660                    numDisabled++;
     661                  }
    651662                }
    652663                else if (okToUse)
     
    713724        }
    714725       
    715         if (numDisabled > 0)
    716         {
    717           jsonMessages.add(countMessage(numDisabled, "alignment has", "alignments have") + " been disabled for future genotype checks.");
     726        if (numDisabled > 0 || numFutureGt > 0)
     727        {
     728          StringBuilder msg = new StringBuilder();
     729          if (numDisabled > 0)
     730          {
     731            msg.append(countMessage(numDisabled, "alignment has", "alignments have")).append(" been disabled");
     732          }
     733          if (numFutureGt > 0)
     734          {
     735            if (msg.length() > 0) msg.append(" and ");
     736            msg.append(countMessage(numFutureGt, "alignment has", "alignments have")).append(" been retained");
     737          }
     738          msg.append(" for future genotype checks.");
     739          jsonMessages.add(msg.toString());
    718740        }
    719741
Note: See TracChangeset for help on using the changeset viewer.