Changeset 2509


Ignore:
Timestamp:
Jun 16, 2014, 9:16:09 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Merge Reggie 2.15.3 to the trunk.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk

  • extensions/net.sf.basedb.reggie/trunk/resources/index.jsp

    r2420 r2509  
    275275          <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/mrna_protocol.jsp?ID=<%=ID%>"
    276276            >Lab protocols for mRNA and cDNA preparation</span>
    277             <span class="counter" id="count.mrna-plates.1"
     277            <span class="counter" id="count.mrna-plates"
    278278              data-servlet="MRna.servlet?cmd=CountUnprocessedPlates&plateType=MRNA"
    279279              title="Number of mRNA plates waiting for registration"><img src="images/loading-small.gif"></span>
    280280         
     281          <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/rna_dilution_registration.jsp?ID=<%=ID%>"
     282            >RNA dilution registration</span>
     283            <span class="counter" id="count.undiluted-mrna-plates"
     284              data-servlet="MRna.servlet?cmd=CountUndilutedMRNAPlates"
     285              title="Number of mRNA plates waiting for dilution"><img src="images/loading-small.gif"></span>
     286         
    281287          <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/mrna_registration.jsp?ID=<%=ID%>"
    282288            >mRNA registration and quality control results</span>
    283             <span class="counter" id="count.mrna-plates.2"
    284               data-copy-from="count.mrna-plates.1"
     289            <span class="counter" id="count.diluted-mrna-plates"
     290              data-servlet="MRna.servlet?cmd=CountDilutedMRNAPlates"
    285291              title="Number of mRNA plates waiting for registration"><img src="images/loading-small.gif"></span>
    286292         
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/create_flowcells.jsp

    r2412 r2509  
    3737
    3838var DEFAULT_READ_HISEQ = [55, 7, 54];
    39 var DEFAULT_READ_NEXTSEQ = [75, 7, 75];
     39var DEFAULT_READ_NEXTSEQ = [76, 6, 76];
    4040var VOLUME_TO_USE_FROM_POOL = 10.0; // µl
    4141
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/create_pools.jsp

    r2454 r2509  
    10181018  color: #999999 !important;
    10191019}
     1020
     1021.well.low-volume, .well.high-adapter
     1022{
     1023  background-image: url('../images/warning.png');
     1024  background-position: 98% 5%;
     1025  background-repeat: no-repeat;
     1026}
     1027
    10201028.well.flagged
    10211029{
     
    10251033}
    10261034
    1027 .well.low-volume, .well.high-adapter
    1028 {
    1029   background-image: url('../images/warning.png') !important;
    1030   background-position: 98% 5%;
    1031   background-repeat: no-repeat;
    1032 }
     1035
    10331036</style>
    10341037</base:head>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_protocol.jsp

    r1927 r2509  
    4242    {
    4343      var bioplate = bioplates[i];
    44       var option = new Option(bioplate.name, bioplate.id);
     44      var name = bioplate.name;
     45      if (bioplate.DilutionDate)
     46      {
     47        name += ' (diluted ' + formatDate(bioplate.DilutionDate) + ')';
     48      }
     49      var option = new Option(name, bioplate.id);
    4550      option.bioplate = bioplate;
    4651      plates.options[plates.length] = option;
     
    5661    setFatalError(msg);
    5762  }
     63}
     64
     65function formatDate(value)
     66{
     67  if (!value) return '';
     68  if (value.length == 8)
     69  {
     70    // YYYYMMDD
     71    value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2);
     72  }
     73  else if (value.length == 13)
     74  {
     75    // YYYYMMDD HHMM
     76    value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2) + ' ' + value.substr(9, 2) + ':' + value.substr(11, 2);
     77  }
     78  return value;
    5879}
    5980
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_protocol2.jsp

    r2216 r2509  
    9191    }
    9292   
     93    var plate = response.plate;
     94    if (plate.DilutionDate)
     95    {
     96      setInnerHTML('dilution-date', formatDate(plate.DilutionDate));
     97      setInnerHTML('dilution-operator', plate.DilutionOperator);
     98    }
     99   
    93100    var list = response.mrna;
    94101    // Find QUANTITY_REGULAR = lowest used value
     
    115122    }
    116123    %>
     124    Main.show('protocol');
     125  }
     126 
     127  function formatDate(value)
     128  {
     129    if (!value) return '';
     130    if (value.length == 8)
     131    {
     132      // YYYYMMDD
     133      value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2);
     134    }
     135    else if (value.length == 13)
     136    {
     137      // YYYYMMDD HHMM
     138      value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2) + ' ' + value.substr(9, 2) + ':' + value.substr(11, 2);
     139    }
     140    return value;
    117141  }
    118142 
     
    534558  <h1>Lab protocol for mRNA and cDNA preparation <span class="reggie">Reggie <%=reggie.getAbout().getVersion() %></span></h1>
    535559
     560  <div class="loading" id="loading" style="display: none;"><table><tr><td><img src="../images/loading.gif"></td><td id="loading.msg">Please wait...</td></tr></table></div>
     561  <div class="messagecontainer error" id="errorMessage" style="display: none;"></div>
     562
     563  <div id="protocol" style="display: none;">
    536564  <table style="width: 100%;" class="protocolheader">
    537565  <tr style="border-bottom: 1px solid #000000;">
     
    545573    <td rowspan="5" colspan="2" style="width: 50%; border-right: 1px solid #000000;"><%=HTML.niceFormat(plate.getDescription()) %></td>
    546574    <td style="border-right: 1px solid #000000;">Dilution</td>
    547     <td style="border-right: 1px solid #000000;"></td>
    548     <td></td>
     575    <td style="border-right: 1px solid #000000;" id="dilution-date"></td>
     576    <td id="dilution-operator"></td>
    549577  </tr>
    550578  <tr style="border-top: 1px solid #CCCCCC;">
     
    570598  </table>
    571599
    572   <div class="loading" id="loading" style="display: none;"><table><tr><td><img src="../images/loading.gif"></td><td id="loading.msg">Please wait...</td></tr></table></div>
    573   <div class="messagecontainer error" id="errorMessage" style="display: none;"></div>
    574600  <%
    575601  if (view.equals("list"))
     
    690716  <i>Low quantity = The remaining quantity is too low for the RNA to be re-processed one more time</i>
    691717  </div>
     718  </div>
    692719</body>
    693720</html>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_registration.jsp

    r2073 r2509  
    100100  {
    101101    showLoadingAnimation('Loading histology work lists...');
    102     var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA';   
     102    var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA&onlyDiluted=1';   
    103103    request.open("GET", url, false); 
    104104    request.send(null);
     
    153153  }
    154154 
    155   frm.dilutionDate.focus();
     155  frm.purificationDate.focus();
    156156}
    157157
     
    308308  if (!pdfIsValid || !commentsIsValid) return false;
    309309 
    310   if (dateIsValid['dilutionDate'] == false) return false;
    311310  if (dateIsValid['purificationDate'] == false) return false;
    312311  if (dateIsValid['fragmentationDate'] == false) return false;
     
    339338  frm['pdf.path'].disabled = true;
    340339  Main.addClass(document.getElementById('btnPdf'), 'disabled');
    341   frm.dilutionDate.disabled = true;
    342   frm.dilutionOperator.disabled = true;
    343340  frm.purificationDate.disabled = true;
    344341  frm.purificationOperator.disabled = true;
     
    355352  submitInfo.failed = document.getElementById('outcomeSuccess').checked ? false : true;
    356353  submitInfo.pdf = pdfId;
    357   submitInfo.dilutionDate = frm.dilutionDate.value;
    358   submitInfo.dilutionOperator = frm.dilutionOperator.value;
    359354  submitInfo.purificationDate = frm.purificationDate.value;
    360355  submitInfo.purificationOperator = frm.purificationOperator.value;
     
    457452        <td class="help"><span id="bioplate.message" class="message" style="display: none;"></span>
    458453          Select an existing mRNA bioplate. The list contain all mRNA bioplates that
    459           has not yet been processed (determined by the absence of a 'creation' date).
     454          has been diluted, but not yet registered as completed (determined by the absence of a
     455          'creation' date).
    460456        </td>
    461457      </tr>
     
    495491        <td><b>Operator</b></td>
    496492        <td class="status"></td>
    497         <td class="help" rowspan="5">
     493        <td class="help" rowspan="4">
    498494          <span id="mrnaDate.message" class="message" style="display: none;"></span>
    499495          Enter date and operator for each step in the mRNA preparation.
    500496          (YYYYMMDD or MMDD)
    501497        </td>
    502       </tr>
    503       <tr>
    504         <td class="subprompt">Dilution</td>
    505         <td>
    506           <input type="text" name="dilutionDate" maxlength="10" style="width: 8em;"
    507             onblur="dateOnChange('dilutionDate')" onkeypress="focusOnEnter(event, 'dilutionOperator')">
    508             <base:icon
    509               onclick="Dates.selectDate('Dilution date', 'reggie', 'dilutionDate', 'setDate', 'yyyyMMdd')"
    510               image="calendar.png"
    511               tooltip="Select a date from a calendar"
    512               tabindex="-1"
    513             />
    514         </td>
    515         <td>
    516           <input type="text" name="dilutionOperator" value="<%=HTML.encodeTags(user.getName()) %>"
    517             style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'purificationDate')">
    518         </td>
    519         <td class="status" id="dilutionDate.status"></td>
    520498      </tr>
    521499      <tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java

    r2161 r2509  
    123123        json.put("count", count);
    124124      }
     125      else if ("CountUndilutedMRNAPlates".equals(cmd))
     126      {
     127        dc = sc.newDbControl();
     128        BioplateType plateType = BioplateType.MRNA;
     129       
     130        // Find plates of the given 'plate type' without 'dilution date' and no 'destroyed' flag set
     131        ItemQuery<BioPlate> query = BioPlate.getQuery();
     132        query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     133        // Must not have a DILUTION_DATE annotation
     134        query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd"));
     135        query.restrict(Restrictions.eq(Hql.alias("dd"), null));
     136        plateType.addFilter(dc, query, true);
     137        query.setCacheResult(true);
     138        long count = query.count(dc);
     139        json.put("count", count);
     140      }
     141      else if ("CountDilutedMRNAPlates".equals(cmd))
     142      {
     143        dc = sc.newDbControl();
     144        BioplateType plateType = BioplateType.MRNA;
     145       
     146        // Find plates of the given 'plate type' with 'dilution date', but no 'create date' and no 'destroyed' flag set
     147        ItemQuery<BioPlate> query = BioPlate.getQuery();
     148        query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     149        // Must have a DILUTION_DATE annotation
     150        query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd"));
     151        query.restrict(Restrictions.neq(Hql.alias("dd"), null));
     152        query.restrict(Restrictions.eq(Hql.property("eventDate"), null));
     153        plateType.addFilter(dc, query, true);
     154        query.setCacheResult(true);
     155        long count = query.count(dc);
     156        json.put("count", count);
     157      }
    125158      else if ("GetUnprocessedPlates".equals(cmd))
    126159      {
     
    133166        query.restrict(Restrictions.eq(Hql.property("eventDate"), null));
    134167        plateType.addFilter(dc, query, true);
     168       
     169        if (req.getParameter("onlyDiluted") != null)
     170        {
     171          // Must have a DILUTION_DATE annotation
     172          query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd"));
     173          query.restrict(Restrictions.neq(Hql.alias("dd"), null));
     174        }
     175        else if (req.getParameter("onlyUndiluted") != null)
     176        {
     177          // Must NOT have a DILUTION_DATE annotation
     178          query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd"));
     179          query.restrict(Restrictions.eq(Hql.alias("dd"), null));
     180        }
     181       
    135182        query.order(Orders.desc(Hql.property("id")));
    136183       
     
    143190          jsonPlate.put("name", plate.getName());
    144191          jsonPlate.put("comments", plate.getDescription());
     192          if (plateType == BioplateType.MRNA)
     193          {
     194            jsonPlate.put("DilutionDate", Reggie.CONVERTER_DATE_TO_STRING.convert((Date)Annotationtype.DILUTION_DATE.getAnnotationValue(dc, plate)));
     195            jsonPlate.put("DilutionOperator", Annotationtype.DILUTION_OPERATOR.getAnnotationValue(dc, plate));
     196          }
    145197          jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, plate));
    146198          jsonPlates.add(jsonPlate);
     
    199251        BioPlate mRnaPlate = BioPlate.getById(dc, mRnaPlateId);
    200252
     253        JSONObject jsonPlate = new JSONObject();
     254        jsonPlate.put("id", mRnaPlate.getId());
     255        jsonPlate.put("name", mRnaPlate.getName());
     256        jsonPlate.put("comments", mRnaPlate.getDescription());
     257        jsonPlate.put("DilutionDate", Reggie.CONVERTER_DATE_TO_STRING.convert((Date)Annotationtype.DILUTION_DATE.getAnnotationValue(dc, mRnaPlate)));
     258        jsonPlate.put("DilutionOperator", Annotationtype.DILUTION_OPERATOR.getAnnotationValue(dc, mRnaPlate));
     259        jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, mRnaPlate));
     260       
    201261        ItemQuery<Extract> query = Extract.getQuery();
    202262        query.join(Hql.innerJoin(null, "bioWell", "bw", true));
     
    241301               
    242302        json.put("mrna", jsonMRna);
     303        json.put("plate", jsonPlate);
    243304      }
    244305
     
    556617        jsonMessages.add("Created " + mRnaPlate.getName() + " with " + jsonWells.size() + " mRNA child items");
    557618      }
     619      else if ("RegisterRNADilution".equals(cmd))
     620      {
     621        dc = sc.newDbControl();
     622
     623        ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR);
     624
     625        JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader());
     626       
     627        Number bioPlateId = (Number)jsonReq.get("bioplate");
     628
     629        // Load mRNA plate and the creation event
     630        ReactionPlate mrnaReactionPlate = ReactionPlate.getById(dc, bioPlateId.intValue(), BioplateType.MRNA);
     631        BioPlate mrnaPlate = mrnaReactionPlate.getBioPlate();
     632       
     633        // Dates and operators
     634        Annotationtype.DILUTION_DATE.setAnnotationValue(dc, mrnaPlate, Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("dilutionDate")));
     635        Annotationtype.DILUTION_OPERATOR.setAnnotationValue(dc, mrnaPlate, Values.getStringOrNull((String)jsonReq.get("dilutionOperator")));
     636   
     637        // Comment about the plate
     638        mrnaPlate.setDescription((String)jsonReq.get("comments"));
     639
     640        jsonMessages.add("RNA dilution for mRNA plate '" + mrnaPlate.getName() + "' registered successfully.");
     641       
     642        dc.commit();
     643      }
    558644     
    559645      else if ("ImportMRnaQCResults".equals(cmd))
     
    606692       
    607693        // Dates and operators
    608         Annotationtype.DILUTION_DATE.setAnnotationValue(dc, mrnaPlate, Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("dilutionDate")));
    609         Annotationtype.DILUTION_OPERATOR.setAnnotationValue(dc, mrnaPlate, Values.getStringOrNull((String)jsonReq.get("dilutionOperator")));
    610694        Annotationtype.PURIFICATION_DATE.setAnnotationValue(dc, mrnaPlate, Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("purificationDate")));
    611695        Annotationtype.PURIFICATION_OPERATOR.setAnnotationValue(dc, mrnaPlate, Values.getStringOrNull((String)jsonReq.get("purificationOperator")));
Note: See TracChangeset for help on using the changeset viewer.