Changeset 1548


Ignore:
Timestamp:
Mar 6, 2012, 10:56:29 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #365: Export bioplate information to a file that can be used by the Caliper machine

  • Fixed an issue with empty wells causing a NPE.
  • Make sure that commas are removed from sample names
Location:
extensions/net.sf.basedb.reggie/trunk
Files:
1 added
2 edited

Legend:

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

    r1545 r1548  
    5757  if (frm.bioPlates.length == 0)
    5858  {
    59     var url = getRoot() + 'biomaterials/bioplates/index.jsp?ID=<%=ID%>';
    6059    var msg = 'Could not find any bioplates to export.';
    61     msg += 'Tip! You can run the exporter for any bioplate from the regular bioplate view under';
    62     msg += ' <a href="'+url+'">Biomaterial LIMS › Bioplates</a>.';
    6360    setFatalError(msg);
    6461  }
    65 
    6662}
    6763
     
    8581 
    8682  rnaQcBioPlates = response.plates;
    87  
    8883}
    8984
     
    139134        <td class="status" id="bioplates.status"></td>
    140135        <td class="help"><span id="bioplates.message" class="message" style="display: none;"></span>
    141           Select the bioplate to export sample names from.
     136          Select the bioplate to export sample names from.
     137          <p>
     138          The list contain RNAQC bioplates which has not had quality score data imported yet
     139          (determined by absense of QCRunDate annotation).
     140          <p>
     141          Tip! You can run the exporter for any bioplate as a regular plug-in by selecting
     142          a bioplate from the list at <a
     143          href="<%=request.getContextPath()%>/biomaterials/bioplates/index.jsp?ID=<%=ID%>"
     144          >Biomaterial LIMS › Bioplates</a> and then use the <b>Export</b> button.
    142145        </td>
    143146      </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/CaliperSampleNameExporter.java

    r1544 r1548  
    3434import net.sf.basedb.core.query.Hql;
    3535import net.sf.basedb.core.query.Orders;
    36 import net.sf.basedb.core.query.Restrictions;
    3736import net.sf.basedb.util.export.TableWriter;
    3837
     
    272271    //Query to get all non-empty wells on the plate
    273272    ItemQuery<BioWell> query = plate.getBioWells();
    274     query.restrict(Restrictions.neq(Hql.property("bioMaterial"), null));
     273    // Load only non-empty wells
     274    query.join(Hql.innerJoin(null, "bioMaterial", "bm", true));
    275275    query.order(Orders.asc(Hql.property("row")));
    276276    query.order(Orders.asc(Hql.property("column")));
     
    280280    tw.setDataSeparator(","); // CSV file
    281281    tw.setNullValue("");
    282     // TODO - escape of bad characters ??
    283     // we do not expect comma (,) to appear in the sample names, but it will mess up the export
    284     //tw.setEncoder(encoder);
     282    // Get rid of "bad" characters (comma, tab, newline, etc.)
     283    tw.setEncoder(new CsvEncoderDecoder());
    285284   
    286285    Iterator<BioWell> it = query.iterate(dc);
Note: See TracChangeset for help on using the changeset viewer.