Changeset 3532


Ignore:
Timestamp:
Oct 5, 2015, 4:23:47 PM (7 years ago)
Author:
olle
Message:

Refs #801. Refs #816. Case summary updated to present information on fpa and fpb DNA aliquot barcode tags as links to the corresponding Tag items:

  1. Javascript file case_summary.js in resources/reports/ updated in function caseInfoLoaded(response) to present fpa and fpb aliquot barcode tags as links by calling function asLink(itemType, item, maxLength).
  2. Java data access object class/file Barcode.java in src/net/sf/basedb/meludi/dao/ added. It contains among other methods one for retrieving a barcode Tag item from the database, if the name of the former is known.
  3. Java servlet class/file CaseSummaryServlet.java in src/net/sf/basedb/meludi/servlet/ updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) for command "GetCaseInfo" to send information on fpa and fpb DNA aliquot Illumina index 1 and 2 name and id in new JSON objects with keys "index1" and "index2", respectively. The barcode info is constructed based on the well location on the library plate.
Location:
extensions/net.sf.basedb.meludi/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.meludi/trunk/resources/reports/case_summary.js

    r3526 r3532  
    248248      {
    249249        var d = lib[i];
    250         var barcodeName = 'NA';
    251         if (d.barcode != null)
     250        var barcodeInfo = 'NA';
     251        if (d.index1 != null && d.index2 != null)
    252252        {
    253           barcodeName = d.barcode.name;
     253          barcodeInfo = cs.asLink('TAG', d.index2) + ',' + cs.asLink('TAG', d.index1);
    254254        }
    255255        cs.addColumn('lib.name', cs.asLink('EXTRACT', d));
     
    260260        cs.addColumn('lib.remainingQuantity', cs.asQuantity(d.remainingQuantity, ' ng', 0.001));
    261261        cs.addColumn('lib.originalQuantity', cs.asQuantity(d.originalQuantity, ' ng', 0.001));
    262         cs.addColumn('lib.barcode.name', barcodeName);
     262        cs.addColumn('lib.barcode.name', barcodeInfo);
    263263        cs.addColumn('lib.ca_size', cs.asQuantity(d.ca_size, ''));
    264264        cs.addColumn('lib.molarity', cs.asQuantity(d.library_molarity_est, ' nM'));
  • extensions/net.sf.basedb.meludi/trunk/src/net/sf/basedb/meludi/servlet/CaseSummaryServlet.java

    r3526 r3532  
    3434import net.sf.basedb.meludi.Site;
    3535import net.sf.basedb.meludi.dao.Annotationtype;
     36import net.sf.basedb.meludi.dao.Barcode;
    3637import net.sf.basedb.meludi.dao.BioplateType;
    3738import net.sf.basedb.meludi.dao.Case;
     
    248249              JSONObject jsonDnaTmp = (JSONObject) d.asJSONObject();
    249250              jsonWell = (JSONObject) jsonDnaTmp.get("bioWell");
    250               Integer row = null;
    251               Integer col = null;
     251              // Add barcode (Illumina index) info
    252252              if (jsonWell != null)
    253253              {
    254                 row = (Integer) jsonWell.get("row");
    255                 col = (Integer) jsonWell.get("column");
     254                Integer row = (Integer) jsonWell.get("row");
     255                Integer col = (Integer) jsonWell.get("column");
     256                if (row != null)
     257                {
     258                  String rowStr = "A50" + (row + 1);
     259                  Integer barcodeTagId = null;
     260                  Barcode barcode = Barcode.findByName(dc, rowStr);
     261                  if (barcode != null)
     262                  {
     263                    barcodeTagId = barcode.getTag().getId();
     264                  }
     265                  JSONObject jsonIndex2 = new JSONObject();
     266                  jsonIndex2.put("name", rowStr);
     267                  jsonIndex2.put("id", barcodeTagId);
     268                  // Add Illumina Index 2 (row) barcode info
     269                  jsonD.put("index2", jsonIndex2);
     270                }
     271                if (col != null)
     272                {
     273                  String colStr = "A70" + (col + 1);
     274                  if (col > 8)
     275                  {
     276                    colStr = "A7" + (col + 1);
     277                  }
     278                  Integer barcodeTagId = null;
     279                  Barcode barcode = Barcode.findByName(dc, colStr);
     280                  if (barcode != null)
     281                  {
     282                    barcodeTagId = barcode.getTag().getId();
     283                  }
     284                  JSONObject jsonIndex1 = new JSONObject();
     285                  jsonIndex1.put("name", colStr);
     286                  jsonIndex1.put("id", barcodeTagId);
     287                  // Add Illumina Index 1 (column) barcode info
     288                  jsonD.put("index1", jsonIndex1);
     289                }
    256290              }
    257               // Add barcode name
    258               JSONObject jsonBarcode = new JSONObject();
    259               if (row != null && col != null)
    260               {
    261                 String rowStr = "50" + (row + 1);
    262                 String colStr = "70" + (col + 1);
    263                 if (col > 8)
    264                 {
    265                   colStr = "7" + (col + 1);
    266                 }
    267                 jsonBarcode.put("name", rowStr + "," + colStr);
    268               }
    269               jsonD.put("barcode", jsonBarcode);
    270291              jsonLib.add(jsonD);
    271292            }
Note: See TracChangeset for help on using the changeset viewer.