Changeset 3831


Ignore:
Timestamp:
Apr 6, 2016, 12:59:32 PM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #875: Soft and hard target amount for NeoPrep?

The "RNA concentration normalization" wizard has been updated with support for the RNAMinimalAmount annotation. If the annotation is not set the minimal amount is assumed to be the same as the RNATargetAmount.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/sampleproc/rna_normalization.js

    r3741 r3831  
    343343    Wizard.showGoNextConfirmation(true, 'Print the lab protocol before continuing with the registration!');
    344344    Wizard.keepSessionAlive();
    345     Reggie.loadProtocols('RNA_NORMALIZATION_PROTOCOL', 'normalizationProtocol', 'RNA_TARGET_AMOUNT,RNA_TARGET_VOLUME');
     345    Reggie.loadProtocols('RNA_NORMALIZATION_PROTOCOL', 'normalizationProtocol', 'RNA_TARGET_AMOUNT,RNA_MINIMAL_AMOUNT,RNA_TARGET_VOLUME');
    346346    frm.normalizationProtocol.focus();
    347347  }
     
    362362      {
    363363        var p = frm.normalizationProtocol[i].item;
    364         frm.normalizationProtocol[i].text = p.name + ' (' + (p.RNATargetAmount || '? ') + 'µg in '+(p.RNATargetVolume || '? ')+'µl)';
     364       
     365        var unit = 'µg';
     366        var factor = 1;
     367        if (p.RNATargetAmount < 0.5)
     368        {
     369          unit = 'ng';
     370          factor = 1000;
     371        }
     372       
     373        var text = p.name + ' (';
     374        if (p.RNAMinimalAmount) text += Reggie.formatNumber(p.RNAMinimalAmount * factor, '', 1) + '-';
     375        text += p.RNATargetAmount ? Reggie.formatNumber(p.RNATargetAmount * factor, '', 1) : '? ';
     376        text += unit;
     377        text += ' in '+(p.RNATargetVolume || '? ')+'µl)';
     378        frm.normalizationProtocol[i].text = text;
    365379      }
    366380    }
     
    381395      Wizard.setInputStatus('normalizationProtocol', 'valid');
    382396    }
     397    if (!protocol.RNAMinimalAmount) protocol.RNAMinimalAmount = protocol.RNATargetAmount;
    383398    Doc.element('normalization-protocol').innerHTML =  Strings.encodeTags(frm.normalizationProtocol[frm.normalizationProtocol.selectedIndex].text);
    384399
     
    404419        remarks[remarks.length] = 'Large mix';
    405420      }
     421      else if (rna.volume > protocol.RNATargetVolume)
     422      {
     423        // The RNA has too low concentration so we can't reach the target amount
     424        // with the target volume. The protocol may allow us to use a lesser amount
     425        // so we try this
     426        rna.volume = protocol.RNATargetVolume;
     427        rna.water = 0;
     428        rna.usedQuantity = rna.volume * rna.NDConc / 1000;
     429      }
    406430     
    407       var notEnoughQuantity = rna.remainingQuantity < rna.usedQuantity;
    408       if (notEnoughQuantity) remarks[remarks.length] = '<span class="flag">Not enough quantity</span>';
     431      rna.notEnoughQuantity = rna.remainingQuantity < rna.usedQuantity || rna.usedQuantity < protocol.RNAMinimalAmount;
     432      if (rna.notEnoughQuantity)
     433      {
     434        remarks[remarks.length] = '<span class="flag">Not enough quantity</span>';
     435      }
     436      else if (rna.usedQuantity < protocol.RNATargetAmount)
     437      {
     438        remarks[remarks.length] = Numbers.formatNumber(rna.usedQuantity * 1000, 0) + 'ng';
     439      }
    409440     
    410       Doc.element('rnaVolume.'+rna.id).innerHTML = notEnoughQuantity ? '' : Numbers.formatNumber(rna.volume, 1);
    411       Doc.element('rnaWater.'+rna.id).innerHTML = notEnoughQuantity ? '' : Numbers.formatNumber(rna.water, 1);
     441      Doc.element('rnaVolume.'+rna.id).innerHTML = rna.notEnoughQuantity ? '' : Numbers.formatNumber(rna.volume, 1);
     442      Doc.element('rnaWater.'+rna.id).innerHTML = rna.notEnoughQuantity ? '' : (rna.water > 0 ? Numbers.formatNumber(rna.water, 1) : '—');
    412443      Doc.element('remarks.'+rna.id).innerHTML = remarks.join(', ');
    413444    }
     
    465496    {
    466497      var rna = selectedRna[i];
    467       if (rna.usedQuantity < rna.remainingQuantity)
     498      if (!rna.notEnoughQuantity)
    468499      {
    469500        var normalizedRna = {};
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ExtractionServlet.java

    r3752 r3831  
    608608            Annotationtype.ND_CONC.setAnnotationValue(dc, normalizedRna, ndConc.floatValue());
    609609           
    610             jsonMessages.add("Created '" + normalizedRna.getName() + "' normalized RNA");
     610            jsonMessages.add("Created '" + normalizedRna.getName() + "' normalized RNA (" + Values.formatNumber(usedQuantity.floatValue()*1000, 0, "ng") + ")");
    611611            dc.saveItem(normalizedRna);
    612612          }
Note: See TracChangeset for help on using the changeset viewer.