Changeset 1800


Ignore:
Timestamp:
Jan 9, 2013, 12:53:08 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #424 and #425. Added support for marking wells as used by an 'External' RNA item not tracked by BASE. This will be indicated in the lab protocols, but information about concentration and volumes to use must be picked from another source.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/mrna_protocol2.jsp

    r1795 r1800  
    131131    // Set the 'stratagene' flag
    132132    rna.stratagene = rna.name == STRATAGENE_NAME;
     133    rna.external = rna.name == EXTERNAL_RNA_NAME;
     134   
    133135    // Set the 'QC' flag if more than 1.2µg is used
    134136    rna.qc = rna.usedQuantity > 1.2;
     
    153155    var remarks = [];
    154156    if (rna.qc) remarks[remarks.length] = 'QC';
    155     if (!rna.stratagene)
     157    if (!rna.stratagene && !rna.external)
    156158    {
    157159      if (!rna.bioWell)
     
    172174      }
    173175    }
    174     else
     176    else if (rna.stratagene)
    175177    {
    176178      if (!rna.NDConc && rna.usedQuantity)
     
    178180        remarks[remarks.length] = 'Use ' + Numbers.formatNumber(rna.usedQuantity, 2) + ' µg RNA';
    179181      }
     182    }
     183    else if (rna.external)
     184    {
     185      remarks[remarks.length] = 'Use ' + Numbers.formatNumber(rna.usedQuantity, 2) + ' µg RNA';
    180186    }
    181187    rna.remarks = remarks;
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/select_rna.jsp

    r1796 r1800  
    226226        var well = plate.wells[i];
    227227        // Ignore empty wells and wells with 'Stratagene'
    228         if (well.rna && !well.rna.stratagene)
     228        if (well.rna && !well.rna.stratagene && !well.rna.external)
    229229        {
    230230          nameCount[well.rna.name] = 1 + (nameCount[well.rna.name] || 0);
     
    285285    tmp.name = name;
    286286    tmp.stratagene = name == STRATAGENE_NAME;
     287    tmp.external = name == EXTERNAL_RNA_NAME;
    287288    tmp.replicate = false;
    288289    tmp.info = rna.infoByName(name);
     
    299300    tmp.name = info.name;
    300301    tmp.stratagene = tmp.name == STRATAGENE_NAME;
     302    tmp.external = tmp.name == EXTERNAL_RNA_NAME;
    301303    tmp.replicate = false;
    302304    tmp.id = info.id;
     
    452454    var info = this.rna.info;
    453455    var warningMsg = null;
    454     if (info && info.id && !this.rna.stratagene)
     456    if (info && info.id && !this.rna.stratagene && !this.rna.external)
    455457    {
    456458      var quantity = 10000 * (this.rna.qc ? QUANTITY_QC : QUANTITY_REGULAR);
     
    613615function setToStratagene()
    614616{
     617  setToSpecial(STRATAGENE_NAME, true);
     618}
     619
     620/**
     621  Add 'External RNA' to the selected wells.
     622*/
     623function setToExternal()
     624{
     625  setToSpecial(EXTERNAL_RNA_NAME, false);
     626}
     627
     628/**
     629  Add special RNA to the selected wells.
     630*/
     631function setToSpecial(specialName, qc)
     632{
    615633  var wells = Plate.getSelected();
    616634 
     
    631649  if (count > 0)
    632650  {
    633     if (!confirm('Replace RNA in ' + count + ' wells with Stratagene?'))
     651    if (!confirm('Replace RNA in ' + count + ' wells with '+specialName+'?'))
    634652    {
    635653      return;
     
    637655  }
    638656 
    639   var info = Rna.infoByName(STRATAGENE_NAME);
     657  var info = Rna.infoByName(specialName);
    640658  if (!info.id)
    641659  {
    642     alert('Could not find any RNA with name=\''+STRATAGENE_NAME+'\'. Please check that it exists on the server.');
     660    alert('Could not find any RNA with name=\''+specialName+'\'. Please check that it exists on the server.');
    643661    return;
    644662  }
     
    648666    var well = wells[i];
    649667    var rna = Rna.createByInfo(info);
    650     rna.qc = true;
     668    rna.qc = qc;
    651669    well.setRna(rna);
    652670    well.selected = false;
     
    657675  if (count > 0) Plate.checkReplicates();
    658676}
     677
     678
    659679
    660680/**
     
    10821102      var well = tmp[i];
    10831103      if (well.rna && well.rna.stratagene) wells[wells.length] = well;
     1104    }
     1105  }
     1106  else if (what == 'external')
     1107  {
     1108    // All wells with 'External RNA'
     1109    var tmp = Plate.getWells();
     1110    for (var i = 0; i < tmp.length; i++)
     1111    {
     1112      var well = tmp[i];
     1113      if (well.rna && well.rna.external) wells[wells.length] = well;
    10841114    }
    10851115  }
     
    12551285  var numRna = 0;
    12561286  var numStratagene = 0;
     1287  var numExternal = 0;
    12571288  for (var i = 0; i < wells.length; i++)
    12581289  {
     
    12761307        numRna++;
    12771308        if (well.rna.stratagene) numStratagene++;
     1309        if (well.rna.external) numExternal++;
    12781310      }
    12791311    }
     
    13021334  }
    13031335 
    1304   if (numRna == numStratagene)
    1305   {
    1306     if (!confirm('There are only wells with Stratagene on this plate. Continue anyway?')) return;
     1336  if (numRna == numStratagene+numExternal)
     1337  {
     1338    if (!confirm('There are only wells with Stratagene or external RNA on this plate. Continue anyway?')) return;
    13071339  }
    13081340 
     
    14691501    <m:menuseparator />
    14701502    <m:menuitem
    1471       icon="<%=home+"/images/mrnaqc.png"%>"
     1503      icon="<%=home+"/images/stratagene.png"%>"
    14721504      title="Stratagene"
    14731505      onclick="specialToggle('stratagene')"
    14741506      tooltip="Select/deselect all wells with Stratagene"
     1507    />
     1508    <m:menuitem
     1509      icon="<%=home+"/images/external.png"%>"
     1510      title="External"
     1511      onclick="specialToggle('external')"
     1512      tooltip="Select/deselect all wells with external RNA"
    14751513    />
    14761514    <m:menuitem
     
    16101648          onclick="setToStratagene()"
    16111649          tooltip="Place stratagene in the selected wells"
     1650        />
     1651        <tbl:button
     1652          title="External"
     1653          image="<%=home+"/images/external.png"%>"
     1654          onclick="setToExternal()"
     1655          tooltip="Mark selected wells as used by external RNA"
    16121656        />
    16131657        <tbl:button
  • extensions/net.sf.basedb.reggie/branches/ticket-422/resources/reggie.js

    r1789 r1800  
    33
    44var STRATAGENE_NAME = 'Stratagene.r';
     5var EXTERNAL_RNA_NAME = 'External.r';
    56
    67/**
  • extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r1789 r1800  
    163163       
    164164        // Special items
    165         jsonChecks.add(checkExtract(dc, "Stratagene.r", Subtype.RNA, effectiveOptions, createIfMissing));
     165        jsonChecks.add(checkExtract(dc, "Stratagene.r", Subtype.RNA, null, effectiveOptions, createIfMissing));
     166        jsonChecks.add(checkExtract(dc, "External.r", Subtype.RNA,
     167          "This RNA is used to indicate that a bioplate location is taken by RNA not registered in BASE.", effectiveOptions, createIfMissing));
    166168       
    167169        // Plugin definitions and configurations
     
    10621064    @since 2.x
    10631065  */
    1064   public Extract createExtract(SessionControl sc, String name, Subtype subtype)
     1066  public Extract createExtract(SessionControl sc, String name, Subtype subtype, String description)
    10651067  {
    10661068    Extract extract = null;
     
    10711073      extract.setName(name);
    10721074      extract.setItemSubtype(subtype.get(dc));
     1075      extract.setDescription(description);
    10731076      dc.saveItem(extract);
    10741077      dc.commit();
     
    10951098  */
    10961099  @SuppressWarnings("unchecked")
    1097   public JSONObject checkExtract(DbControl dc, String name, Subtype subtype, PermissionOptions permissions,
     1100  public JSONObject checkExtract(DbControl dc, String name, Subtype subtype, String description, PermissionOptions permissions,
    10981101    boolean createIfMissing)
    10991102  {
     
    11171120      if (createIfMissing)
    11181121      {
    1119         Extract extract = createExtract(dc.getSessionControl(), name, subtype);
     1122        Extract extract = createExtract(dc.getSessionControl(), name, subtype, description);
    11201123        json.put("id", extract.getId());
    11211124        json.put("status", "ok");
Note: See TracChangeset for help on using the changeset viewer.