Changeset 1946


Ignore:
Timestamp:
Apr 19, 2013, 3:48:04 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #424: Select RNA items for library preparation

Added support for manually flagging an RNA item.

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

Legend:

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

    r1942 r1946  
    145145    }
    146146    return true;
     147  }
     148 
     149  rna.flag = function(r, flag)
     150  {
     151    if (!r.info || r.info.flag) return false;
     152    r.info.flag = flag;
     153    flagged[flagged.length] = r.info;
    147154  }
    148155 
     
    253260        text += '<div class="comment">'+Main.encodeTags(rna.comment)+'</div>';
    254261      }
     262      if (info && info.comment)
     263      {
     264        text += '<div class="comment">'+Main.encodeTags(info.comment)+'</div>';
     265      }
    255266      if (warningMsg)
    256267      {
     
    751762  Plate.paint(wells);
    752763}
     764
     765//Flag the selected RNA
     766function flagSelected(flag)
     767{
     768  var wells = Plate.getSelected();
     769 
     770  if (wells.length == 0)
     771  {
     772    alert('No wells have been selected');
     773    return;
     774  }
     775 
     776  var comment = null;
     777  if (flag == 'ManualFlag')
     778  {
     779    // Check if a comment has been set on any of the RNA
     780    for (var i = 0; i < wells.length; i++)
     781    {
     782      var well = wells[i];
     783      if (well.extract && well.extract.info)
     784      {
     785        if (well.extract.info.comment) comment = well.extract.info.comment;
     786      }
     787    }
     788    comment = prompt('Comment', comment || '');
     789  }
     790 
     791  var count = 0;
     792  for (var i = 0; i < wells.length; i++)
     793  {
     794    var well = wells[i];
     795    var rna = well.extract;
     796    if (rna && !rna.stratagene && !rna.external)
     797    {
     798      Rna.flag(rna, flag);
     799      rna.info.comment = comment;
     800      well.setExtract(null);
     801      count++;
     802    }
     803    well.selected = false;
     804  }
     805 
     806  updateNumFlaggedRna();
     807  Plate.paint(wells);
     808}
     809
    753810
    754811/**
     
    11571214{
    11581215  var frm = document.forms['reggie'];
    1159   var showContext = false;
    1160  
    1161   if (frm.contextMenu[0].checked)
    1162   {
    1163     // Context menu on 'right' mouse button
    1164     // Can't just check the button since two events are sent ('mouseup' and 'contextmenu')
    1165     showContext = event.type == 'contextmenu' && event.button == 2;
    1166   }
    1167   else
    1168   {
    1169     // Context menu on 'middle' mouse button
    1170     showContext = event.button == 1;
    1171   }
     1216  // Context menu on 'right' mouse button
     1217  // Can't just check the button since two events are sent ('mouseup' and 'contextmenu')
     1218  var showContext = event.type == 'contextmenu' && event.button == 2;
    11721219 
    11731220  if (showContext)
     
    12581305    tmp.id = rna.id;
    12591306    tmp.flag = rna.flag;
     1307    tmp.comment = rna.comment;
    12601308    flaggedRnaInfo[flaggedRnaInfo.length] = tmp;
    12611309  }
     
    13381386
    13391387  var flagged = Rna.getFlagged();
    1340   Main.openPopup('show_flagged_rna.jsp?ID=<%=ID%>&numFlagged='+flagged.length+'&numSelected='+currentSelected.length, 'FlaggedRna', 700, 500);
     1388  Main.openPopup('show_flagged_rna.jsp?ID=<%=ID%>&numFlagged='+flagged.length+'&numSelected='+currentSelected.length, 'FlaggedRna', 800, 500);
    13411389}
    13421390
     
    15391587      tooltip="Add a comment to the selected wells"
    15401588    />
     1589    <m:menuitem
     1590      title="Toggle QC"
     1591      icon="<%=home+"/images/mrnaqc.png"%>"
     1592      onclick="toggleQc()"
     1593      tooltip="Select/deselect RNA for QC"
     1594    />
    15411595    <m:menuseparator />
    15421596    <m:menuitem
     
    15651619    />
    15661620    <m:menuseparator />
     1621    <m:submenu
     1622      subid="flagMenu"
     1623      title="Flag"
     1624      icon="<%=home+"/images/flag.png"%>"
     1625    />
     1626  </m:menu>
     1627
     1628  <m:menu
     1629    id="flagMenu"
     1630    style="display: none;"
     1631    >
    15671632    <m:menuitem
    1568       title="Toggle QC"
    1569       icon="<%=home+"/images/mrnaqc.png"%>"
    1570       onclick="toggleQc()"
    1571       tooltip="Select/deselect RNA for QC"
     1633      title="LowQualityScore"
     1634      onclick="flagSelected('LowQualityScore')"
     1635      tooltip="Flag the selected RNA"
     1636    />
     1637    <m:menuitem
     1638      title="NotEnoughRemainingQuantity"
     1639      onclick="flagSelected('NotEnoughRemainingQuantity')"
     1640      tooltip="Flag the selected RNA"
     1641    />
     1642    <m:menuitem
     1643      title="Other..."
     1644      onclick="flagSelected('ManualFlag')"
     1645      tooltip="Flag the selected RNA"
    15721646    />
    15731647  </m:menu>
     
    16051679        <td class="help">
    16061680          Select the Stratagene tube to use. If not known, the
    1607           generic <b>Stratagene.r</b> (last in the list) should be used.
     1681          generic <b>Stratagene.r</b> should be used.
    16081682        </td>
    16091683      </tr>
     
    16531727        <td class="status"></td>
    16541728        <td class="help">Toggles visiblity of the selected information inside each well on the plate.</td>
    1655       </tr>
    1656       <tr style="vertical-align: top;">
    1657         <td class="prompt">Context menu</td>
    1658         <td class="input">
    1659           <input type="radio" name="contextMenu" id="contextMenuRight" checked><label for="contextMenuRight">Right</label>
    1660           <input type="radio" name="contextMenu" id="contextMenuMiddle"><label for="contextMenuMiddle">Middle</label> mouse button<br>
    1661           <br>
    1662         </td>
    1663         <td class="status"></td>
    1664         <td class="help">Use the selected mouse button to display a context-menu when clicking on the plate.</td>
    16651729      </tr>
    16661730      </table>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/show_flagged_rna.jsp

    r1940 r1946  
    4848    document.getElementById('remainingQuantity.'+i).innerHTML = rna.remainingQuantity;
    4949    document.getElementById('qualityScore.'+i).innerHTML = rna.rqs || rna.rin;
     50    document.getElementById('comment.'+i).innerHTML = rna.comment;
    5051    document.getElementById('flag.'+i).innerHTML = rna.flag;
    5152    if (rna.flag == 'NotEnoughRemainingQuantity')
     
    5657    {
    5758      makeBold('qualityScore.'+i)
     59    }
     60    else
     61    {
     62      makeBold('comment.'+i);
    5863    }
    5964    frm['use.'+i].rna = rna;
     
    101106    <tbl:columndef id="remainingQuanity" title="Remaining (µg)" />
    102107    <tbl:columndef id="qualityScore" title="RQS/RIN" />
     108    <tbl:columndef id="comment" title="Comment" />
    103109    <tbl:columndef id="flag" title="Flag" />
    104110 
     
    121127          <tbl:cell column="remainingQuanity" id="<%="remainingQuantity."+i%>"></tbl:cell>
    122128          <tbl:cell column="qualityScore" id="<%="qualityScore."+i%>"></tbl:cell>
     129          <tbl:cell column="comment" id="<%="comment."+i%>"></tbl:cell>
    123130          <tbl:cell column="flag" id="<%="flag."+i%>"></tbl:cell>
    124131        </tbl:row>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Rna.java

    r1941 r1946  
    4747  */
    4848  public static final String FLAG_LOW_QUALITY_SCORE = "LowQualityScore";
     49
     50  /**
     51    Flag value for the {@link Annotationtype#FLAG} annotation when a RNA
     52    has been manually flagged for some other reason. The desription of
     53    the RNA item should contain more information.
     54    @since 2.12
     55  */
     56  public static final String FLAG_MANUAL = "ManualFlag";
    4957 
    5058  /**
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r1943 r1946  
    233233        jsonChecks.add(checkAnnotationType(dc, Annotationtype.FLAG, 1,
    234234            new ValueOptions(Rna.FLAG_NOT_ENOUGH_REMAINING_QUANTITY, Rna.FLAG_LOW_QUALITY_SCORE,
     235              Rna.FLAG_MANUAL,
    235236              Rna.FLAG_MRNA_PLATE_FAILED, Rna.FLAG_CDNA_PLATE_FAILED, Rna.FLAG_LIB_PLATE_FAILED),
    236237            effectiveOptions, createIfMissing));
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java

    r1940 r1946  
    243243          r.setAnnotation("remainingQuantity", r.getExtract().getRemainingQuantity());
    244244          r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
     245          r.setAnnotation("comment", r.getExtract().getDescription());
    245246          jsonRna.add(r.asJSONObject());
    246247        }
     
    460461            Number rnaId = (Number)jsonRna.get("id");
    461462            Extract rna = Extract.getById(dc, rnaId.intValue());
     463            rna.setDescription((String)jsonRna.get("comment"));
    462464           
    463465            // Safety check in case a flagged RNA is also on the plate
Note: See TracChangeset for help on using the changeset viewer.