Changeset 1807


Ignore:
Timestamp:
Jan 23, 2013, 2:09:40 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #424 and #425. Added support for selecting different pooling layouts. It should be relatively easy to add more layouts in the future. Most of the functionality is in the 'pools.js' file which define the available layouts using some properties and some customization methods. The selected layout is stored as an annotation PoolSchema on the mRNA bioplate. The annotation is then copied to the cDNA plate when that is created. The layout is also used in the plate-view lab protocol.

The barcode layout wizard (#456) will use the selected pool schema as a starting point, but it should also be possible to change and select variants so that all barcodes are used evenly.

Location:
extensions/net.sf.basedb.reggie/branches/ticket-422
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/css/plate.css

    r1742 r1807  
    1515  text-align: center;
    1616  padding: 2px;
     17}
     18
     19.plate th.pool
     20{
     21  border-left: 1px solid #A0A0A0;
     22  border-top: 1px solid #A0A0A0;
     23  padding-left: 1px;
     24}
     25
     26.plate th.nopool, .plate th.nopool-after-pool
     27{
     28  border-top: 1px solid #E0E0E0;
     29  background-color: #FFFFFF;
     30}
     31
     32.plate th.nopool-after-pool
     33{
     34  border-left: 1px solid #A0A0A0;
    1735}
    1836
     
    195213  border-radius: 4px 0 0 0;
    196214}
     215.row-0 .well.pool-middle.highlight-pool
     216{
     217  padding-top: 0;
     218  border-top: 2px solid #2288AA;
     219}
    197220.row-0 .well.pool-right.highlight-pool
    198221{
     
    203226
    204227/* And the bottom pool header is a single column */
    205 th.highlight-pool
     228th.pool.highlight-pool
    206229{
    207230  padding-bottom: 0;
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/mrna_protocol.jsp

    r1794 r1807  
    4343      var bioplate = bioplates[i];
    4444      var option = new Option(bioplate.name, bioplate.id);
    45       option.comments = bioplate.comments;
     45      option.bioplate = bioplate;
    4646      plates.options[plates.length] = option;
    4747    }
     
    126126{
    127127  var frm = document.forms['reggie'];
    128   setInnerHTML('comments', frm.bioplate[frm.bioplate.selectedIndex].comments);
     128  var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
     129  setInnerHTML('comments', bioplate.comments);
     130  frm.poolSchema.value = bioplate.poolSchema;
    129131}
    130132</script>
     
    154156  <input type="hidden" name="ID" value="<%=ID%>">
    155157  <input type="hidden" name="view" value="list">
     158  <input type="hidden" name="poolSchema" value="5by24">
    156159 
    157160  <table class="stepform">
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/mrna_protocol2.jsp

    r1802 r1807  
    3838  int mRnaPlateId = Values.getInt(request.getParameter("bioplate"));
    3939  final Float stratageneConc = Values.getFloat(request.getParameter("stratageneConc"), null);
     40  String poolSchema = request.getParameter("poolSchema");
    4041 
    4142  BioPlate plate = BioPlate.getById(dc, mRnaPlateId);
    4243  int columns = plate.getColumns();
    4344  int rows = plate.getRows();
    44 
    4545  String view = Values.getString(request.getParameter("view"), "list");
    4646%>
     
    5555  <script language="JavaScript" src="<%=root%>/include/scripts/ajax.js" type="text/javascript" charset="UTF-8"></script>
    5656  <script language="JavaScript" src="<%=home %>/reggie.js" type="text/javascript" charset="UTF-8"></script>
     57  <script language="JavaScript" src="pools.js" type="text/javascript" charset="UTF-8"></script>
    5758 
    5859  <script language="JavaScript">
     
    210211  function viewAsPlate(list)
    211212  {
     213    var schema = PoolSchema.getById('<%=poolSchema%>');
    212214    for (var i = 0; i < list.length; i++)
    213215    {
     
    218220      var div = document.getElementById('well.'+well.row+'.'+well.column);
    219221      if (rna.qc) Main.addClass(div, 'qc');
     222      Main.addClass(div, schema.getClassNameForWell(well));
    220223     
    221224      var html = '<div class="rna">'+rna.name+'</div>';
     
    232235      div.innerHTML = html;
    233236    }
     237   
     238    setInnerHTML('pool-row', PoolSchema.buildPoolTableRow(schema, 12, false));
     239   
    234240    Main.show('plateview');
    235241  }
     
    550556        {
    551557          %>
    552           <td class="well col-<%=c%> <%=c>=1 && c<=10 ? "primary" : "secondary" %> <%=c % 2 == 1 ? "pool-left" : "pool-right" %>" id="well.<%=r%>.<%=c%>"></td>
     558          <td class="well col-<%=c%>" id="well.<%=r%>.<%=c%>"></td>
    553559          <%
    554560        }
     
    559565    %>
    560566    </tbody>
    561     <tr>
    562       <th></th>
    563       <th></th>
    564       <%
    565       String[] poolNames = { "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix", "x", "xi", "xii" };
    566       for (int i = 0; i < (columns - 2) / 2; ++i)
    567       {
    568         %>
    569         <th colspan="2" id="pool.<%=i %>"><%=poolNames[i] %></td>
    570         <%
    571       }
    572       %>
    573       <th></th>
     567    <tr id="pool-row">
     568      <th colspan="13">&nbsp;</th>
    574569    </tr>
    575570    </table>
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/select_rna.jsp

    r1803 r1807  
    3232  <link rel="stylesheet" type="text/css" href="../css/plate.css">
    3333  <script language="JavaScript" src="../reggie.js" type="text/javascript" charset="UTF-8"></script>
     34  <script language="JavaScript" src="pools.js" type="text/javascript" charset="UTF-8"></script>
    3435
    3536<script language="JavaScript">
     
    4546  plate.columns = 12;
    4647  plate.wells = [];
    47  
    48   plate.init = function()
     48  plate.schema = null;
     49 
     50  plate.init = function(schema)
    4951  {
    5052    for (var c = 0; c < plate.columns; c++)
     
    9294
    9395  /**
    94     Get all wells in the given pool number. Each pool is two columns.
    95     First pool i 0 and starts in column 1 (column 0 and 11 doesn't belong to
    96     any pool).
     96    Get all wells in the given pool number. Which wells are selected,
     97    depends on the pool schema.
    9798  */
    98   plate.getPool = function(pool)
    99   {
    100     var result = [];
    101     for (var i = (1+pool*2)*plate.rows; result.length < plate.rows*2; i++)
    102     {
    103       result[result.length] = plate.wells[i];
    104     }
    105     return result;
     99  plate.getPool = function(poolNum)
     100  {
     101    return plate.schema.getWellsInPool(plate, poolNum);
    106102  }
    107103
     
    190186    Paint the given wells.
    191187  */
    192   plate.paint = function(wells)
    193   {
     188  plate.paint = function(wells, schema)
     189  {
     190    if (schema) plate.schema = schema;
    194191    for (var i = 0; i < wells.length; i++)
    195192    {
    196       wells[i].paint();
     193      wells[i].paint(plate.schema);
    197194    }
    198195  }
     
    432429}
    433430
    434 Well.prototype.getClassName = function()
     431Well.prototype.getClassName = function(schema)
    435432{
    436433  var c = this.column;
    437434  var cls = 'well col-'+c;
    438   cls += (c >= 1 && c <= 10) ? ' primary' : ' secondary';
    439   cls += c % 2 == 1 ? ' pool-left' : ' pool-right';
     435  if (schema)
     436  {
     437    cls += ' ' + schema.getClassNameForWell(this);
     438  }
    440439  if (this.selected) cls += ' selected';
    441440  if (this.clipboard) cls += ' clipboard';
     
    527526  this.warning = false;
    528527  this.tag.innerHTML = this.getText();
    529   this.tag.className = this.getClassName();
     528  this.tag.className = this.getClassName(Plate.schema);
    530529  this.tag.title = this.getTooltip();
    531530}
     
    536535function init()
    537536{
     537  var frm = document.forms['reggie'];
     538  var schema = PoolSchema.initList(frm.pool_schema);
     539
    538540  Plate.init();
    539   Plate.paint(Plate.getWells());
     541  Plate.paint(Plate.getWells(), schema);
     542 
     543  poolSchemaOnChange();
    540544 
    541545  var specialSelect = document.getElementById('iconSpecialSelect');
     
    547551  var plateName = Plate.findNextMRnaPlateName();
    548552  setInnerHTML('plateName', plateName);
     553 
    549554}
    550555
     
    775780    well.setRna(null);
    776781    well.selected = false;
    777     well.paint();
     782    well.paint(Plate.schema);
    778783  }
    779784  Plate.checkReplicates();
     
    11351140  {
    11361141    // All primary pools or all empty in the primary pools (will be filtered later)
    1137     for (var i = 0; i < 5; i++)
     1142    for (var i = 0; i < Plate.schema.numPools; i++)
    11381143    {
    11391144      wells = wells.concat(Plate.getPool(i));
     
    13251330  var frm = document.forms['reggie'];
    13261331 
     1332  var schema = POOL_SCHEMA[frm.pool_schema.selectedIndex];
     1333 
    13271334  plateInfo.name = Plate.name;
    13281335  plateInfo.comments = frm.comments.value;
     1336  plateInfo.poolSchema = schema ? schema.id : null;
    13291337  plateInfo.wells = [];
    13301338
     
    13881396  }
    13891397 
    1390   if (numRna < 80)
    1391   {
    1392     if (!confirm('Less than 80 wells have RNA in them. Continue anyway?')) return;
     1398  if (schema)
     1399  {
     1400    var numPrimary = schema.numPools * schema.numWellsPerPool;
     1401    if (numRna < numPrimary)
     1402    {
     1403      if (!confirm('Some of the primary wells are missing RNA. Continue anyway?')) return;
     1404    }
    13931405  }
    13941406 
     
    14431455 
    14441456  Main.openPopup('show_flagged_rna.jsp?ID=<%=ID%>&numFlagged='+flagged.length, 'FlaggedRna', 600, 400);
     1457}
     1458
     1459function poolSchemaOnChange()
     1460{
     1461  var frm = document.forms['reggie'];
     1462  var schema = POOL_SCHEMA[frm.pool_schema.selectedIndex];
     1463  Plate.paint(Plate.getWells(), schema);
     1464 
     1465  var row = document.getElementById('pool-row');
     1466  var html = PoolSchema.buildPoolTableRow(schema, Plate.columns, true);
     1467  row.innerHTML = html;
    14451468}
    14461469
     
    16051628  <m:menu
    16061629    id="menuContext"
    1607     style="display: none; font-weight: normal; text-align: left; xwidth: 8em;">
     1630    style="display: none; font-weight: normal; text-align: left;">
    16081631    <m:menuitem
    16091632      title="Cut&hellip;"
     
    16531676        <td class="input" id="plateName"></td>
    16541677        <td class="help">Select RNA items to use for the new mRNA plate.</td>
     1678      </tr>
     1679      <tr valign="top">
     1680        <td class="prompt">Preliminary pool layout</td>
     1681        <td class="input">
     1682          <select name="pool_schema" onchange="poolSchemaOnChange()"></select>
     1683        </td>
     1684        <td class="help">Comments about the new mRNA plate.</td>
    16551685      </tr>
    16561686      <tr valign="top">
     
    18211851        %>
    18221852        </tbody>
    1823         <tr>
    1824           <th></th>
    1825           <th class="link" id="col.0.dup"
    1826               onclick="toggleColumn(0)"
    1827               onmouseover="highlightColumn(0, true)"
    1828               onmouseout="highlightColumn(0, false)"
    1829               title="Select/deselect all wells in this column"></th>
    1830           <%
    1831           String[] poolNames = { "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix", "x", "xi", "xii" };
    1832           for (int i = 0; i < (columns - 2) / 2; ++i)
    1833           {
    1834             %>
    1835             <th colspan="2" class="link" id="pool.<%=i %>"
    1836               onclick="togglePool(<%=i%>)"
    1837               onmouseover="highlightPool(<%=i%>, true)"
    1838               onmouseout="highlightPool(<%=i%>, false)"
    1839               title="Select/deselect all wells in this group"
    1840               ><%=poolNames[i] %></td>
    1841             <%
    1842           }
    1843           %>
    1844           <th></th>
     1853        <tr id="pool-row">
     1854          <th colspan="13">&nbsp;</th>
    18451855        </tr>
    18461856        </table>
  • extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/dao/Annotationtype.java

    r1803 r1807  
    335335  public static final Annotationtype DISABLE_AUTO_PROCESSING =
    336336    new Annotationtype("DisableAutoProcessing", Type.STRING, Item.EXTRACT);
    337  
     337
     338  /**
     339    The "PoolSchema" annotation which, if set, indicates the default
     340    pooling schema to use when working with mRNA, cDNA and Library
     341    plates. It an enumerated string annotation type.
     342    @since 2.x
     343  */
     344  public static final Annotationtype POOL_SCHEMA =
     345    new Annotationtype("PoolSchema", Type.STRING, Item.BIOPLATE);
     346
    338347  /**
    339348    Get the annotation type by name of the static constant defined in this class.
  • extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r1805 r1807  
    223223       
    224224        jsonChecks.add(checkAnnotationType(dc, Annotationtype.DISABLE_AUTO_PROCESSING, 1, null, effectiveOptions, createIfMissing));
    225        
     225        jsonChecks.add(checkAnnotationType(dc, Annotationtype.POOL_SCHEMA, 1,
     226            new ValueOptions("4by24", "4by16", "5by16"),
     227            effectiveOptions, createIfMissing));
    226228        // Annotation type categories
    227229        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.PATIENT, createIfMissing,
  • extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/servlet/MRnaServlet.java

    r1803 r1807  
    113113          jsonPlate.put("name", plate.getName());
    114114          jsonPlate.put("comments", plate.getDescription());
     115          jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, plate));
    115116         
    116117          jsonPlates.add(jsonPlate);
     
    337338        mRnaPlate.setName(plateName);
    338339        mRnaPlate.setDescription(Values.getStringOrNull((String)jsonPlate.get("comments")));
     340        Annotationtype.POOL_SCHEMA.setAnnotationValue(dc, mRnaPlate, jsonPlate.get("poolSchema"));
    339341        dc.saveItem(mRnaPlate);
    340342       
     
    466468        Annotationtype.QC_OPERATOR.setAnnotationValue(dc, mrnaPlate, operator);
    467469       
    468        
    469470        // Comment about the plate
    470471        mrnaPlate.setDescription((String)jsonReq.get("comments"));
     
    477478        BioPlate cdnaPlate = BioPlate.getNew(dc, BioplateType.CDNA.getPlateGeometry(dc), BioplateType.CDNA.load(dc));
    478479        cdnaPlate.setName(cdnaPlateName);
     480        Annotationtype.POOL_SCHEMA.copyAnnotationValues(dc, mrnaPlate, cdnaPlate, true);
     481
    479482        dc.saveItem(cdnaPlate);
    480483       
Note: See TracChangeset for help on using the changeset viewer.