Ignore:
Timestamp:
Nov 30, 2012, 12:45:00 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Implemented a simple auto-selection feature that find:

  • RNA items with no child mRNA
  • A non-empty creation date
  • Remaining quantity >= 1.1µg
  • Not manually included on the mRNA plate
  • Sorted by RNA plate and location: plate, row, column

The user designing the plate need to account for replicates/stratagene by leaving room on each pool and then using copy/paste to duplicate some RNA. The user must also manually assign items for QC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/select_rna.jsp

    r1742 r1760  
    342342    }
    343343   
    344     for (var i = 0; i < response.rna.length; i++)
    345     {
    346       var rna = response.rna[i];
     344    rna.cacheInfo(response.rna);
     345  }
     346 
     347  rna.cacheInfo = function(rnaList)
     348  {
     349    for (var i = 0; i < rnaList.length; i++)
     350    {
     351      var rna = rnaList[i];
    347352      info['N'+rna.name] = rna;
    348353      info['I'+rna.id] = rna;
     
    475480      {
    476481        text += '<div class="ndconc">'+Numbers.formatNumber(info.NDConc, 2, 'ng/µl') + '</div>';
    477         text += '<div class="volume">'+Numbers.formatNumber(use/10, 1)+' + '+Numbers.formatNumber(water/10, 1)+'µl</div>';
     482        text += '<div class="volumes"><span class="volume">'+Numbers.formatNumber(use/10, 1)+'</span> + <span class="water">'+Numbers.formatNumber(water/10, 1)+'µl</span></div>';
    478483      }
    479484      else
     
    835840{
    836841  Main.openPopup('select_file.jsp?ID=<%=ID%>', 'SelectFile', 600, 400);
     842}
     843
     844
     845/**
     846  Let the wizard automatically select among unprocessed RNA items.
     847*/
     848function autoSelect()
     849{
     850
     851  var wells = Plate.getWells();
     852  var ignore = [];
     853  var selected = 0;
     854  var notEmpty = 0;
     855 
     856  // Count selected and non-empty wells and keep track of RNA that is already present
     857  for (var i = 0; i < wells.length; i++)
     858  {
     859    var well = wells[i];
     860    if (well.selected)
     861    {
     862      selected++;
     863      if (well.rna && !well.hasError()) notEmpty++;
     864    }
     865    if (well.rna && well.rna.id)
     866    {
     867      ignore[ignore.length] = well.rna.id;
     868    }
     869  }
     870 
     871  if (selected == 0)
     872  {
     873    alert('Please select one or more wells were RNA should be placed.');
     874    return;
     875  }
     876 
     877  if (notEmpty > 0)
     878  {
     879    if (!confirm('Replace RNA in ' + notEmpty + ' wells?'))
     880    {
     881      return;
     882    }
     883  }
     884
     885  var request = Ajax.getXmlHttpRequest();
     886  var url = '../MRna.servlet?ID=<%=ID%>&cmd=AutoSelectRnaForMRna&numToSelect='+currentSelected;
     887  url += '&ignore='+ignore.join(',');
     888  request.open("GET", url, false);
     889  request.send(null);
     890
     891  if (debug) Main.debug(request.responseText);
     892  var response = JSON.parse(request.responseText); 
     893  if (response.status != 'ok')
     894  {
     895    setFatalError(response.message);
     896    return false;
     897  }
     898 
     899  // Cache RNA information
     900  Rna.cacheInfo(response.rna);
     901 
     902  if (response.rna.length == 0)
     903  {
     904    alert('Could not find any unprocessed RNA at this time.');
     905  }
     906 
     907  for (var i = 0; i < response.rna.length; i++)
     908  {
     909    if (i < selected.length)
     910    {
     911      var well = selected[i];
     912      // Create a new RNA object
     913      var rna = Rna.createByName(response.rna[i].name);
     914      well.setRna(rna);
     915      well.selected = false;
     916    }
     917  }
     918 
     919  // Check for replicates on the whole plate and repaint it
     920  Plate.checkReplicates(null, true);
     921  Plate.paint(Plate.getWells());
    837922}
    838923
     
    11581243  display: none;
    11591244}
    1160 .plate.hide-volume .volume
     1245.plate.hide-volumes .volumes
    11611246{
    11621247  display: none;
     
    11651250{
    11661251  display: none;
     1252}
     1253
     1254.volume
     1255{
     1256  color: #C80000;
     1257}
     1258.water
     1259{
     1260  color: #0000C8;
    11671261}
    11681262
     
    12131307            <td>
    12141308              <input type="checkbox" name="ndconc" id="ndconc" onclick="toggleInfo('ndconc')"><label for="ndconc">NDConc</label><br>
    1215               <input type="checkbox" name="volume" id="volume" onclick="toggleInfo('volume')"><label for="volume">Used volume+water</label><br>
     1309              <input type="checkbox" name="volumes" id="volumes" onclick="toggleInfo('volumes')"><label for="volumes">Used volume+water</label><br>
    12161310            </td>
    12171311          </tr>
     
    12361330       
    12371331        <tbl:button
    1238           title="Auto-select&hellip;"
     1332          title="Auto-select"
    12391333          image="<%=home+"/images/wizard.png"%>"
    12401334          onclick="autoSelect()"
     
    12781372        />
    12791373      </tbl:toolbar>
    1280         <table class="plate hide-volume hide-ndconc" style="margin: 1em 1em 0 1em;" id="plate">
     1374        <table class="plate hide-volumes hide-ndconc" style="margin: 1em 1em 0 1em;" id="plate">
    12811375        <%
    12821376        int columns = 12;
Note: See TracChangeset for help on using the changeset viewer.