Changeset 1551


Ignore:
Timestamp:
Mar 6, 2012, 3:21:58 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #364: Put RNA aliquots on bioplate to be used by the Caliper machine

Add option for 'HiSense?' to each aliquot. Use 'NDConc' value for automatic default checked/unchecked. Need to get information about the limiting value that should be used (currently hard-coded at 50ng/μl).

The wizard can now handle the case were no protocol can be found.

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

Legend:

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

    r1544 r1551  
    3838<script language="JavaScript">
    3939var debug = true;
     40var HiSense_Limit = 50;
    4041var currentStep = 1;
    4142var rnaQcBioPlates = null;
     
    6465  }
    6566  else
    66   {
    67     //rnaList.disabled = true;
    68     //Main.hide('gonext');   
    69     setInputStatus('rna','No RNA available for quality control', 'invalid')
     67  {
     68    setInputStatus('rna','No RNA available for quality control.', 'invalid')
    7069  }
    7170
     
    204203    frm.protocols[frm.protocols.length] = new Option(rnaQcProtocols[i].name, rnaQcProtocols[i].id);   
    205204  }
    206 
     205  if (frm.protocols.length == 0)
     206  {
     207    frm.protocols[0] = new Option('- none -', 0);
     208  }
    207209 
    208210  Main.show('bioPlateSection');
     
    216218 
    217219  var request = Ajax.getXmlHttpRequest();
    218   var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=GetActiveRnaQcBioPlates';   
     220  var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=GetActiveRnaQcBioPlates&numFreeWells=' + selectedRnaExtracts.length;   
    219221  request.open("GET", url, false); 
    220222  request.send(null);
     
    230232  rnaQcBioPlates = response.plates;
    231233 
     234}
     235
     236function createNewPlate()
     237{
     238  Main.viewOrEditItem('<%=ID%>', 'BIOPLATE', 0, true); 
    232239}
    233240
     
    279286  for (var i=0; i < selectedRnaExtracts.length; i++)
    280287  {
     288    var rna = selectedRnaExtracts[i];
    281289    var specimen = null;
    282290    var boxValue = '';
     
    284292    var columnValue = '';
    285293
    286     html += '<tr>';
    287     html += '<td class="prompt">'+selectedRnaExtracts[i].nextRnaQcName+'</td>';
    288     html += '</tr>';
    289 
    290294    var row = 'row'+i;
    291295    var column = 'column'+i;
     296    var hiSense = 'hiSense'+i;
    292297   
    293     html += '<tr>';
    294     html += '<td class="subprompt">Row</td>';
    295     html += '<td class="input"><input style="text-transform:uppercase;" type="text"  onkeypress="focusOnEnter(event, \''+column+'\')" name='+row+' value="' + rowValue + '" size="3" maxlength="2" ';
     298    var hiSenseChecked = '';
     299    var ndConc = null;
     300    if (rna.NDConc)
     301    {
     302      ndConc = rna.NDConc;
     303      if (ndConc < HiSense_Limit)
     304      {
     305        hiSenseChecked = 'checked';
     306      }
     307    }
     308
     309    html += i == 0 ? '<tr class="highlight">' :  '<tr  class="highlight" style="border-top: 1px dotted #A0A0A0;">';
     310    html += '<td class="prompt">'+rna.nextRnaQcName+'</td>';
     311    html += '<td class="input">Row <input style="text-transform:uppercase;" type="text"  onkeypress="focusOnEnter(event, \''+column+'\')" name='+row+' value="' + rowValue + '" size="3" maxlength="2" ';
    296312    html += ' onBlur="wellOnChange('+i+')">';
    297313    html += '&nbsp;Column<input type="text" onkeypress="focusOnEnter(event, \''+i+'\')" name='+column+' value="'+ columnValue + '" size="3" maxlength="3" ';
    298314    html += ' onBlur="wellOnChange('+i+')">';
    299     html += '&nbsp;<a href="javascript:suggestWellOnClick('+i+')">Suggest</a>'
     315    html += '&nbsp;<a href="javascript:suggestWellOnClick('+i+')">Suggest</a><br>';
     316    html += '<input type="checkbox" name="'+hiSense+'" id="' + hiSense + '" value="1" ' + hiSenseChecked + '>';
     317    html += '<label for="'+hiSense+'">HiSense</label>';
     318    if (ndConc) html += ' (' + ndConc + ' ng/μl)';
    300319    html += '</td>';
    301320    html += '<td class="status" id="well'+i+'.status"></td>';
    302321    html += '<td class="help"><span id="well'+i+'.message" class="message" style="display: none;"></span></td>';   
    303322    html += '</tr>';
    304 
    305     //var doOnTab = i==(nofTubes-1) ? 'doOnTab(event, goCreate)' : '';
     323   
    306324  }
    307325  setInnerHTML('rnaQc', html);
    308   //wellsAreValid = Array(nofTubes);
    309326  currentStep = 3;
    310327  Main.show('rnaQcSection'); 
     
    380397  var protocol = new Object();
    381398  protocol.id = parseInt(frm.protocols[frm.protocols.selectedIndex].value);
    382   submitInfo.protocol = protocol;
     399  if (protocol.id != 0)
     400  {
     401    submitInfo.protocol = protocol;
     402  }
    383403 
    384404  var rnaQcExtracts = new Array();
     
    390410    rnaQc.row = frm['row'+i].value;
    391411    rnaQc.column = frm['column'+i].value;
     412    rnaQc.QCHiSense = frm['hiSense'+i].checked ? true : false;
    392413    rnaQcExtracts[rnaQcExtracts.length] = rnaQc;
    393414  }
     
    459480      <tr valign="top">
    460481        <td class="prompt">RNA extracts</td>
    461         <td class="input"><select style="width:90%" name="rnaExtracts" id="rnaExtracts" multiple="multiple" size="12"
     482        <td class="input" rowspan="2"><select style="width:90%" name="rnaExtracts" id="rnaExtracts" multiple="multiple" size="12"
    462483          onkeypress='doOnTab(event, goNextAuto)'></select>
    463           <base:buttongroup>
     484         
     485          <base:buttongroup style="margin-top: 0.5em;">
    464486            <base:button title="Select manually&hellip;" onclick="selectRna()" id="btnSelectRna" />
    465487          </base:buttongroup>
     488         
    466489        </td>
    467         <td class="status" id="rna.status"></td>
    468         <td class="help"><span id="rna.message" class="message" style="display: none;"></span>
     490        <td class="status" id="rna.status" rowspan="2"></td>
     491        <td class="help" rowspan="2"><span id="rna.message" class="message" style="display: none;"></span>
    469492          The list contain RNA extracts that has not yet been selected for
    470           quality control. Use the 'Select manually' button for free selection.
     493          quality control (determined by absence of a RNAQC child extract).
     494          Use the <b>Select manually</b> button for free selection.
    471495        </td>
    472496      </tr>
     
    481505    <tr>
    482506      <td rowspan="2" class="stepno">2</td>
    483       <td class="steptitle">Select bioplate and protocol</td>
     507      <td class="steptitle">Select RNAQC bioplate and protocol</td>
    484508    </tr>
    485509    <tr>
     
    490514          <td class="input">
    491515            <select style="width:90%" name="bioPlates" id="bioPlates" onkeypress='doOnTab(event, goNextAuto)'></select>
    492             <base:buttongroup>
     516            <base:buttongroup style="margin-top: 0.5em;">
    493517              <base:button title="Create new plate&hellip;" onclick="createNewPlate()" image="add.png" id="btnCreatePlate" />
    494518            </base:buttongroup>
     
    496520          <td class="status" id="bioplates.status"></td>
    497521          <td class="help"><span id="bioplates.message" class="message" style="display: none;"></span>
    498             Select the bioplate to use or use the 'Create new plate' button.
     522            Select the bioplate to use in the quality control. The list contain
     523            RNAQC bioplates without quality score data (determined by absence of
     524            QCRunDate annotation) with at least enough free wells to place the selected RNA extracts.
     525            Use the <b>Create new plate</b> button to create a new plate.
    499526          </td>
    500527        </tr>
     
    506533          <td class="status" id="protocols.status"></td>
    507534          <td class="help"><span id="protocols.message" class="message" style="display: none;"></span>
    508             Select the protocol which was used in the quality control.
     535            Select the protocol which is used in the quality control.
    509536          </td>
    510537        </tr>
     
    521548    <tr>
    522549      <td rowspan="2" class="stepno">3</td>
    523       <td class="steptitle">Enter RNA QC information</td>   
     550      <td class="steptitle">Enter RNA QC aliquot information</td>   
    524551    </tr>
    525552    <tr>
    526553      <td class="stepfields">
    527         <table id="rnaQc" border="0" cellspacing="0" cellpadding="0" width="100%">
     554        <table id="rnaQc" style="width: 100%; border-collapse: collapse; ">
    528555        </table>
    529556      </td>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/RnaQcServlet.java

    r1546 r1551  
    1818import net.sf.basedb.core.AnnotationType;
    1919import net.sf.basedb.core.Application;
     20import net.sf.basedb.core.BioMaterialEventSource;
    2021import net.sf.basedb.core.BioPlate;
    2122import net.sf.basedb.core.BioPlateEvent;
     
    107108        {
    108109          r.setAnnotation("nextRnaQcName", r.getName()+".qc1");
     110          r.loadAnnotations(dc, "NDConc", Reggie.ANNOTATION_ND_CONC, null);
    109111          jsonRna.add(r.asJSONObject());
    110112        }
     
    124126       
    125127        rna.setAnnotation("nextRnaQcName", rna.getNextRnaQcName(dc));
     128        rna.loadAnnotations(dc, "NDConc", Reggie.ANNOTATION_ND_CONC, null);
    126129        json.put("rna", rna.asJSONObject());
    127130      }
     
    225228        dc = sc.newDbControl();
    226229       
     230        AnnotationType qcHiSenseType = Reggie.findAnnotationType(dc, Item.EXTRACT, Reggie.ANNOTATION_QC_HISENSE, true);
     231       
    227232        Number plateId = (Number)jsonPlate.get("id");
     233        Number protocolId = jsonProtocol == null ? null : (Number)jsonProtocol.get("id");   
     234       
    228235        BioPlate plate = BioPlate.getById(dc, plateId.intValue());
    229 
    230         Number protocolId = (Number)jsonProtocol.get("id");
    231         Protocol protocol = Protocol.getById(dc, protocolId.intValue());
    232        
    233236        BioPlateEventType eventType = BioPlateEventType.getById(dc, BioPlateEventType.CREATE_BIOMATERIAL);
    234237        BioPlateEvent event = BioPlateEvent.getNew(dc, eventType);
    235238        event.setEventDate(new Date());
    236239        event.setName("Create RNA QC aliquots");
    237         event.setProtocol(protocol);
     240        if (protocolId != null)
     241        {
     242          event.setProtocol(Protocol.getById(dc, protocolId.intValue()));
     243        }
    238244        dc.saveItem(event);
    239245        BioPlateEventParticipant destPlate = event.addParticipant(plate, "destination", 1);
     
    248254          Extract parentRna = Extract.getById(dc, parentRnaId.intValue());
    249255         
     256          Boolean hiSense = (Boolean)jsonRnaQc.get("QCHiSense");
     257         
    250258          // Create a child RNAQC extract
    251259          Extract rnaQc = Extract.getNew(dc, destPlate);
    252260          rnaQc.setItemSubtype(Subtype.RNAQC.load(dc));
    253261          rnaQc.setName((String)jsonRnaQc.get("name"));
    254           rnaQc.getCreationEvent().setSource(parentRna);
     262          BioMaterialEventSource evtSrc = rnaQc.getCreationEvent().setSource(parentRna);
    255263          // TODO - used quantity from parent
     264          //evtSrc.setUsedQuantity(...);
     265         
     266          if (Boolean.TRUE.equals(hiSense))
     267          {
     268            rnaQc.getAnnotationSet().getAnnotation(qcHiSenseType).setValue(hiSense);
     269          }
    256270         
    257271          String row = (String)jsonRnaQc.get("row");
Note: See TracChangeset for help on using the changeset viewer.