Changeset 1643
- Timestamp:
- May 11, 2012, 2:49:35 PM (11 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/allprep_protocol.jsp
r1639 r1643 32 32 33 33 <script language="JavaScript"> 34 var debug = true;34 var debug = false; 35 35 var currentStep = 1; 36 36 var lysatesIsValid = false; … … 188 188 <table style="margin-left: 20px; margin-top: 10px;" class="navigation" id="navigation"> 189 189 <tr> 190 <td><base:button id="gocreate" title=" Next" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" /></td>190 <td><base:button id="gocreate" title="Finish" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" /></td> 191 191 <td id="gonext.message" class="message"></td> 192 192 </tr> -
extensions/net.sf.basedb.reggie/trunk/resources/extraction_registration.jsp
r1642 r1643 55 55 .nondefault 56 56 { 57 background: #FFF F66;57 background: #FFF066; 58 58 } 59 59 .nondefault:after … … 75 75 var DEFAULT_FT_VOLUME = 550; 76 76 77 var debug = true;77 var debug = false; 78 78 var currentStep = 1; 79 79 … … 399 399 function editDnaRnaDetails(index) 400 400 { 401 if (currentStep != 3) return; 401 402 var url = 'edit_dnarna_details.jsp?ID=<%=ID%>&index='+index; 402 403 url += '&lysate=' + selectedLysates[index].name; … … 421 422 hasQiacubePosition[lysate.qiacubePosition] = true; 422 423 } 424 425 // Calculate NanoDrop well from Qiacube position 426 var row; 427 var col; 428 if (lysate.qiacubePosition > 8) 429 { 430 row = lysate.qiacubePosition - 9; 431 col = 2; 432 } 433 else 434 { 435 row = lysate.qiacubePosition - 1; 436 col = 1; 437 } 438 lysate.dna.well = WELL_ALPHA[row] + col; 439 lysate.rna.well = WELL_ALPHA[row] + (col+2); 440 423 441 setInnerHTML('lysateTotal'+i, lysate.originalQuantity); 424 442 addOrRemoveClass('lysateTotal'+i, 'nondefault', lysate.originalQuantity != DEFAULT_LYSATE_VOLUME); … … 448 466 { 449 467 setInputStatus('details', 'Duplicate Qiacube position: ' + duplicatePosition, 'invalid'); 450 // Main.show('tableError');451 // setInnerHTML('tableError', 'Duplicate Qiacube position: ' + duplicatePosition);452 468 qiacubePositionsAreValid = false; 453 469 } … … 455 471 { 456 472 setInputStatus('details', '', ''); 457 //Main.hide('tableError');458 473 qiacubePositionsAreValid = true; 459 474 } … … 474 489 Main.hide('gocancel'); 475 490 Main.addClass(document.getElementById('step.3.section'), 'disabled'); 491 currentStep = 4; 476 492 477 493 var submitInfo = new Object(); … … 489 505 490 506 var request = Ajax.getXmlHttpRequest(); 491 var url = 'Extraction.servlet?ID=<%=ID%>&cmd=RegisterDnaRnaFt'; 492 request.open("POST", url, false); 493 request.setRequestHeader("Content-Type", "application/json"); 494 request.send(JSON.stringify(submitInfo)); 495 507 try 508 { 509 showLoadingAnimation('Working...'); 510 var url = 'Extraction.servlet?ID=<%=ID%>&cmd=RegisterDnaRnaFt'; 511 request.open("POST", url, false); 512 request.setRequestHeader("Content-Type", "application/json"); 513 request.send(JSON.stringify(submitInfo)); 514 } 515 finally 516 { 517 hideLoadingAnimation(); 518 } 519 496 520 if (debug) Main.debug(request.responseText); 497 521 … … 610 634 611 635 function downloadSampleIdFile() 612 { 636 { 637 if (!qiacubePositionsAreValid) 638 { 639 alert('Qiacube positions are not valid. Please fix before downloading the file.'); 640 return; 641 } 642 643 var lysateNames = new Array(); 613 644 var frm = document.forms['reggie']; 614 645 var url = 'Extraction.servlet?ID=<%=ID%>&cmd=DownloadNanoDropSampleIdFile'; 615 646 url += '&qiacubeDate='+frm.qiacubeDate.value; 616 647 url += '&qiacubeRunNo='+frm.qiacubeRunNo.value; 617 url += '&lysateNames='; 618 var separator = ''; 648 619 649 for (var i = 0; i < selectedLysates.length; i++) 620 650 { 621 url += separator + selectedLysates[i].name; 622 separator = ','; 623 } 651 var lysate = selectedLysates[i]; 652 lysateNames[lysate.qiacubePosition-1] = lysate.name; 653 } 654 url += '&lysateNames=' + lysateNames.join(','); 624 655 window.location = url; 625 656 } … … 640 671 function nanoDropFileLoaded(event) 641 672 { 642 var lines = event.target.result.split(/\n/); 643 var columns = lines[0].split(/\s*\t\s*/); 644 645 var sampleIndex = findColumn(columns, 'Sample ID'); 646 if (sampleIndex == -1) return; 647 648 var ndConcIndex = findColumn(columns, 'Conc.'); 649 if (ndConcIndex == -1) return; 650 651 var nd260by280Index = findColumn(columns, '260/280'); 652 if (nd260by280Index == -1) return; 653 654 var nd260by230Index = findColumn(columns, '260/230'); 655 if (nd260by230Index == -1) return; 656 657 Main.debug('Sample ID='+sampleIndex + '; NDConc='+ndConcIndex + '; 260/280='+ nd260by280Index + '; 260/230='+nd260by230Index); 658 659 for (var i = 1; i < lines.length; i++) 660 { 661 var row = lines[i].split(/\s*\t\s*/); 662 if (row.length != columns.length) continue; // with the next line 663 664 var sampleId = row[sampleIndex]; 665 if (!sampleId || sampleId == 'blank') continue; // with the next line 666 667 var rnaOrDna = findRnaOrDna(sampleId, i+1); 668 if (!rnaOrDna) return; // This is an error condition 669 670 var ndConc = getNumber(row[ndConcIndex]); 671 // If there are multiple entries for the same item, keep the largest NDConc 672 if (!rnaOrDna.ndConc || ndConc > rnaOrDna.ndConc) 673 { 674 rnaOrDna.ndConc = ndConc; 675 rnaOrDna.nd260by280 = getNumber(row[nd260by280Index]); 676 rnaOrDna.nd260by230 = getNumber(row[nd260by230Index]); 677 } 678 } 679 680 setInputStatus('nanoDropFile', '', 'valid'); 681 nanoDropFileIsValid = true; 682 683 updateDetailsTable(); 673 nanoDropFileIsValid = false; 674 675 try 676 { 677 // Reset the existing values 678 for (var i = 0; i < selectedLysates.length; i++) 679 { 680 var lysate = selectedLysates[i]; 681 lysate.dna.ndConc = null; 682 lysate.dna.nd260by280 = null; 683 lysate.dna.nd260by230 = null; 684 lysate.rna.ndConc = null; 685 lysate.rna.nd260by280 = null; 686 lysate.rna.nd260by230 = null; 687 } 688 689 var lines = event.target.result.split(/\n/); 690 var columns = lines[0].split(/ *\t */); 691 692 var sampleIndex = findColumn(columns, 'Sample ID'); 693 if (sampleIndex == -1) return; 694 695 var wellIndex = findColumn(columns, 'Well'); 696 if (wellIndex == -1) return; 697 698 var ndConcIndex = findColumn(columns, 'Conc.'); 699 if (ndConcIndex == -1) return; 700 701 var nd260by280Index = findColumn(columns, '260/280'); 702 if (nd260by280Index == -1) return; 703 704 var nd260by230Index = findColumn(columns, '260/230'); 705 if (nd260by230Index == -1) return; 706 707 var numImported = 0; 708 for (var i = 1; i < lines.length; i++) 709 { 710 if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines 711 712 var row = lines[i].split(/ *\t */); 713 if (row.length != columns.length) 714 { 715 setInputStatus('nanoDropFile', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length); 716 return; 717 } 718 719 var sampleId = row[sampleIndex]; 720 if (!sampleId || sampleId == 'blank') continue; // with the next line 721 722 var rnaOrDna = findRnaOrDna(sampleId, i+1); 723 if (!rnaOrDna) return; // This is an error condition 724 725 if (rnaOrDna.well != row[wellIndex]) 726 { 727 setInputStatus('nanoDropFile', 'On line ' + (i+1) + '; Expected to find "' + sampleId + '" in well [' + rnaOrDna.well + '] not [' + row[wellIndex] + ']', 'invalid'); 728 return; 729 } 730 731 var ndConc = getNumber(row[ndConcIndex]); 732 if (!ndConc) 733 { 734 setInputStatus('nanoDropFile', 'On line ' + (i+1) + '; No NDConc value for "' + sampleId + '"', 'invalid'); 735 return; 736 } 737 738 // If there are multiple entries for the same item, keep the largest NDConc 739 if (!rnaOrDna.ndConc || ndConc > rnaOrDna.ndConc) 740 { 741 rnaOrDna.ndConc = ndConc; 742 rnaOrDna.nd260by280 = getNumber(row[nd260by280Index]); 743 if (!rnaOrDna.nd260by280) 744 { 745 setInputStatus('nanoDropFile', 'On line ' + (i+1) + '; No 260/280 value for "' + sampleId + '"', 'invalid'); 746 return; 747 } 748 749 rnaOrDna.nd260by230 = getNumber(row[nd260by230Index]); 750 if (!rnaOrDna.nd260by230) 751 { 752 setInputStatus('nanoDropFile', 'On line ' + (i+1) + '; No 260/230 value for "' + sampleId + '"', 'invalid'); 753 return; 754 } 755 756 numImported++; 757 } 758 759 } 760 761 if (numImported != 24) 762 { 763 setInputStatus('nanoDropFile', 'Could not find values for all 24 samples: ' + numImported, 'invalid'); 764 return; 765 } 766 767 setInputStatus('nanoDropFile', '', 'valid'); 768 nanoDropFileIsValid = true; 769 } 770 finally 771 { 772 updateDetailsTable(); 773 } 684 774 685 775 } … … 691 781 if (colIndex == -1) 692 782 { 693 setInputStatus('nanoDropFile', ' Can\'t find "' + col + '" column', 'invalid');783 setInputStatus('nanoDropFile', 'On line 1; Can\'t find "' + col + '" column', 'invalid'); 694 784 } 695 785 return colIndex; … … 716 806 } 717 807 718 setInputStatus('nanoDropFile', ' Can\'t find RNA/DNA with name "' + sampleId + "' on line " + lineNo, 'invalid');808 setInputStatus('nanoDropFile', 'On line ' + lineNo + '; Can\'t find RNA/DNA with name "' + sampleId + '"', 'invalid'); 719 809 } 720 810 … … 876 966 <tr> 877 967 <td rowspan="2" class="stepno">3</td> 878 <td class="steptitle">RNA/DNA/FlowThro guh details</td>968 <td class="steptitle">RNA/DNA/FlowThrough details</td> 879 969 </tr> 880 970 <tr> 881 971 <td class="stepfields"> 972 <div style="background: #E8E8E8; padding: 2px; border-bottom: 1px dotted #A0A0A0;"> 973 The table below show values from the Qiacube run. 974 <span class="nondefault">Highlighted</span> values have been manually 975 changed from their default values. If the Qiacube positions are not correct, 976 they must be fixed before the <i>NanoDrop Sample ID</i> file is downloaded 977 since the order in this file depends on the positions. The concentrations 978 and other values are loaded from the file after the NanoDrop has been completed. 979 <span id="details.status" class="status"></span> 980 <span id="details.message" class="message"></span> 981 </div> 982 983 <div id="detailsSection"> 984 </div> 985 882 986 <table style="width: 100%; border-collapse: collapse;"> 883 <tr >987 <tr style="border-top: 1px dotted #A0A0A0;"> 884 988 <td class="prompt">NanoDrop Sample ID</td> 885 989 <td class="input"> … … 890 994 <td class="help"><span id="downloadSampleIdFile.message" class="message" style="display:none;"></span> 891 995 Download and import this file to the NanoDrop software before analyzing the DNA/RNA. 892 </td> 893 </tr> 894 <tr style="border-bottom: 1px dotted #A0A0A0;"> 996 <b>Note that the samples are sorted by Qiacube position!</b> 997 </td> 998 </tr> 999 <tr> 895 1000 <td class="prompt">NanoDrop values</td> 896 1001 <td class="input"> … … 903 1008 </tr> 904 1009 </table> 905 906 <div id="detailsSection">907 </div>908 909 <div style="background: #E8E8E8; padding: 2px; border-top: 1px dotted #A0A0A0;">910 <span id="details.status" class="status"></span>911 <span id="details.message" class="message"></span>912 Values inside <span class="nondefault">brackets</span> have been manually modified from their default values.913 </div>914 1010 </td> 915 1011 </tr> … … 926 1022 <td><base:button id="gocancel" title="Cancel" onclick="goRestart(false)" style="display: none;"/></td> 927 1023 <td><base:button id="gonext" title="Next" image="<%=home+"/images/gonext.png"%>" onclick="goNext(true)"/></td> 928 <td><base:button id="gocreate" title=" Save" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" style="display: none;"/></td>1024 <td><base:button id="gocreate" title="Finish" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" style="display: none;"/></td> 929 1025 <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" onclick="goRestart(true)" style="display: none;"/></td> 930 1026 <td id="gonext.message" class="message"></td> -
extensions/net.sf.basedb.reggie/trunk/resources/reggie.js
r1642 r1643 1 2 var WELL_ALPHA = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; 3 1 4 2 5 /** -
extensions/net.sf.basedb.reggie/trunk/resources/rnaqc_aliquot.jsp
r1628 r1643 45 45 46 46 var bioPlateNameIsValid = false; 47 48 var WELL_ALPHA = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];49 47 50 48 function init() -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ExtractionServlet.java
r1642 r1643 151 151 String[] lysateNames = req.getParameter("lysateNames").split(","); 152 152 153 resp.setHeader("Content-Disposition", "attachment; filename=nd-sample-id-" + qiacubeDate + "-" + qiacubeRunNo+ ". csv");154 resp.setContentType("text/ csv");153 resp.setHeader("Content-Disposition", "attachment; filename=nd-sample-id-" + qiacubeDate + "-" + qiacubeRunNo+ ".txt"); 154 resp.setContentType("text/plain"); 155 155 resp.setCharacterEncoding("UTF-8"); 156 156 … … 335 335 dc.saveItem(ft); 336 336 337 jsonMessages.add("DNA, RNA and F Tcreated from " + lysate.getName());337 jsonMessages.add("DNA, RNA and FlowThrough created from " + lysate.getName()); 338 338 } 339 339
Note: See TracChangeset
for help on using the changeset viewer.