Changeset 1939


Ignore:
Timestamp:
Apr 18, 2013, 10:25:10 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Added RQS/RIN values to the display. A warning is displayed for scores below 8. This is currently hard-coded, but will be user selectable in the future.

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

Legend:

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

    r1938 r1939  
    3636
    3737<script language="JavaScript">
    38 var debug = false;
     38var debug = true;
    3939
    4040var QUANTITY_REGULAR = 1.1;
    4141var QUANTITY_QC = 1.22;
    4242var LOW_QUANTITY_WARNING_FACTOR = 1.5;
     43var QUALITY_SCORE_WARNING_LIMIT = 8;
    4344
    4445var Rna = function()
     
    219220          if (!warningMsg) warningMsg = 'No quantity';
    220221        }
     222        if (info.rqs)
     223        {
     224          text += '<div class="quality-score">RQS='+Numbers.formatNumber(info.rqs, 1) + '</div>';
     225          if (info.rqs < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RQS value';
     226        }
     227        else if (info.rin)
     228        {
     229          text += '<div class="quality-score">RIN='+Numbers.formatNumber(info.rin, 1) + '</div>';
     230          if (info.rin < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RIN value';
     231        }
     232        else
     233        {
     234          if (!warningMsg) warningMsg = 'No RQS/RIN value';
     235        }
    221236        if (info.NDConc)
    222237        {
     
    13821397}
    13831398.plate.hide-ndconc .ndconc
     1399{
     1400  display: none;
     1401}
     1402.plate.hide-quality-score .quality-score
    13841403{
    13851404  display: none;
     
    15731592        <td class="input">
    15741593          <table>
    1575           <tr>
     1594          <tr valign="top">
    15761595            <td>
    15771596              <input type="checkbox" name="location" id="location" onclick="toggleInfo('location')" checked><label for="location">Bioplate location</label><br>
     
    15791598            </td>
    15801599            <td>
     1600              <input type="checkbox" name="quality-score" id="quality-score" onclick="toggleInfo('quality-score')"><label for="quality-score">RQS/RIN</label><br>
    15811601              <input type="checkbox" name="ndconc" id="ndconc" onclick="toggleInfo('ndconc')"><label for="ndconc">NDConc</label><br>
    15821602              <input type="checkbox" name="volumes" id="volumes" onclick="toggleInfo('volumes')"><label for="volumes">Used volume+water</label><br>
     
    16751695        </div>
    16761696
    1677         <table class="plate hide-volumes hide-ndconc" style="margin: 1em 1em 0 1em;" id="plate"
     1697        <table class="plate hide-volumes hide-ndconc hide-quality-score" style="margin: 1em 1em 0 1em;" id="plate"
    16781698          onmouseup="contextEvent(event)"
    16791699          oncontextmenu="contextEvent(event)"
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Rna.java

    r1938 r1939  
    33import java.util.ArrayList;
    44import java.util.Collection;
     5import java.util.Date;
    56import java.util.List;
    67
    78import org.json.simple.JSONObject;
    89
     10import net.sf.basedb.core.BioPlate;
     11import net.sf.basedb.core.BioWell;
    912import net.sf.basedb.core.DbControl;
    1013import net.sf.basedb.core.Extract;
     
    260263  }
    261264 
     265 
     266  /**
     267    Find the last RNAQC child item that contains either a BA_RIN or CA_RQS value.
     268    @return The RNAQC item
     269  */
     270  public Extract findLastRnaQc(DbControl dc)
     271  {
     272    Extract rna = getExtract();
     273    Extract lastQc = null;
     274   
     275    // Fetch all child RNAQC items
     276    ItemQuery<Extract> rnaqcQuery = rna.getChildExtracts();
     277    Subtype.RNAQC.addFilter(dc, rnaqcQuery);
     278    rnaqcQuery.include(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     279    List<Extract> rnaqc = rnaqcQuery.list(dc);
     280   
     281    if (rnaqc.size() > 0)
     282    {
     283      lastQc = rnaqc.get(0);
     284      Date lastQcDate = null;
     285      // Try to find the last QC run on either Caliper or BioAnalyzer
     286      // This should be stored in QC_RUN_DATE annotation on the BioPlate
     287      // If no bioplate is associated with the RNA QC item, use the
     288      // creation date
     289     
     290      for (Extract qc : rnaqc)
     291      {
     292        Float rqs = (Float)Annotationtype.CA_RQS.getAnnotationValue(dc, qc);
     293        Float rin = (Float)Annotationtype.BA_RIN.getAnnotationValue(dc, qc);
     294        // Skip RNAQC items without any quality score since it may
     295        // be a new NanoDrop measurement
     296        if (rqs == null && rin == null) continue;
     297       
     298        BioPlate plate = null;
     299        BioWell well = qc.getBioWell();
     300        Date qcDate = null;
     301        if (well != null)
     302        {
     303          plate = well.getPlate();
     304          qcDate = (Date)Annotationtype.QC_RUN_DATE.getAnnotationValue(dc, plate);
     305        }
     306        if (qcDate == null)
     307        {
     308          qcDate = qc.getCreationEvent().getEventDate();
     309        }
     310        if ((lastQcDate == null && qcDate != null) || (qcDate != null && qcDate.after(lastQcDate)))
     311        {
     312          lastQcDate = qcDate;
     313          lastQc = qc;
     314        }
     315      }
     316    }
     317    return lastQc;
     318  }
     319 
     320 
     321  public Extract loadRnaQc(DbControl dc)
     322  {
     323    Extract qc = findLastRnaQc(dc);
     324   
     325    Float rqs = (Float)Annotationtype.CA_RQS.getAnnotationValue(dc, qc);
     326    Float rin = (Float)Annotationtype.BA_RIN.getAnnotationValue(dc, qc);
     327   
     328    if (rqs != null) setAnnotation("rqs", rqs);
     329    if (rin != null) setAnnotation("rin", rin);
     330   
     331    return qc;
     332  }
     333 
    262334  /**
    263335    Load information about the plate and location the current RNA
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java

    r1938 r1939  
    212212            Rna r = Rna.get(rna);
    213213            r.loadBioPlateLocation();
     214            r.loadRnaQc(dc);
    214215            r.setAnnotation("remainingQuantity", remainingQuantity);
    215216            r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
     
    358359        {
    359360          r.loadBioPlateLocation();
     361          r.loadRnaQc(dc);
    360362          r.setAnnotation("remainingQuantity", r.getExtract().getRemainingQuantity());
    361363          r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
Note: See TracChangeset for help on using the changeset viewer.