Changes between Version 8 and Version 9 of Ticket #801, comment 169


Ignore:
Timestamp:
Jan 12, 2016, 8:26:44 AM (6 years ago)
Author:
olle
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #801, comment 169

    v8 v9  
    77 * The wizards in question already allow a library preparation dilution protocol to be created. This is implemented by defining an action coupled to an external JSP file to a form tag in the JSP file for the wizard. Adding another action is not simple. One solution is to let the second JSP file and its related javascript file handle creation of different types of protocols, controlled by values of different attributes. Another solution, which was selected here, is to define a form tag with a new name for the new protocol. The design of the lab protocol for library preparation is based on Reggie wizard `libprep_protocol.jsp` with lab protocol JSP file `libprep_protocol2.jsp`, that allows the protocol to contain either a list view or a plate view. However, the Reggie version assumes that the library plate already has been defined and data for it stored in the database, and the views indicate different barcode variants, instead of index primers determined by the well position. Substantial modifications of the data transfer part was therefore needed, while much of the layout creation has been maintained.
    88 * When calling `JSON.stringify(submitInfo)` for JSONObject `submitInfo` to obtain string to store in hidden form field, problems with circular references occurred. This was fixed by instead calling `JSON.stringify(submitInfo, circular_reference_remover)`, where second argument is a new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object. This solution was suggested in web page concerned with "JSON.stringify, avoid !TypeError: Converting circular structure to JSON" at URL http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json.
     9 * Wizards "Create new start DNA plate" and "Inspect start DNA plate" are very similar in the parts displaying start data, but the JSP/javascript code has some unnecessary differences, which should be rectified for clarity:[[BR]]a. JSP file `select_dna_for_start_plate.jsp` and javascript file `select_dna_for_start_plate.js` in `resources/libprep/` should be updated by exchangling tag id "`tsLibPrepKitNo`" for start plate library preparation kit name for "`tsLibPrepKit`".[[BR]]b. Javascript `inspect_start_plate.js` in `resources/libprep/` updated in function `plateInfoLoaded(response)` by setting plate name to name in response data.
    910
    1011Design update:
    1112
    12  1. JSP file `inspect_start_plate.jsp` in `resources/libprep/` updated:[[BR]]a. Links for creating a lab protocol in either list view or plate view inserted below the plate layout, above the button for creating a library preparation file for the Illumina MiSeq software.[[BR]]b. A new form tag with name "`meludi2`" added, with an action coupled to new external JSP file `libprep_plate_protocol2.jsp`.
    13  2. Javascript file `inspect_start_plate.js` in `resources/libprep/` updated:[[BR]]a. Function `initPage()` updated by adding event handlers for clicks on new lab protocol links coupled to new function `viewProtocol()`. Also removal of unused code.[[BR]]b. Function `plateInfoLoaded(response)` updated by setting plate name to name in response data.[[BR]]c. Function `downloadLibPrepFile()` updated by obtaining bioplate data for submit info by calling new function `fetchBioplateData()`.[[BR]]d. New function `fetchBioplateData()` added. It contains code previously in function `downloadLibPrepFile()`, in order to make it available to other functions.[[BR]]e. Function `createProtocol()` updated by obtaining submit info for bioplate by calling new function `fetchSubmitInfo()`. Call of function `JSON.stringify(submitInfo)` to obtain string to store in hidden form field exchanged for call of function `JSON.stringify(submitInfo, circular_reference_remover)`, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object.[[BR]]f. New function `fetchSubmitInfo()` added. It contains code previously in function `createProtocol()`, in order to make it available to other functions.[[BR]]g. New function `viewProtocol(event)` added. It calls new function `fetchBioplateData()` to obtain bioplate data for submit info, and new function `fetchSubmitInfo()` to obtain rest of the submit info. Function `JSON.stringify(submitInfo, circular_reference_remover)` is called to obtain string to store in hidden form field, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object. Data is stored in hidden fields for form with name "`meludi2`", after which `frm.submit()` is called to change action to JSP file `libprep_plate_protocol2.jsp`.[[BR]]h. New function `circular_reference_remover(key, value)` added. It removes any circular references in input JSON object, relying on global JSONArray `circular_reference_cache`, that should be set to `null`, after each call to `JSON.stringify(JSONJObject, circular_reference_remover)`.
    14  3. New JSP file `libprep_plate_protocol2.jsp` in `resources/libprep/` added. Start plate name, description, library preparation kit name, pool schema, and JSONArray with data for DNA aliquots in wells are retrieved from request parameters, after which a list or plate view HTML layout is created for a plate with 8x12 wells. The JSP file is coupled to new javascript file `libprep_plate_protocol.js` in `resources/libprep/`.
    15  4. New javascript file `libprep_plate_protocol.js` in `resources/libprep/` added.[[BR]]a. Function `initializeProtocol(submitInfoJsonStr)` obtains data for the DNA items on the plate and then calls either function `viewAsList(list)` or `viewAsPlate(list, schema)`, depending on the value of attribute `view`.[[BR]]b. Function `viewAsList(list)` calls function `libListEntry(lib)` for each aliquot in the input item list, in order to create a list of data for the wells on the start plate.[[BR]]c. Function `viewAsPlate(list, schema)` sets plate extracts for wells for each aliquot in the input item list, after which `Plate.paint(Plate.getWells())` is called to draw a plate view of the start plate.[[BR]]d. Function `painter.getClassNameForWell(well, schema)` sets the background for a well to `green` for FPA aliquots, and `blue` for FPB aliquots.[[BR]]e. Function `painter.getWellText(well, schema)` calls function `painter.fetchPlateViewAliquotName(name)` to obtain a compressed aliquot name to display for a well, prints the DNA and water dilution volumes, with optional highlight for low DNA volume, and prints Illumina index 1 and 2 primers for each well.[[BR]]f. Function `painter.fetchPlateViewAliquotName(name)` returns a compressed aliquot name by concatenating the parts before first dot and after last dot and convert to uppercase.
     13 1. JSP file `select_dna_for_start_plate.jsp` in `resources/libprep/` updated:[[BR]]a. Links for creating a lab protocol in either list view or plate view inserted below the plate layout, above the button for creating a library preparation file for the Illumina MiSeq software.[[BR]]b. A new form tag with name "`meludi2`" added, with an action coupled to new external JSP file `libprep_plate_protocol2.jsp`.[[BR]]c. Tag id "`tsLibPrepKitNo`" for start plate library preparation kit exchanged for "`tsLibPrepKit`".
     14 2. Javascript file `select_dna_for_start_plate.js` in `resources/libprep/` updated:[[BR]]a. Function `initPage()` updated by adding event handlers for clicks on new lab protocol links coupled to new function `viewProtocol()`. Also removal of unused code.[[BR]]b. Function `downloadLibPrepFile()` updated by obtaining bioplate data for submit info by calling new function `fetchBioplateData()`.[[BR]]c. New function `fetchBioplateData()` added. It contains code previously in function `downloadLibPrepFile()`, in order to make it available to other functions.[[BR]]d. Function `createProtocol()` updated by obtaining submit info for bioplate by calling new function `fetchSubmitInfo()`. Call of function `JSON.stringify(submitInfo)` to obtain string to store in hidden form field exchanged for call of function `JSON.stringify(submitInfo, circular_reference_remover)`, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object.[[BR]]e. New function `fetchSubmitInfo()` added. It contains code previously in function `createProtocol()`, in order to make it available to other functions.[[BR]]f. New function `viewProtocol(event)` added. It calls new function `fetchBioplateData()` to obtain bioplate data for submit info, and new function `fetchSubmitInfo()` to obtain rest of the submit info. Function `JSON.stringify(submitInfo, circular_reference_remover)` is called to obtain string to store in hidden form field, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object. Data is stored in hidden fields for form with name "`meludi2`", after which `frm.submit()` is called to change action to JSP file `libprep_plate_protocol2.jsp`.[[BR]]g. New function `circular_reference_remover(key, value)` added. It removes any circular references in input JSON object, relying on global JSONArray `circular_reference_cache`, that should be set to `null`, after each call to `JSON.stringify(JSONJObject, circular_reference_remover)`.[[BR]]h. Tag id "`tsLibPrepKitNo`" for start plate library preparation kit exchanged for "`tsLibPrepKit`".
     15 3. JSP file `inspect_start_plate.jsp` in `resources/libprep/` updated:[[BR]]a. Links for creating a lab protocol in either list view or plate view inserted below the plate layout, above the button for creating a library preparation file for the Illumina MiSeq software.[[BR]]b. A new form tag with name "`meludi2`" added, with an action coupled to new external JSP file `libprep_plate_protocol2.jsp`.
     16 4. Javascript file `inspect_start_plate.js` in `resources/libprep/` updated:[[BR]]a. Function `initPage()` updated by adding event handlers for clicks on new lab protocol links coupled to new function `viewProtocol()`. Also removal of unused code.[[BR]]b. Function `downloadLibPrepFile()` updated by obtaining bioplate data for submit info by calling new function `fetchBioplateData()`.[[BR]]c. New function `fetchBioplateData()` added. It contains code previously in function `downloadLibPrepFile()`, in order to make it available to other functions.[[BR]]d. Function `createProtocol()` updated by obtaining submit info for bioplate by calling new function `fetchSubmitInfo()`. Call of function `JSON.stringify(submitInfo)` to obtain string to store in hidden form field exchanged for call of function `JSON.stringify(submitInfo, circular_reference_remover)`, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object.[[BR]]e. New function `fetchSubmitInfo()` added. It contains code previously in function `createProtocol()`, in order to make it available to other functions.[[BR]]f. New function `viewProtocol(event)` added. It calls new function `fetchBioplateData()` to obtain bioplate data for submit info, and new function `fetchSubmitInfo()` to obtain rest of the submit info. Function `JSON.stringify(submitInfo, circular_reference_remover)` is called to obtain string to store in hidden form field, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object. Data is stored in hidden fields for form with name "`meludi2`", after which `frm.submit()` is called to change action to JSP file `libprep_plate_protocol2.jsp`.[[BR]]g. New function `circular_reference_remover(key, value)` added. It removes any circular references in input JSON object, relying on global JSONArray `circular_reference_cache`, that should be set to `null`, after each call to `JSON.stringify(JSONJObject, circular_reference_remover)`.[[BR]]h. Function `plateInfoLoaded(response)` updated by setting plate name to name in response data.
     17 5. New JSP file `libprep_plate_protocol2.jsp` in `resources/libprep/` added. Start plate name, description, library preparation kit name, pool schema, and JSONArray with data for DNA aliquots in wells are retrieved from request parameters, after which a list or plate view HTML layout is created for a plate with 8x12 wells. The JSP file is coupled to new javascript file `libprep_plate_protocol.js` in `resources/libprep/`.
     18 6. New javascript file `libprep_plate_protocol.js` in `resources/libprep/` added.[[BR]]a. Function `initializeProtocol(submitInfoJsonStr)` obtains data for the DNA items on the plate and then calls either function `viewAsList(list)` or `viewAsPlate(list, schema)`, depending on the value of attribute `view`.[[BR]]b. Function `viewAsList(list)` calls function `libListEntry(lib)` for each aliquot in the input item list, in order to create a list of data for the wells on the start plate.[[BR]]c. Function `viewAsPlate(list, schema)` sets plate extracts for wells for each aliquot in the input item list, after which `Plate.paint(Plate.getWells())` is called to draw a plate view of the start plate.[[BR]]d. Function `painter.getClassNameForWell(well, schema)` sets the background for a well to `green` for FPA aliquots, and `blue` for FPB aliquots.[[BR]]e. Function `painter.getWellText(well, schema)` calls function `painter.fetchPlateViewAliquotName(name)` to obtain a compressed aliquot name to display for a well, prints the DNA and water dilution volumes, with optional highlight for low DNA volume, and prints Illumina index 1 and 2 primers for each well.[[BR]]f. Function `painter.fetchPlateViewAliquotName(name)` returns a compressed aliquot name by concatenating the parts before first dot and after last dot and convert to uppercase.