Changeset 2143


Ignore:
Timestamp:
Nov 19, 2013, 9:16:07 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #524: Auto-select RNA wizard should be able to start from a specific date

Added a 'Start date' field to the 'auto select' dialog. If empty the RNA is selected as before, eg. by position in the storage boxes. If a date is specified, the QiaCubeDate is used as a filter so that only RNA items extracted at or after the specified date are selected. The order is still by storage box location.

Added display field for QiaCubeDate (off by default) to the main plate view.

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

Legend:

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

    r1945 r2143  
    3636  var frm = document.forms['options'];
    3737 
     38  var startDate = frm.startDate.value;
     39  if (startDate && !Dates.isDate(startDate, 'yyyyMMdd'))
     40  {
     41    frm.startDate.focus();
     42    alert('Not a valid date: ' + startDate);
     43    return;
     44  }
     45 
    3846  var qRegular = parseFloat(frm.quantity_regular.value);
    3947  if (!(qRegular > 0))
     
    5260  }
    5361 
     62  if (startDate) options.startDate = startDate;
    5463  if (frm.remainingQuantity.checked) options.remainingQuantity = qRegular;
    5564  if (frm.qualityScore.checked) options.qualityScore = qualityScore;
     
    5968  {
    6069    showLoadingAnimation('Finding RNA. Please wait...');
    61     window.opener.autoSelect(options);
     70    var msg = window.opener.autoSelect(options);
     71    if (msg) alert(msg);
    6272    window.close();
    6373  }
     
    7888  }
    7989}
     90
     91function setStartDate(frmName, dateField, date)
     92{
     93  var frm = document.forms[frmName];
     94  frm[dateField].value = date;
     95  frm[dateField].focus();
     96}
     97
    8098</script>
    8199<style>
     
    95113 
    96114    <table class="fullform input100">
     115    <tr>
     116      <th>Start date</th>
     117      <td>
     118        <input type="text" name="startDate" value="" style="width: 12em;" maxlength="10"
     119          title="Enter start date in YYYYMMDD format">
     120          <base:icon
     121            onclick="Dates.selectDate('Start date', 'options', 'startDate', 'setStartDate', 'yyyyMMdd')"
     122            image="calendar.png"
     123            tooltip="Select a date from a calendar"
     124            tabindex="-1"
     125          /> (empty = start from oldest)
     126      </td>
     127    </tr>
    97128    <tr valign="top">
    98129      <th>Active filters</th>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/select_rna.jsp

    r1960 r2143  
    251251          warningMsg[warningMsg.length] = 'No NDConc value';
    252252        }
     253        if (info.QiaCubeDate)
     254        {
     255          text += '<div class="qiacube-date">'+info.QiaCubeDate+'</div>';
     256        }
     257        else
     258        {
     259          warningMsg[warningMsg.length] = 'No QiaCubeDate value';
     260        }
    253261      }
    254262      else if (!rna.id)
     
    903911    if (response.rna.length == 0)
    904912    {
    905       alert('Could not find any unprocessed RNA at this time.');
     913      return 'Could not find any unprocessed RNA at this time.';
    906914    }
    907915   
     
    15491557}
    15501558.plate.hide-quality-score .quality-score
     1559{
     1560  display: none;
     1561}
     1562.plate.hide-qiacube-date .qiacube-date
    15511563{
    15521564  display: none;
     
    18081820            <td>
    18091821              <input type="checkbox" name="volumes" id="volumes" onclick="toggleInfo('volumes')"><label for="volumes">Used volume+water</label><br>
     1822              <input type="checkbox" name="qiacube-date" id="qiacube-date" onclick="toggleInfo('qiacube-date')"><label for="qiacube-date">QiaCube date</label><br>
    18101823            </td>
    18111824          </tr>
     
    19111924        </div>
    19121925
    1913         <table class="plate hide-volumes hide-ndconc hide-quality-score" style="margin: 1em 1em 0 1em;" id="plate"
     1926        <table class="plate hide-volumes hide-ndconc hide-quality-score hide-qiacube-date" style="margin: 1em 1em 0 1em;" id="plate"
    19141927          onmouseup="contextEvent(event)"
    19151928          oncontextmenu="contextEvent(event)"
     
    19581971            {
    19591972              %>
    1960               <td id="well.<%=r%>.<%=c%>"
     1973              <td id="well.<%=r%>.<%=c%>" class="well empty primary"
    19611974                onclick="toggleWell(<%=r%>,<%=c%>)"
    19621975                onmouseenter="highlightReplicated(<%=r%>, <%=c%>, true)"
    19631976                onmouseleave="highlightReplicated(<%=r%>, <%=c%>, false)"
    1964                 title="Select/deselect this well"></td>
     1977                title="Select/deselect this well">empty</td>
    19651978              <%
    19661979            }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Rna.java

    r2134 r2143  
    305305    if (rnaqc.size() > 0)
    306306    {
    307       lastQc = rnaqc.get(0);
    308307      Date lastQcDate = null;
    309308      // Try to find the last QC run on either Caliper or BioAnalyzer
     
    323322        BioWell well = qc.getBioWell();
    324323        Date qcDate = null;
     324        // Try to get QC date from RNAQC reaction plate
    325325        if (well != null)
    326326        {
     
    328328          qcDate = (Date)Annotationtype.QC_RUN_DATE.getAnnotationValue(dc, plate);
    329329        }
     330        // If not found, get creation date from extract
    330331        if (qcDate == null)
    331332        {
    332333          qcDate = qc.getCreationEvent().getEventDate();
    333334        }
    334         if ((lastQcDate == null && qcDate != null) || (qcDate != null && qcDate.after(lastQcDate)))
     335       
     336        // Use the current RNAQC if this is the first found or if the date is after
     337        if (lastQc == null || lastQcDate != null && qcDate != null && qcDate.after(lastQcDate))
    335338        {
    336339          lastQcDate = qcDate;
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java

    r1999 r2143  
    301301          r.setAnnotation("remainingQuantity", r.getExtract().getRemainingQuantity());
    302302          r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
     303          r.loadAnnotations(dc, "QiaCubeDate", Annotationtype.QIACUBE_DATE, Reggie.CONVERTER_DATE_TO_STRING);
    303304          r.setAnnotation("comment", r.getExtract().getDescription());
    304305          jsonRna.add(r.asJSONObject());
     
    316317        JSONArray jsonIgnore = (JSONArray)jsonReq.get("ignore");
    317318       
     319        Date startDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("startDate"));
    318320        Float remainingQuantityLimit = JsonUtil.getAsFloat(jsonReq, "remainingQuantity");
    319321        Float qualityScoreLimit = JsonUtil.getAsFloat(jsonReq, "qualityScore");
     
    331333        }
    332334       
    333         // Filter for non-empty creation date
     335        // Filter for non-empty creation date or creation date after startdate
    334336        query.join(Hql.innerJoin("creationEvent", "ce"));
    335         query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null));
     337        if (startDate == null)
     338        {
     339          query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null));
     340        }
     341        else
     342        {
     343          query.restrict(Restrictions.gteq(Hql.property("ce", "eventDate"), Expressions.parameter("startDate", startDate, Type.DATE)));
     344        }
     345       
    336346        // Filter on parent != null (to get rid of 'Stratagene'
    337347        query.restrict(Restrictions.neq(Hql.property("parent"), null));
     
    390400            r.loadBioPlateLocation();
    391401            Float qualityScore = r.loadRnaQc(dc);
     402            if (qualityScore == null) continue; // QC has not been measuered; ignore
     403           
    392404            r.setAnnotation("remainingQuantity", remainingQuantity);
    393405            r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
     406            r.loadAnnotations(dc, "QiaCubeDate", Annotationtype.QIACUBE_DATE, Reggie.CONVERTER_DATE_TO_STRING);
    394407           
    395408            if (reProcess)
     
    410423              if (okToProcess && qualityScoreLimit != null)
    411424              {
    412                 if (qualityScore == null || qualityScore < qualityScoreLimit)
     425                if (qualityScore < qualityScoreLimit)
    413426                {
    414427                  okToProcess = false;
Note: See TracChangeset for help on using the changeset viewer.