Changeset 1947


Ignore:
Timestamp:
Apr 22, 2013, 9:46:28 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Add support for custom warning levels for remaining quantity and RQS/RIN scores.

Do not manually flag items if clicking 'Cancel' in the dialog

Add option to not flag RNA that has been automatically flagged.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/select_rna.jsp

    r1946 r1947  
    4141var QUANTITY_REGULAR;
    4242var QUANTITY_QC;
    43 var LOW_QUANTITY_WARNING_FACTOR = 2;
    44 var QUALITY_SCORE_WARNING_LIMIT = 8;
     43var LOW_QUANTITY_WARNING_LIMIT;
     44var QUALITY_SCORE_WARNING_LIMIT;
    4545
    4646var Rna = function()
     
    219219          }
    220220          // Warning if near the limit
    221           if (info.remainingQuantity < remainLimit *  LOW_QUANTITY_WARNING_FACTOR)
     221          if (info.remainingQuantity < LOW_QUANTITY_WARNING_LIMIT)
    222222          {
    223223            if (!warningMsg) warningMsg = 'Low quantity';
     
    290290 
    291291  quantityOnBlur();
     292  warningLevelOnBlur();
    292293 
    293294  var frm = document.forms['reggie'];
     
    787788    }
    788789    comment = prompt('Comment', comment || '');
     790    if (!comment) return;
    789791  }
    790792 
     
    14231425  Plate.paint(Plate.getWells());
    14241426}
     1427
     1428function warningLevelOnBlur()
     1429{
     1430  var frm = document.forms['reggie'];
     1431 
     1432  var wQuantity = parseFloat(frm.warning_quantity.value);
     1433  if (!(wQuantity > 0))
     1434  {
     1435    setInputStatus('warnings', 'Remaining quantity must be ≥ 0.', 'invalid');
     1436    return;
     1437  }
     1438  var wQualityScore = parseFloat(frm.warning_quality_score.value);
     1439  if (!(wQualityScore > 0))
     1440  {
     1441    setInputStatus('warnings', 'RQS/RIN must be ≥ 0.', 'invalid');
     1442    return;
     1443  }
     1444 
     1445  LOW_QUANTITY_WARNING_LIMIT = wQuantity;
     1446  QUALITY_SCORE_WARNING_LIMIT = wQualityScore;
     1447  setInputStatus('warnings', '', 'valid');
     1448  Plate.paint(Plate.getWells());
     1449}
     1450
    14251451
    14261452</script>
     
    16331659      title="LowQualityScore"
    16341660      onclick="flagSelected('LowQualityScore')"
    1635       tooltip="Flag the selected RNA"
     1661      tooltip="Flag the selected RNA as having a too low RQS/RIN value"
    16361662    />
    16371663    <m:menuitem
    16381664      title="NotEnoughRemainingQuantity"
    16391665      onclick="flagSelected('NotEnoughRemainingQuantity')"
    1640       tooltip="Flag the selected RNA"
     1666      tooltip="Flag the selected RNA as having too little remaining quantity"
    16411667    />
     1668    <m:menuseparator />
    16421669    <m:menuitem
    16431670      title="Other..."
    16441671      onclick="flagSelected('ManualFlag')"
    1645       tooltip="Flag the selected RNA"
     1672      tooltip="Flag the selected RNA for some other reason"
    16461673    />
    16471674  </m:menu>
     
    17101737      <tr style="vertical-align: top;">
    17111738        <td class="prompt">Show</td>
    1712         <td class="input">
     1739        <td class="input" colspan="2">
    17131740          <table>
    17141741          <tr valign="top">
     
    17201747              <input type="checkbox" name="quality-score" id="quality-score" onclick="toggleInfo('quality-score')"><label for="quality-score">RQS/RIN</label><br>
    17211748              <input type="checkbox" name="ndconc" id="ndconc" onclick="toggleInfo('ndconc')"><label for="ndconc">NDConc</label><br>
     1749            </td>
     1750            <td>
    17221751              <input type="checkbox" name="volumes" id="volumes" onclick="toggleInfo('volumes')"><label for="volumes">Used volume+water</label><br>
    17231752            </td>
     
    17251754          </table>
    17261755        </td>
    1727         <td class="status"></td>
    17281756        <td class="help">Toggles visiblity of the selected information inside each well on the plate.</td>
     1757      </tr>
     1758      <tr valign="top">
     1759        <td class="prompt">Warning levels</td>
     1760        <td class="input">
     1761          Remaining quantity&lt;<input type="text" class="text" name="warning_quantity"
     1762            value="2.2" style="width: 4em;"
     1763            onblur="warningLevelOnBlur()"
     1764            onkeypress="return Numbers.numberOnly(event)">µg,
     1765          RQS/RIN&lt;<input type="text" class="text" name="warning_quality_score"
     1766            value="8" style="width: 4em;"
     1767            onblur="warningLevelOnBlur()"
     1768            onkeypress="return Numbers.numberOnly(event)">
     1769        </td>
     1770        <td class="status" id="warnings.status"></td>
     1771        <td class="help">
     1772          <span id="warnings.message" class="message" style="display: none;"></span>
     1773          Warning levels for remaining quantity and RQS/RIN values.
     1774        </td>
    17291775      </tr>
    17301776      </table>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/show_flagged_rna.jsp

    r1946 r1947  
    4848    document.getElementById('remainingQuantity.'+i).innerHTML = rna.remainingQuantity;
    4949    document.getElementById('qualityScore.'+i).innerHTML = rna.rqs || rna.rin;
    50     document.getElementById('comment.'+i).innerHTML = rna.comment;
     50    document.getElementById('comment.'+i).innerHTML = rna.comment || '';
    5151    document.getElementById('flag.'+i).innerHTML = rna.flag;
    5252    if (rna.flag == 'NotEnoughRemainingQuantity')
     
    8484    i++;
    8585  }
     86  window.close();
     87}
     88function unflagSelected()
     89{
     90  var frm = document.forms['flaggedRna'];
     91  var i = 0;
     92  while (frm['use.'+i])
     93  {
     94    if (frm['use.'+i].checked)
     95    {
     96      var rna = frm['use.'+i].rna;
     97      window.opener.Rna.unflag(window.opener.Rna.createByName(rna.name));
     98    }
     99    i++;
     100  }
     101  window.opener.updateNumFlaggedRna();
    86102  window.close();
    87103}
     
    122138        %>
    123139        <tbl:row>
    124           <td style="text-align: center; width: 20px;"><input type="checkbox" name="use.<%=i%>" <%=numSelected == 0 ? "disabled" : "" %>></td>
     140          <td style="text-align: center; width: 20px;"><input type="checkbox" name="use.<%=i%>"></td>
    125141          <tbl:cell column="rna" id="<%="rna."+i%>"><%=i%></tbl:cell>
    126142          <tbl:cell column="location" id="<%="location."+i%>"></tbl:cell>
     
    140156  <base:buttongroup subclass="dialogbuttons" id="dialogbuttons">
    141157    <base:button onclick="useSelected()" title="Use selected"
    142       visible="<%=numSelected > 0%>" tooltip="Use the RNA and ignore the flag"
     158      disabled="<%=numSelected == 0%>" tooltip="Use the RNA and ignore the flag"
    143159      image="<%=home + "/images/manual_rna.png"%>" />
     160    <base:button onclick="unflagSelected()" title="Unflag"
     161      image="<%=home+"/images/unflag.png"%>" tooltip="Do not flag the selected RNA" />
    144162    <base:button onclick="window.close()" title="Close" />
    145163  </base:buttongroup>
Note: See TracChangeset for help on using the changeset viewer.