Changeset 2188


Ignore:
Timestamp:
Jan 10, 2014, 2:31:14 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #555: Specify amount to use from *.dil items in pool

Implemented the same functionality in the "Create manual pool" wizard. Also discovered and fixed some bugs introduced by #553 (submitting mixingStrategy and target volume as properties of the pool).

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

Legend:

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

    r2151 r2188  
    4242var LIMIT_FOR_AUTO_EXCLUDE = 0.25;
    4343var LIMIT_FOR_EXTRA_LARGE_MIX;
    44 var EXTRA_LARGE_MIX_FACTOR;
     44var MAX_TARGET_VOLUME = 10;
     45var MIN_TARGET_VOLUME = 2;
    4546
    4647function init()
     
    5253  var poolInfo = response.poolInfo;
    5354  TARGET_MOLARITY_IN_POOL = poolInfo.targetMolarity;
    54   EXTRA_LARGE_MIX_FACTOR = poolInfo.extraLargeMixFactor;
    5555  LIMIT_FOR_EXTRA_LARGE_MIX = poolInfo.limitForExtraLargeMix;
    5656  setInnerHTML('pool-name', response.names[0]);
     
    463463 
    464464  targetVolumePerLibIsValid = false;
    465   if (targetVolumePerLib < 2 || targetVolumePerLib > 10)
    466   {
    467     setInputStatus('target_volume', 'Must be between 2 and 10µl', 'invalid');
     465  if (targetVolumePerLib < MIN_TARGET_VOLUME || targetVolumePerLib > MAX_TARGET_VOLUME)
     466  {
     467    setInputStatus('target_volume', 'Must be between '+MIN_TARGET_VOLUME+' and '+MAX_TARGET_VOLUME+'µl', 'invalid');
    468468    return;
    469469  }
     
    489489  submitInfo.flagged = []; // Always empty
    490490  var frm = document.forms['reggie'];
    491   submitInfo.targetVolumeInPoolPerLib = parseFloat(frm.target_volume.value);
    492   submitInfo.targetPoolMolarity = TARGET_MOLARITY_IN_POOL;
    493   submitInfo.mixingStrategy = Forms.getCheckedRadio(frm.mixing_strategy).value;
     491  var mixingStrategy = Forms.getCheckedRadio(frm.mixing_strategy).value;
    494492 
    495493  var pool = {};
     
    497495  pool.comment = frm.poolComments.value;
    498496  pool.ebVolumeExtra = Math.max(0, poolInfo.ebVolumeExtra);
     497  pool.targetVolumeInPoolPerLib = parseFloat(frm.target_volume.value);
     498  pool.targetPoolMolarity = TARGET_MOLARITY_IN_POOL;
     499  pool.mixingStrategy = mixingStrategy;
    499500  pool.libs = [];
    500501  pool.excluded = [];
     
    514515      tmp.eb = lib.actualEb;
    515516      tmp.mixFactor = lib.mixFactor;
     517      if (lib.mixFactor > 1 && lib.targetVolume && mixingStrategy == 'dynamic')
     518      {
     519        tmp.targetVolume = lib.targetVolume;
     520      }
    516521      tmp.comment = lib.comment;
    517522      pool.libs[pool.libs.length] = tmp;
     
    601606  updatePoolData();
    602607}
     608
     609//Set target volume on the selected wells
     610var lastTargetVolume = null;
     611function setTargetVolume()
     612{
     613  var frm = document.forms['reggie'];
     614  var checked = [];
     615  var targetVolume;
     616  for (var libNo = 0; libNo < selectedLibraries.length; libNo++)
     617  {
     618    var lib = selectedLibraries[libNo];
     619    if (frm['check.'+lib.id].checked && lib.mixFactor > 1)
     620    {
     621      checked[checked.length] = lib;
     622      if (!targetVolume) targetVolume = lib.targetVolume;
     623    }
     624  }
     625 
     626  if (checked.length == 0)
     627  {
     628    alert('No libraries with separate mix have been selected');
     629    return;
     630  }
     631
     632 
     633  targetVolume = parseFloat(prompt('Volume to use in pool ('+LIMIT_FOR_EXTRA_LARGE_MIX+'--'+MAX_TARGET_VOLUME+' µl)', targetVolume || lastTargetVolume));
     634  if (isNaN(targetVolume))
     635  {
     636    targetVolume = null;
     637  }
     638  else if (targetVolume > MAX_TARGET_VOLUME)
     639  {
     640    targetVolume = MAX_TARGET_VOLUME;
     641  }
     642  else if (targetVolume < LIMIT_FOR_EXTRA_LARGE_MIX)
     643  {
     644    targetVolume = LIMIT_FOR_EXTRA_LARGE_MIX
     645  }
     646  lastTargetVolume = targetVolume;
     647  if (targetVolume == '') targetVolume = null;
     648
     649  var targetVolumePerLib = parseFloat(frm.target_volume.value);
     650  var mixingStrategy = Forms.getCheckedRadio(frm.mixing_strategy).value;
     651  for (var libNo = 0; libNo < checked.length; libNo++)
     652  {
     653    var lib = checked[libNo];
     654    lib.targetVolume = targetVolume;
     655    PoolMix.calculateEbVolume(lib, TARGET_MOLARITY_IN_POOL, targetVolumePerLib, mixingStrategy);
     656  }
     657 
     658  updatePoolData();
     659}
     660
    603661
    604662</script>
     
    823881          onclick="removeSelected()"
    824882          tooltip="Remove the selected libraries from the pool"
     883        />
     884        <tbl:button
     885          title="Separate mix volume&hellip;"
     886          image="<%=home+"/images/specimen.png"%>"
     887          onclick="setTargetVolume()"
     888          tooltip="Set volume to use in the pool for separately mixed libraries (dynamic mixing only)"
    825889        />
    826890        <tbl:button
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_protocol2.jsp

    r2186 r2188  
    251251    {
    252252      var pool = pools[poolNo];
    253       var realPoolNo = schema.getPoolNumForColumn(pool.libraries[0].bioWell.column);
    254 
    255       var wellsInPool = POOL_CURRENT_SCHEMA ? Plate.getPool(realPoolNo) : null;
     253      var wellsInPool = null;
     254      if (schema)
     255      {
     256        var realPoolNo = schema.getPoolNumForColumn(pool.libraries[0].bioWell.column);
     257        wellsInPool = Plate.getPool(realPoolNo);
     258      }
     259
    256260     
    257261      var html = '';
     
    265269       
    266270        var tr = document.createElement('tr');
    267         if (POOL_CURRENT_SCHEMA)
     271        if (schema)
    268272        {
    269273          wellIndex = createMissingRows(tbody, wellsInPool, wellIndex, well, barcodeVariant);
     
    307311        tbody.appendChild(tr);
    308312      }
    309       if (POOL_CURRENT_SCHEMA)
     313      if (schema)
    310314      {
    311315        createMissingRows(tbody, wellsInPool, wellIndex, null, barcodeVariant);
Note: See TracChangeset for help on using the changeset viewer.