Changeset 2049


Ignore:
Timestamp:
Oct 7, 2013, 3:38:52 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #481: Register prepared flow cells

The wizard now creates a SequencingRunNNNN (derived bioassay) item and link the flow cells to it. The SequencingStartDate and SequencingOperator are added as annotation to the derived bioassay.

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

Legend:

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

    r2033 r2049  
    295295      var msg = error || 'Number of flow cells waiting for registration';
    296296      var count = error ? -1 : response.count;
    297       setCount('count.flow-cells.0', count, 'flow cells', msg);
    298       setCount('count.flow-cells', count, 'flow cells', msg);
     297      setCount('count.flow-cells.1', count, 'flow cells', msg);
     298      setCount('count.flow-cells.2', count, 'flow cells', msg);
    299299    }
    300300   
     
    505505            <li><a href="libprep/pool_registration.jsp?ID=<%=ID%>">Register pooled libraries</a> <span class="counter" id="count.pools.2" title="Counting..."><img src="images/loading-small.gif"></span>
    506506            <li><a href="libprep/create_flowcells.jsp?ID=<%=ID%>">Create flow cells</a> <span class="counter" id="count.pools.3" title="Counting..."><img src="images/loading-small.gif"></span>
    507             <li><a href="libprep/flowcell_protocol.jsp?ID=<%=ID%>">Lab protocols for clustering</a> <span class="counter" id="count.flow-cells.0" title="Counting..."><img src="images/loading-small.gif"></span>
    508             <li><a href="libprep/flowcell_registration.jsp?ID=<%=ID%>">Register flow cells</a> <span class="counter" id="count.flow-cells" title="Counting..."><img src="images/loading-small.gif"></span>
     507            <li><a href="libprep/flowcell_protocol.jsp?ID=<%=ID%>">Lab protocols for clustering &amp; sequence start</a> <span class="counter" id="count.flow-cells.1" title="Counting..."><img src="images/loading-small.gif"></span>
     508            <li><a href="libprep/flowcell_registration.jsp?ID=<%=ID%>">Register sequence start of flow cells</a> <span class="counter" id="count.flow-cells.2" title="Counting..."><img src="images/loading-small.gif"></span>
    509509            </ul>
    510510          </dd>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp

    r2031 r2049  
    226226  if (date == '')
    227227  {
    228     setInputStatus(dateField, 'Missing date', 'warning');
     228    var required = frm[dateField].className.indexOf('required') != -1;
     229    setInputStatus(dateField, 'Missing date', required ? 'invalid' : 'warning');
     230    if (required) dateIsValid[dateField] = false;
    229231    return;
    230232  }
     
    320322 
    321323  if (dateIsValid['clusterDate'] == false) return false;
    322   if (dateIsValid['sequenceStartDate'] == false) return false;
     324  if (dateIsValid['sequencingStartDate'] != true)
     325  {
     326    dateOnChange('sequencingStartDate');
     327    return false;
     328  }
    323329 
    324330  var frm = document.forms['reggie'];
     
    348354  frm.clusterDate.disabled = true;
    349355  frm.clusterOperator.disabled = true;
    350   frm.sequenceStartDate.disabled = true;
    351   frm.sequenceOperator.disabled = true;
     356  frm.sequencingStartDate.disabled = true;
     357  frm.sequencingOperator.disabled = true;
    352358  frm.clusterProtocol.disabled = true;
    353359  frm.comments.disabled = true;
     
    370376  submitInfo.clusterDate = frm.clusterDate.value;
    371377  submitInfo.clusterOperator = frm.clusterOperator.value;
    372   submitInfo.sequenceStartDate = frm.sequenceStartDate.value;
    373   submitInfo.sequenceOperator = frm.sequenceOperator.value;
     378  submitInfo.sequencingStartDate = frm.sequencingStartDate.value;
     379  submitInfo.sequencingOperator = frm.sequencingOperator.value;
    374380  submitInfo.comments = frm.comments.value;
    375381 
     
    524530        <td>
    525531          <input type="text" name="clusterOperator" value="<%=HTML.encodeTags(user.getName()) %>"
    526             style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'sequenceStartDate')">
     532            style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'sequencingStartDate')">
    527533        </td>
    528534        <td class="status" id="clusterDate.status"></td>
    529535      </tr>
    530536      <tr>
    531         <td class="subprompt">Sequence start</td>
     537        <td class="subprompt">Sequencing start</td>
    532538        <td>
    533           <input type="text" name="sequenceStartDate" maxlength="10" style="width: 8em;"
    534             onblur="dateOnChange('sequenceStartDate')" onkeypress="focusOnEnter(event, 'sequenceOperator')">
     539          <input type="text" class="required" name="sequencingStartDate" maxlength="10" style="width: 8em;"
     540            onblur="dateOnChange('sequencingStartDate')" onkeypress="focusOnEnter(event, 'sequencingOperator')">
    535541            <base:icon
    536               onclick="Dates.selectDate('Sequence start date', 'reggie', 'sequenceStartDate', 'setDate', 'yyyyMMdd')"
     542              onclick="Dates.selectDate('Sequence start date', 'reggie', 'sequencingStartDate', 'setDate', 'yyyyMMdd')"
    537543              image="calendar.png"
    538544              tooltip="Select a date from a calendar"
     
    541547        </td>
    542548        <td>
    543           <input type="text" name="sequenceOperator" value="<%=HTML.encodeTags(user.getName()) %>"
     549          <input type="text" name="sequencingOperator" value="<%=HTML.encodeTags(user.getName()) %>"
    544550            style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'clusterProtocol')">
    545551        </td>
    546         <td class="status" id="sequenceStartDate.status"></td>
     552        <td class="status" id="sequencingStartDate.status"></td>
    547553      </tr>
    548554      <tr valign="top">
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java

    r2041 r2049  
    563563   
    564564  /**
     565    The "SequencingStart" annotation, used for derived bioassays (SequencingRun).
     566    @since 2.13
     567  */
     568  public static final Annotationtype SEQUENCING_START =
     569    new Annotationtype("SequencingStart", Type.DATE, Item.DERIVEDBIOASSAY);
     570
     571  /**
     572    The "SequencingOperator" annotation, used for derived bioassays (SequencingRun).
     573    @since 2.13
     574  */
     575  public static final Annotationtype SEQUENCING_OPERATOR =
     576    new Annotationtype("SequencingOperator", Type.STRING, Item.DERIVEDBIOASSAY);
     577
     578 
     579  /**
    565580    Get the annotation type by name of the static constant defined in this class.
    566581   
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Subtype.java

    r2020 r2049  
    182182  public static final Subtype FLOW_CELL = new Subtype("FlowCell", Item.PHYSICALBIOASSAY, false);
    183183 
     184 
     185  /**
     186    The definition of the "SequencingRun" derived bioassay subtype.
     187    @since 2.12
     188  */
     189  public static final Subtype SEQUENCING_RUN = new Subtype("SequencingRun", Item.DERIVEDBIOASSAY, false);
     190 
    184191  /**
    185192    The definition of the "mRNA preparation" protocol subtype.
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2045 r2049  
    2121import net.sf.basedb.core.BioMaterialEventSource;
    2222import net.sf.basedb.core.DbControl;
     23import net.sf.basedb.core.DerivedBioAssay;
    2324import net.sf.basedb.core.Extract;
    2425import net.sf.basedb.core.ItemQuery;
     
    3839import net.sf.basedb.reggie.dao.PooledLibrary;
    3940import net.sf.basedb.reggie.dao.ReactionPlate;
     41import net.sf.basedb.reggie.dao.SequencingRun;
    4042import net.sf.basedb.reggie.dao.Subtype;
    4143import net.sf.basedb.util.Values;
     
    326328        JSONArray jsonFlowCells = (JSONArray)jsonReq.get("flowCells");
    327329       
     330        DerivedBioAssay sequenceRun = null;
     331        if (!failed)
     332        {
     333          sequenceRun = DerivedBioAssay.getNew(dc, true, null);
     334          sequenceRun.setName(SequencingRun.generateNamesForBatch(dc, 1, 1).get(0));
     335          sequenceRun.setDescription(comment);
     336          dc.saveItem(sequenceRun);
     337
     338          Date seqStartDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("sequencingStartDate"));
     339         
     340          Annotationtype.SEQUENCING_START.setAnnotationValue(dc, sequenceRun, seqStartDate);
     341          Annotationtype.SEQUENCING_OPERATOR.setAnnotationValue(dc, sequenceRun, Values.getStringOrNull((String)jsonReq.get("sequencingOperator")));
     342         
     343          jsonMessages.add("Created '" + sequenceRun.getName()+"'.");
     344        }
     345       
    328346        for (int fcNo = 0; fcNo < jsonFlowCells.size(); ++fcNo)
    329347        {
     
    332350         
    333351          PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue());
    334          
    335352          BioMaterialEvent createEvent = flowCell.getCreationEvent();
    336353          createEvent.setEventDate(clusterDate);
    337354          createEvent.setProtocol(clusterProtocol);
    338355          createEvent.setComment(comment);
    339          
    340           flowCell.setDescription(comment);
     356
     357          if (sequenceRun != null)
     358          {
     359            sequenceRun.addPhysicalBioAssay(flowCell);
     360          }
     361         
     362          //flowCell.setDescription(comment);
    341363          Annotationtype.OPERATOR.setAnnotationValue(dc, flowCell, operator);
    342364          Annotationtype.READ_STRING.setAnnotationValue(dc, flowCell, jsonFlowCell.get("ReadString"));
     
    354376          {
    355377            Annotationtype.PLATE_PROCESS_RESULT.setAnnotationValue(dc, flowCell, ReactionPlate.PROCESS_SUCCESSFUL);
    356             jsonMessages.add("Flow cell '" + flowCell.getName() + "' registered as completed.");
    357            
    358             // TODO - Create DerivedBioAssay SequenceRun000N and add selected flow cells to it??
    359             // Should the SEQUENCE_START_DATE be added to this instead of the flow cells??
     378            jsonMessages.add("Sequencing started for flow cell '" + flowCell.getName() + "'.");
    360379           
    361380          }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r2041 r2049  
    167167        jsonChecks.add(checkSubtype(dc, Subtype.CALIPER_WELL_TABLE, createIfMissing));
    168168        jsonChecks.add(checkSubtype(dc, Subtype.QUBIT_CSV, createIfMissing));
     169        jsonChecks.add(checkSubtype(dc, Subtype.SEQUENCING_RUN, createIfMissing, Subtype.FLOW_CELL));
    169170
    170171        // Plate geometries
     
    284285        jsonChecks.add(checkAnnotationType(dc, Annotationtype.READ_STRING, 1, null, effectiveOptions, createIfMissing));
    285286       
     287        jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCING_START, 1, null, effectiveOptions, createIfMissing));
     288        jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCING_OPERATOR, 1, null, effectiveOptions, createIfMissing));
     289       
    286290        // Annotation type categories
    287291        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.PATIENT, createIfMissing,
     
    361365            Annotationtype.FLOWCELL_ID, Annotationtype.READ_STRING, Annotationtype.OPERATOR,
    362366            Annotationtype.PLATE_PROCESS_RESULT));
     367       
     368        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.SEQUENCING_RUN, createIfMissing,
     369            Annotationtype.SEQUENCING_START, Annotationtype.SEQUENCING_OPERATOR
     370          ));
    363371       
    364372        // Plugin definitions and configurations
Note: See TracChangeset for help on using the changeset viewer.