Changeset 2032


Ignore:
Timestamp:
Oct 2, 2013, 11:47:03 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #508: Library plates remain in the 'Create pooled libraries' wizard after pools have been created

The problem with 0-quantity libraries is now handled by the Create pooled libraries wizard. It no longer excludes those libraries, but display them in the plate layout. Libraries that have a molarity below 25% of the target molarity are then automatically marked with flag ExcludeFromPool. The exclusion can be manully overridden to include some libraries in the pool, but note that just a few with too low molarity may result in negative mixing volume for EB.

The regular registration is then used to flag the libraries and parent RNA for re-processing.

NOTE! A manual fix is needed to flag library items and their parent RNA for plates that have already been processed with the buggy code.

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

Legend:

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

    r2027 r2032  
    4040// Loaded from servlet when getting Library information
    4141var TARGET_MOLARITY_IN_POOL;
     42var LIMIT_FOR_AUTO_EXCLUDE = 0.25;
    4243var LIMIT_FOR_EXTRA_LARGE_MIX;
    4344var EXTRA_LARGE_MIX_FACTOR;
     
    265266
    266267  var libs = response.libraries;
     268  var molarityLimit = TARGET_MOLARITY_IN_POOL * LIMIT_FOR_AUTO_EXCLUDE;
    267269  for (var i = 0; i < libs.length; i++)
    268270  {
     
    270272    var well = lib.bioWell;
    271273    lib.excludeFromPool = false;
     274   
     275    if (lib.molarity != null && lib.molarity < molarityLimit)
     276    {
     277      lib.excludeFromPool = true;
     278      lib.flag = 'ExcludedFromPool';
     279      lib.comment = 'Not enough DNA';
     280    }
     281
    272282    Plate.getWell(well.row, well.column).setExtract(lib);
    273283  }
     
    335345    if (lib)
    336346    {
    337       PoolMix.calculateLibVolume(lib, targetVolumePerLib, TARGET_MOLARITY_IN_POOL);
     347      if (lib.remainingQuantity == null)
     348      {
     349        lib.excludeFromPool = true;
     350      }
     351      else
     352      {
     353        PoolMix.calculateLibVolume(lib, targetVolumePerLib, TARGET_MOLARITY_IN_POOL);
     354      }
    338355    }
    339356  }
     
    446463  painter.getClassNameForWell = function(well, schema)
    447464  {
     465    var indexSet = painter.barcodeVariant.indexSets[well.column];
    448466    var cls = '';
    449     var indexSet = painter.barcodeVariant.indexSets[well.column];
    450467    var lib = well.extract;
    451     if (lib && lib.excludeFromPool)
    452     {
    453       cls += 'exclude-from-pool';
     468   
     469    if (lib)
     470    {
     471      if (lib.excludeFromPool)
     472      {
     473        cls += ' exclude-from-pool';
     474      }
     475      else if (indexSet)
     476      {
     477        cls += ' ' + (lib && lib.barcode.modified ? 'bg-modified' : indexSet.color);
     478      }
     479      if (lib.flag)
     480      {
     481        cls += ' flagged';
     482      }
     483      if (!lib.flag && lib.molarity != null && lib.molarity < TARGET_MOLARITY_IN_POOL)
     484      {
     485        cls += ' low-molarity';
     486      }
    454487    }
    455488    else if (indexSet)
    456489    {
    457       cls += lib && lib.barcode.modified ? 'bg-modified' : indexSet.color;
    458     }
    459     if (lib && lib.flag)
    460     {
    461       cls += ' flagged';
    462     }
    463     if (lib && lib.molarity < TARGET_MOLARITY_IN_POOL)
    464     {
    465       cls += ' low-molarity';
     490      cls += indexSet.color;
    466491    }
    467492    return cls;
     
    472497    var text = '';
    473498    var lib = well.extract;
    474     if (lib && lib.remainingQuantity && lib.molarity)
     499    if (lib)
    475500    {
    476501      var name = lib.name;
     
    479504      var displayName = name.substring(0, i)+'.<br>&nbsp;'+name.substring(i);
    480505      text += '<div class="lib">'+displayName+'</div>';
     506      text += '<div>';
    481507      text += '<span class="barcode">'+lib.barcode.name+'</span>';
    482       text += '<span class="molarity">'+Numbers.formatNumber(lib.molarity, 2)+'nM</span>';
     508      if (lib.molarity != null)
     509      {
     510        text += '<span class="molarity">'+Numbers.formatNumber(lib.molarity, 2)+'nM</span>';
     511      }
     512      text += '</div>';
    483513      if (!lib.excludeFromPool)
    484514      {
     515        text += '<div>';
    485516        text += '<span class="volume">'+Numbers.formatNumber(lib.volume*mixFactor, 1) + 'µl</span>';
    486517        text += '<span class="eb">'+Numbers.formatNumber(lib.eb*mixFactor, 1)+'µl</span>';
    487         if (lib.remarks) text += '<div class="remarks">'+ lib.remarks.join('; ') + '</div>';
    488       }
     518        text += '</div>';
     519      }
     520      if (lib.remarks) text += '<div class="remarks">'+ lib.remarks.join('; ') + '</div>';
    489521      if (lib.comment)
    490522      {
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java

    r2027 r2032  
    109109        libQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    110110        Subtype.LIBRARY.addFilter(dc, libQuery);
    111         libQuery.restrict(Restrictions.eq(Hql.property("remainingQuantity"), Hql.property("originalQuantity")));
     111        libQuery.restrict(Restrictions.neq(Hql.property("originalQuantity"), null));
     112        libQuery.restrict(Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity")));
    112113        // Must NOT have a Flag annotation
    113114        libQuery.join(Annotations.leftJoin(null, Annotationtype.FLAG.load(dc), "flg"));
     
    143144        libQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
    144145        Subtype.LIBRARY.addFilter(dc, libQuery);
    145         libQuery.restrict(Restrictions.eq(Hql.property("remainingQuantity"), Hql.property("originalQuantity")));
     146        libQuery.restrict(Restrictions.neq(Hql.property("originalQuantity"), null));
     147        libQuery.restrict(Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity")));
    146148        // Must NOT have a Flag annotation
    147149        libQuery.join(Annotations.leftJoin(null, Annotationtype.FLAG.load(dc), "flg"));
     
    193195        query.join(Hql.innerJoin("bw", "bioPlate", "bp"));
    194196        query.restrict(Restrictions.eq(Hql.alias("bp"), Hql.entity(libPlate)));
    195         query.restrict(Restrictions.gt(Hql.property("remainingQuantity"), Expressions.aFloat(0f)));
     197        query.restrict(Restrictions.neq(Hql.property("originalQuantity"), null)); // Get rid of Stratagene, etc.
    196198        query.order(Orders.asc(Hql.property("bw", "column")));
    197199        query.order(Orders.asc(Hql.property("bw", "row")));
Note: See TracChangeset for help on using the changeset viewer.