Changeset 2141


Ignore:
Timestamp:
Nov 18, 2013, 2:36:50 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #527: Implement manual pooled library selection

Selection of plate/pool in lab protocol wizard for pooling and pool registration wizard has been updated to ensure that manaully created pools can be properly selected. There was a problem with manual pools if all libraries came from the same library plate which caused the wizard to beleive that the pool was a "plate" pool. Added PoolIsManual annotation to be able to check for this case and also added a AnyToAny link to the library plate for "plate" pools.

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

Legend:

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

    r2140 r2141  
    139139  submitInfo.flagged = [];
    140140  var frm = document.forms['reggie'];
     141  var libPlate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
    141142  submitInfo.targetVolumeInPoolPerLib = parseFloat(frm.target_volume.value);
    142143  submitInfo.targetPoolMolarity = TARGET_MOLARITY_IN_POOL;
     
    152153    poolInfo.comment = frm['comment.'+poolNo].value;
    153154    poolInfo.ebVolumeExtra = POOL_DATA[poolNo].ebVolumeExtra;
     155    poolInfo.libPlate = libPlate.id;
    154156    poolInfo.libs = [];
    155157    poolInfo.excluded = [];
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_protocol.jsp

    r2108 r2141  
    5252      var pool = pools[poolNo];
    5353      // Shortcut to single-plate pools
    54       var libPlateForPool = pool.libPlates.length == 1 ? pool.libPlates[0] : null;
    55       pool.libPlate = libPlateForPool
     54      var libPlateForPool = pool.libPlates.length == 1 && !pool.isManual ? pool.libPlates[0] : null;
     55      pool.libPlate = libPlateForPool;
    5656   
    5757      // If the pool has a single library bioplate add it to the selection list
    5858      // If the pool doesn't have a single library bioplate, nothing is added to
    59       // the list and the pool can only be selected when the 'multiple' option is
     59      // the list and the pool can only be selected when the 'manual' option is
    6060      // active for the bioplates list
    6161      if (libPlateForPool != null && !libPlates[libPlateForPool.name])
     
    128128    if (addPool)
    129129    {
    130       frm.pools[frm.pools.length] = new Option(pool.name, pool.id, libPlateId);
     130      var name = pool.name;
     131      if (pool.libPlate == null)
     132      {
     133       
     134        name += ' - ';
     135        var numPlates = pool.libPlates.length;
     136        var title = '';
     137        if (numPlates <= 2)
     138        {
     139          for (var plateNo=0; plateNo < numPlates; plateNo++)
     140          {
     141            var libPlate = pool.libPlates[plateNo];
     142            if (plateNo > 0) name += ', ';
     143            name += libPlate.name;
     144          }
     145        }
     146        else
     147        {
     148          name += pool.libPlates[0].name + ' + ' + (numPlates-1) + ' more...';
     149          for (var plateNo=0; plateNo < numPlates; plateNo++)
     150          {
     151            var libPlate = pool.libPlates[plateNo];
     152            if (plateNo > 0) title += ', ';
     153            title += libPlate.name;
     154          }
     155        }
     156      }
     157
     158      frm.pools[frm.pools.length] = new Option(name, pool.id, libPlateId || frm.pools.length == 0);
    131159    }
    132160  }
     
    135163  if (libPlateId)
    136164  {
    137     frm.pools.disabled = true;
     165    //frm.pools.disabled = true;
    138166    Main.removeClass(document.getElementById('plateview'), 'disabled');
    139167  }
     
    153181  if (libPlateId == 0)
    154182  {
    155     // 'multiple' option selected, check that at least one pool is selected
     183    // 'manual' option selected, check that at least one pool is selected
    156184    var numSelectedPools = 0;
    157185    for (var poolNo = 0; poolNo < frm.pools.length; poolNo++)
     
    213241        <td class="input">
    214242          <select style="width:90%;" name="bioplate" id="bioplate" onchange="bioplateOnChange()">
    215             <option value="0">- multiple -
     243            <option value="0">- manual pools -
    216244          </select>
    217           <br>
    218           <i>- or -</i>
    219245        </td>
    220246        <td class="status" id="bioplate.status"></td>
     
    222248          Select the library bioplate that should be pooled in this step. The list contains
    223249          all plates with pools that has not yet been created (determined by abscense of creation date).
    224           Use the <b>multiple</b> option to select pools with libraries from multiple plates.
     250          Use the <b>manual pools</b> option to select pools that has been manually created.
    225251        </td>
    226252      </tr>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_registration.jsp

    r2108 r2141  
    5656     
    5757      // Shortcut to single-plate pools
    58       var libPlateForPool = pool.libPlates.length == 1 ? pool.libPlates[0] : null;
     58      var libPlateForPool = pool.libPlates.length == 1 && !pool.isManual ? pool.libPlates[0] : null;
    5959      pool.libPlate = libPlateForPool
    6060
    6161      // If the pool has a single library bioplate add it to the selection list
    6262      // If the pool doesn't have a single library bioplate, nothing is added to
    63       // the list and the pool can only be selected when the 'multiple' option is
     63      // the list and the pool can only be selected when the 'manual pools' option is
    6464      // active for the bioplates list
    6565      if (libPlateForPool != null && !libPlates[libPlateForPool.name])
     
    133133    if (addPool)
    134134    {
    135       var option = new Option(pool.name, pool.id, libPlateId);
     135      var name = pool.name;
     136      if (pool.libPlate == null)
     137      {
     138       
     139        name += ' - ';
     140        var numPlates = pool.libPlates.length;
     141        var title = '';
     142        if (numPlates <= 2)
     143        {
     144          for (var plateNo=0; plateNo < numPlates; plateNo++)
     145          {
     146            var libPlate = pool.libPlates[plateNo];
     147            if (plateNo > 0) name += ', ';
     148            name += libPlate.name;
     149          }
     150        }
     151        else
     152        {
     153          name += pool.libPlates[0].name + ' + ' + (numPlates-1) + ' more...';
     154          for (var plateNo=0; plateNo < numPlates; plateNo++)
     155          {
     156            var libPlate = pool.libPlates[plateNo];
     157            if (plateNo > 0) title += ', ';
     158            title += libPlate.name;
     159          }
     160        }
     161      }
     162
     163      var option = new Option(name, pool.id, libPlateId || frm.pools.length == 0);
    136164      option.pool = pool;
    137165      frm.pools[frm.pools.length] = option;
     
    425453        <td class="input">
    426454          <select style="width:90%;" name="bioplate" id="bioplate" onchange="bioplateOnChange()">
    427             <option value="0">- multiple -
     455            <option value="0">- manual pools -
    428456          </select>
    429           <br>
    430           <i>- or -</i>
    431457        </td>
    432458        <td class="status" id="bioplate.status"></td>
     
    434460          Select the library bioplate that should be pooled in this step. The list contains
    435461          all plates with pools that has not yet been created (determined by abscense of creation date).
    436           Use the <b>multiple</b> option to select pools with libraries from multiple plates.
     462          Use the <b>manual pools</b> option to select pools that has been manually created.
    437463        </td>
    438464      </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java

    r2140 r2141  
    605605  public static final Annotationtype POOL_TARGET_MOLARITY =
    606606    new Annotationtype("PoolTargetMolarity", Type.FLOAT, Item.EXTRACT);
     607
     608  /**
     609    The "PoolIsManual" annotation, used for extracts (PooledLibrary).
     610    Store a flag indicating if the pool is manaually created. If not set,
     611    it is asssumed that the pool is created from an entire library working plate.
     612    @since 2.14
     613  */
     614  public static final Annotationtype POOL_IS_MANUAL =
     615    new Annotationtype("PoolIsManual", Type.BOOLEAN, Item.EXTRACT);
     616
    607617 
    608618  /**
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r2140 r2141  
    278278        jsonChecks.add(checkAnnotationType(dc, Annotationtype.POOL_TARGET_VOLUME_PER_LIB, 1, null, effectiveOptions, createIfMissing));
    279279        jsonChecks.add(checkAnnotationType(dc, Annotationtype.POOL_TARGET_MOLARITY, 1, null, effectiveOptions, createIfMissing));
     280        jsonChecks.add(checkAnnotationType(dc, Annotationtype.POOL_IS_MANUAL, 1, null, effectiveOptions, createIfMissing));
    280281        jsonChecks.add(checkAnnotationType(dc, Annotationtype.POOL_MIXING_STRATEGY, 1,
    281282            new ValueOptions(PooledLibrary.MIXING_STRATEGY_FIXED, PooledLibrary.MIXING_STRATEGY_DYNAMIC),
     
    384385        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.POOLED_LIBRARY, createIfMissing,
    385386            Annotationtype.POOL_MOLARITY, Annotationtype.POOL_CONC, Annotationtype.POOL_TARGET_VOLUME_PER_LIB,
    386             Annotationtype.POOL_TARGET_MOLARITY,
     387            Annotationtype.POOL_TARGET_MOLARITY, Annotationtype.POOL_IS_MANUAL,
    387388            Annotationtype.POOL_MIXING_STRATEGY, Annotationtype.POOL_DATE, Annotationtype.OPERATOR,
    388389            Annotationtype.FLAG, Annotationtype.AUTO_PROCESSING));
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java

    r2140 r2141  
    1919
    2020
     21
    2122import net.sf.basedb.clients.web.util.HTML;
     23import net.sf.basedb.core.AnyToAny;
    2224import net.sf.basedb.core.Application;
    2325import net.sf.basedb.core.BioMaterialEvent;
     
    274276          pool.loadAnnotations(dc, "molarity", Annotationtype.POOL_MOLARITY, null);
    275277          pool.loadAnnotations(dc, "conc", Annotationtype.POOL_CONC, null);
     278          pool.loadAnnotations(dc, "isManual", Annotationtype.POOL_IS_MANUAL, null);
    276279          pool.setAnnotation("remainingQuantity", pool.getExtract().getRemainingQuantity());
    277280          pool.setAnnotation("comments", pool.getExtract().getDescription());
     
    391394          JSONArray jsonExcluded = (JSONArray)jsonPool.get("excluded");
    392395         
     396          Number libPlateId = (Number)jsonPool.get("libPlate");
     397         
    393398          // Create PooledLibrary item
    394399          Extract pool = Extract.getNew(dc);
     
    399404          Annotationtype.POOL_TARGET_MOLARITY.setAnnotationValue(dc, pool, targetPoolMolarity.floatValue());
    400405          Annotationtype.POOL_MIXING_STRATEGY.setAnnotationValue(dc, pool, mixingStrategy);
     406         
     407          // Link with library plate
     408          if (libPlateId != null)
     409          {
     410            BioPlate libPlate = BioPlate.getById(dc, libPlateId.intValue());
     411            AnyToAny libPlateLink = AnyToAny.getNew(dc, pool, libPlate, "LibPlate", true);
     412            dc.saveItemIf(pool, libPlateLink, false);
     413            jsonMessages.add("Linked pool " + pool.getName() + " with " + libPlateLink);
     414          }
     415          else
     416          {
     417            Annotationtype.POOL_IS_MANUAL.setAnnotationValue(dc, pool, true);
     418          }
    401419         
    402420          BioMaterialEvent poolEvent = pool.getCreationEvent();
Note: See TracChangeset for help on using the changeset viewer.