Changeset 2228


Ignore:
Timestamp:
Feb 14, 2014, 1:47:52 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #546: Confirm sequencing as completed

New version of the 'confirm sequencing' wizard. Introduced a new annotation SequencingConfirmed (boolean) to fix the issue with sequencing runs not showing up for confirmation if FirstBaseReportFailed was set in the 'sequencing ended' wizard.

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

Legend:

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

    r2226 r2228  
    8888{
    8989  var frm = document.forms['reggie'];
    90   if (document.getElementById('outcomeFailed').checked && !frm.verifyFailure.checked) return false;
     90  if (!document.getElementById('outcomeSuccess').checked && !frm.verifyFailure.checked) return false;
    9191
    9292  return true;
     
    128128  setInnerHTML('startDate', formatDate(seqRun.SequencingStart));
    129129  setInnerHTML('endDate', formatDate(seqRun.SequencingEnd));
     130 
     131  Forms.checkRadio(frm.outcome, seqRun.SequencingResult || 'Successful');
    130132 
    131133  var html = '';
     
    169171 
    170172  var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun;
    171   var failed = document.getElementById('outcomeFailed').checked;
     173  var outcome = Forms.getCheckedRadio(frm, 'outcome').value;
    172174 
    173175  frm.sequencingComments.value = seqRun.comments;
     
    175177
    176178  var fc = seqRun.flowCell;
    177   if (failed)
     179  if (outcome != 'Successful')
    178180  {
    179181    setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure');
     
    190192    }
    191193    setInnerHTML('failedLanes', html);
     194    Main.show('failedLanesRow');
    192195  }
    193196}
     
    214217 
    215218  var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun;
    216   var failed = document.getElementById('outcomeFailed').checked;
     219  var outcome = Forms.getCheckedRadio(frm, 'outcome').value;
    217220  var submitInfo = {};
    218221
    219222  seqRun.comments = frm.sequencingComments.value;
    220   submitInfo.failed = failed;
     223  seqRun.SequencingResult = outcome;
    221224  submitInfo.sequencingRun = seqRun;
    222225   
    223   if (!failed)
     226  if (outcome == 'Successful')
    224227  {
    225228    var fc = seqRun.flowCell;
     
    352355        <td class="prompt">Outcome</td>
    353356        <td class="input">
    354           <input type="radio" name="outcome" id="outcomeSuccess"
    355             checked><label for="outcomeSuccess">Success</label> - continue with demux<br>
    356           <input type="radio" name="outcome" id="outcomeFailed"
    357             ><label for="outcomeFailed">Failure</label> - no further analysis
     357          <label><input type="radio" name="outcome" id="outcomeSuccess" value="Successful"
     358            checked>Success</label> - continue with demux<br>
     359          <label><input type="radio" name="outcome" id="outcomeFirstBaseReportFailed" value="FirstBaseReportFailed"
     360            >FirstBaseReportFailed</label> - re-start sequencing<br>
     361          <label><input type="radio" name="outcome" id="outcomeFailed" value="Failed"
     362            >Failure</label> - flag pools for re-clustering
    358363        </td>
    359364        <td class="status"></td>
    360365        <td class="help">
     366          Select <b>FirstBaseReportFailed</b> if sequencing can be re-started with the
     367          same flow cell. This is registered as a new sequencing run and no further analysis
     368          is made from this run.<br>
    361369          Select the <b>Failure</b> option if further analysis of the data is not possible.
    362370          No child bioassay set will be created and existing pooled libraries will
    363           be flagged for re-sequencing.
     371          be flagged for re-clustering on a new flow cell.
    364372        </td>
    365373      </tr>
     
    390398      <tr valign="top">
    391399        <td class="prompt">Comments</td>
    392         <td class="input"><textarea rows="4" cols="50" style="width: 90%;" name="sequencingComments" value=""></textarea></td>
     400        <td class="input"><textarea rows="6" cols="50" style="width: 95%;" name="sequencingComments" value=""></textarea></td>
    393401        <td class="status" id="sequencingComments.status"></td>
    394402        <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing.</td>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/sequencing_ended.jsp

    r2225 r2228  
    178178  if (turnAroundDate == '')
    179179  {
    180     setInputStatus('turnAroundDate', 'Missing date', 'warning');
     180    if (document.getElementById('firstBaseReportOk').checked)
     181    {
     182      setInputStatus('turnAroundDate', 'Missing date', 'warning');
     183    }
    181184    turnAroundDateIsValid = true;
    182185    return;
     
    260263  }
    261264
    262  
    263265  if (turnAroundDateIsValid)
    264266  {
     
    266268    var endTimestamp = Dates.parseString(frm.endDate.value + ' ' + frm.endTime.value, 'yyyyMMdd Hmm');
    267269   
    268     if (turnAroundTimestamp.getTime() >= endTimestamp.getTime())
     270    if (turnAroundTimestamp != null && turnAroundTimestamp.getTime() >= endTimestamp.getTime())
    269271    {
    270272      setInputStatus('endDate', 'End date must be after turnaround date', 'invalid');
     
    433435        <td class="prompt">First base report</td>
    434436        <td class="input">
    435           <label><input type="radio" name="firstBaseReport" id="firstBaseReportOk" value="1" checked>Ok</label>
    436           <label><input type="radio" name="firstBaseReport" id="firstBaseReportFailed" value="0">Failed</label>
     437          <label><input type="radio" name="firstBaseReport" id="firstBaseReportOk" value="1" checked
     438            onclick="turnAroundDateTimeOnChange()">Ok</label>
     439          <label><input type="radio" name="firstBaseReport" id="firstBaseReportFailed" value="0"
     440            onclick="turnAroundDateTimeOnChange()">Failed</label>
    437441        </td>
    438442        <td class="status" id="firstBaseReport.status"></td>
     
    465469      <tr valign="top">
    466470        <td class="prompt">Comments</td>
    467         <td class="input"><textarea rows="4" cols="50" style="width: 90%;" name="sequencingComments" value=""></textarea></td>
     471        <td class="input"><textarea rows="6" cols="50" style="width: 95%;" name="sequencingComments" value=""></textarea></td>
    468472        <td class="status" id="sequencingComments.status"></td>
    469473        <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing.</td>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java

    r2226 r2228  
    752752
    753753  /**
     754    The "SequencingConfirmed" annotation, used for derived bioassays (SequencingRun).
     755    Store a flag indicating that the sequencing result has been confirmed by a
     756    user with {@link RegggieRole#SECONDARY_ANALYSIS} role.
     757    @since 2.15
     758  */
     759  public static final Annotationtype SEQUENCING_CONFIRMED =
     760    new Annotationtype("SequencingConfirmed", Type.BOOLEAN, Item.DERIVEDBIOASSAY);
     761
     762  /**
    754763    Get the annotation type by name of the static constant defined in this class.
    755764   
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r2226 r2228  
    345345            new ValueOptions(SequencingRun.SEQUENCING_SUCCESSFUL, SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED, SequencingRun.SEQUENCING_FAILED),
    346346            effectivePermissionsUse, createIfMissing));
     347        jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCING_CONFIRMED, 1, null, effectivePermissionsUse, createIfMissing));
    347348       
    348349        // Annotation type categories
     
    435436            Annotationtype.SEQUENCING_START, Annotationtype.SEQUENCING_TURN_AROUND, Annotationtype.SEQUENCING_END,
    436437            Annotationtype.SEQUENCING_OPERATOR, Annotationtype.SEQUENCING_RUN_NUMBER, Annotationtype.SEQUENCING_CYCLES,
    437             Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER, Annotationtype.SEQUENCING_RESULT
     438            Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER, Annotationtype.SEQUENCING_RESULT,
     439            Annotationtype.SEQUENCING_CONFIRMED
    438440          ));
    439441       
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SequencingRunServlet.java

    r2226 r2228  
    2727import net.sf.basedb.core.SessionControl;
    2828import net.sf.basedb.core.query.Annotations;
     29import net.sf.basedb.core.query.Expressions;
    2930import net.sf.basedb.core.query.Hql;
    3031import net.sf.basedb.core.query.Restrictions;
     
    124125        query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse"));
    125126        query.restrict(Restrictions.neq(Hql.alias("sse"), null));
    126         // Must NOT have a SEQUENCING_RESULT annotation
    127         query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_RESULT.load(dc), "ssr"));
    128         query.restrict(Restrictions.eq(Hql.alias("ssr"), null));
     127        // Must have SEQUENCING_CONFIRMED=FALSE|NULL annotation
     128        query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_CONFIRMED.load(dc), "scf"));
     129        query.restrict(
     130          Restrictions.or(
     131            Restrictions.eq(Hql.alias("scf"), Expressions.bool(false)),
     132            Restrictions.eq(Hql.alias("scf"), null)
     133          ));
    129134        long count = query.count(dc);
    130135        json.put("count", count);
     
    139144        query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse"));
    140145        query.restrict(Restrictions.neq(Hql.alias("sse"), null));
    141         // Must NOT have a SEQUENCING_RESULT annotation
    142         query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_RESULT.load(dc), "ssr"));
    143         query.restrict(Restrictions.eq(Hql.alias("ssr"), null));
     146        // Must have SEQUENCING_CONFIRMED=FALSE|NULL annotation
     147        query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_CONFIRMED.load(dc), "scf"));
     148        query.restrict(
     149            Restrictions.or(
     150              Restrictions.eq(Hql.alias("scf"), Expressions.bool(false)),
     151              Restrictions.eq(Hql.alias("scf"), null)
     152            ));
    144153       
    145154        JSONArray jsonRuns = new JSONArray();
     
    151160          run.loadAnnotations(dc, "SequencingEnd", Annotationtype.SEQUENCING_END, Reggie.CONVERTER_DATETIME_TO_STRING);
    152161          run.loadAnnotations(dc, "HiSeqPosition", Annotationtype.HISEQ_POSITION, null);
     162          run.loadAnnotations(dc, "SequencingResult", Annotationtype.SEQUENCING_RESULT, null);
    153163          run.setAnnotation("comments", run.getDerivedBioAssay().getDescription());
    154164         
     
    283293        Annotationtype.SEQUENCING_TURN_AROUND.setAnnotationValue(dc, seqRun, turnAroundDate);
    284294        Annotationtype.SEQUENCING_END.setAnnotationValue(dc, seqRun, endDate);
     295        Annotationtype.SEQUENCING_CONFIRMED.setAnnotationValue(dc, seqRun, false);
    285296        seqRun.setDescription((String)jsonSeq.get("comments"));
    286297       
     
    308319        JSONObject jsonSeq = (JSONObject)jsonReq.get("sequencingRun");
    309320        JSONObject jsonFlowCell = (JSONObject)jsonSeq.get("flowCell");
    310         boolean failed = Boolean.TRUE.equals(jsonReq.get("failed"));
    311 
     321       
    312322        Number seqId = (Number)jsonSeq.get("id");
    313323        DerivedBioAssay seqRun = DerivedBioAssay.getById(dc, seqId.intValue());
    314324        seqRun.setDescription((String)jsonSeq.get("comments"));
    315        
    316         BioMaterialList flaggedPools = null;
    317         Set<Extract> pools = null;
    318         int numFlagged = 0;
    319         if (failed)
    320         {
     325        Annotationtype.SEQUENCING_CONFIRMED.setAnnotationValue(dc, seqRun, true);
     326        String outcome = (String)jsonSeq.get("SequencingResult");
     327
     328        Number fcId = (Number)jsonFlowCell.get("id");
     329        PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue());
     330
     331        if (SequencingRun.SEQUENCING_FAILED.equals(outcome))
     332        {
     333          BioMaterialList flaggedPools = null;
     334          Set<Extract> pools = null;
     335          int numFlagged = 0;
     336         
     337          // Flag pools for re-clustering
    321338          flaggedPools = BiomaterialList.FLAGGED_POOL.load(dc);
    322339          pools = new HashSet<Extract>();
    323         }
    324        
    325         Number fcId = (Number)jsonFlowCell.get("id");
    326         PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue());
    327          
    328         if (failed)
    329         {
     340
    330341          // Load pool aliquots and pools for all lanes
    331342          ItemQuery<Extract> aliquotQuery = flowCell.getExtracts(0);
     
    348359            }
    349360          }
    350         }
    351         else
     361         
     362          if (numFlagged > 0)
     363          {
     364            jsonMessages.add("Added " + numFlagged + " pools to '" + flaggedPools.getName() + "' list.");
     365          }
     366
     367        }
     368        else if (SequencingRun.SEQUENCING_SUCCESSFUL.equals(outcome))
    352369        {
    353370          JSONArray jsonFailedLanes = (JSONArray)jsonFlowCell.get("failedLanes");
     
    365382              lanes = "Lanes " + Values.getString(jsonFailedLanes.subList(0, jsonFailedLanes.size()-1), ", ", true) + " and " + lastLane;
    366383            }
    367 
    368384            jsonMessages.add(lanes + " registered as failed.");
    369385          }
    370386        }
    371387       
    372         if (failed)
    373         {
    374           Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_FAILED);
    375           jsonMessages.add(seqRun.getName() + " confirmed as failed.");
    376         }
    377         else
    378         {
    379           Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_SUCCESSFUL);
    380           jsonMessages.add(seqRun.getName() + " confirmed as successful.");
    381         }
    382        
    383         if (numFlagged > 0)
    384         {
    385           jsonMessages.add("Added " + numFlagged + " pools to '" + flaggedPools.getName() + "' list.");
    386         }
     388        Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, outcome);
     389        Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, flowCell, outcome);
     390        jsonMessages.add(seqRun.getName() + " confirmed with status: " + outcome);
    387391
    388392        dc.commit();
Note: See TracChangeset for help on using the changeset viewer.