Changeset 2202
- Timestamp:
- Jan 20, 2014, 12:43:51 PM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r2201 r2202 216 216 url = 'FlowCell.servlet?ID=<%=ID%>&cmd=CountUnprocessedFlowCells'; 217 217 } 218 else if (what == 'clustered-flow-cells') 219 { 220 url = 'FlowCell.servlet?ID=<%=ID%>&cmd=CountClusteredFlowCells'; 221 } 218 222 else if (what == 'active-sequencing-runs') 219 223 { … … 368 372 else if (currentCount == 'unregistered-flow-cells') 369 373 { 370 var msg = error || 'Number of flow cells waiting for sequencing';374 var msg = error || 'Number of flow cells waiting for clustering'; 371 375 var count = error ? -1 : response.count; 372 376 setCount('count.flow-cells.1', count, 'flow cells', msg); 373 377 setCount('count.flow-cells.2', count, 'flow cells', msg); 378 startCounting('clustered-flow-cells'); 379 } 380 else if (currentCount == 'clustered-flow-cells') 381 { 382 var msg = error || 'Number of flow cells waiting for sequencing'; 383 var count = error ? -1 : response.count; 384 setCount('count.flow-cells.3', count, 'flow cells', msg); 374 385 startCounting('active-sequencing-runs'); 375 386 } … … 652 663 653 664 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/flowcell_registration.jsp?ID=<%=ID%>" 654 >Register clustering and sequencing startup</span> <span class="counter" id="count.flow-cells.2" title="Counting..."><img src="images/loading-small.gif"></span> 665 >Register clustering</span> <span class="counter" id="count.flow-cells.2" title="Counting..."><img src="images/loading-small.gif"></span> 666 667 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/sequencing_started.jsp?ID=<%=ID%>" 668 >Register sequencing started</span> <span class="counter" id="count.flow-cells.3" title="Counting..."><img src="images/loading-small.gif"></span> 655 669 656 670 <li><span class="require-permission" data-role="LibPrep" data-link="libprep/sequencing_ended.jsp?ID=<%=ID%>" -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp
r2107 r2202 37 37 var dateIsValid = []; 38 38 var flowCellIdIsValid = []; 39 var sequencingCyclesIsValid = [];40 39 41 40 function init() … … 113 112 if (step1IsValid()) gotoStep2(); 114 113 } 115 else if (currentStep == 2)116 {117 if (step2IsValid()) gotoStep3();118 }119 setCurrentStep(currentStep);120 114 } 121 115 … … 153 147 var failed = frm.outcome[1].checked; 154 148 if (failed && !frm.verifyFailure.checked) return false; 149 150 if (!dateIsValid['clusterDate']) return false; 155 151 156 152 var index = 0; … … 161 157 var fc = frm.flowcells[i].flowCell; 162 158 if (flowCellIdIsValid['fc-'+index+'.externalId'] != true) return false; 163 if (dateIsValid['fc-'+index+'.clusterDate'] != true) return false;164 159 if (commentsIsValid['fc-'+index+'.comments'] != true) return false; 165 160 index++; … … 177 172 } 178 173 179 function step3IsValid()180 {181 if (dateIsValid['sequencingStartDate'] != true) return false;182 183 var frm = document.forms['reggie'];184 var index = 0;185 for (var i = 0; i < frm.flowcells.length; i++)186 {187 if (frm.flowcells[i].selected)188 {189 var fc = frm.flowcells[i].flowCell;190 if (sequencingCyclesIsValid['fc-'+index+'.sequencingCycles'] != true) return false;191 index++;192 }193 }194 195 return true;196 }197 174 198 175 function getFlowCells() … … 236 213 currentStep = 2; 237 214 Main.show('step.2.section'); 238 Main.hide('step.1.section');239 215 Main.addClass(document.getElementById('step.1.section'), 'disabled'); 240 216 Main.show('gocancel'); 217 218 Main.hide('gonext'); 219 Main.show('goregister'); 220 241 221 if (failed) 242 222 { 243 Main.hide('gonext');244 Main.show('goregister');245 246 223 setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure'); 247 224 Main.addClass(document.getElementById('goregister'), 'disabled'); … … 266 243 { 267 244 var cbot = cbots[i]; 268 frm['fc-0.cBot'][frm['fc-0.cBot'].length] = new Option(cbot.name, cbot.id, cbot.isDefault); 269 frm['fc-1.cBot'][frm['fc-1.cBot'].length] = new Option(cbot.name, cbot.id, cbot.isDefault); 270 setInputStatus('fc-0.cBot', '', 'valid'); 271 setInputStatus('fc-1.cBot', '', 'valid'); 245 frm.cBot[frm.cBot.length] = new Option(cbot.name, cbot.id, cbot.isDefault); 246 setInputStatus('cBot', '', 'valid'); 272 247 } 273 248 if (cbots.length == 0) 274 249 { 275 frm['fc-0.cBot'][0] = new Option('- none -', ''); 276 frm['fc-1.cBot'][0] = new Option('- none -', ''); 250 frm.cBot[0] = new Option('- none -', ''); 277 251 } 278 252 … … 299 273 Main.addClass(document.getElementById('step.2.section'), 'hide-fc-1'); 300 274 } 301 302 303 frm['fc-0.externalId'].focus(); 275 276 frm.clusterDate.focus(); 304 277 } 305 278 … … 309 282 // Disable controls 310 283 frm.clusterProtocol.disabled = true; 284 frm.clusterDate.disabled = true; 285 frm.clusterOperator.disabled = true; 286 frm.cBot.disabled = true; 311 287 frm['fc-0.externalId'].disabled = true; 312 frm['fc-0.clusterDate'].disabled = true;313 frm['fc-0.clusterOperator'].disabled = true;314 frm['fc-0.cBot'].disabled = true;315 288 frm['fc-0.comments'].disabled = true; 316 289 frm['fc-1.externalId'].disabled = true; 317 frm['fc-1.clusterDate'].disabled = true;318 frm['fc-1.clusterOperator'].disabled = true;319 frm['fc-1.cBot'].disabled = true;320 290 frm['fc-1.comments'].disabled = true; 321 322 291 Main.addClass(document.getElementById('step.2.section'), 'disabled'); 323 292 } 324 293 325 function gotoStep3()326 {327 var frm = document.forms['reggie'];328 329 disableStep2();330 Main.hide('step.2.section');331 Main.show('step.3.section');332 Main.hide('gonext');333 Main.show('goregister');334 currentStep = 3;335 336 // Load sequencing protocols337 var protocols = getProtocols('SEQUENCING_PROTOCOL');338 for (var i = 0; i < protocols.length; i++)339 {340 var protocol = protocols[i];341 frm.sequencingProtocol[frm.sequencingProtocol.length] = new Option(protocol.name, protocol.id, protocol.isDefault);342 setInputStatus('sequencingProtocol', '', 'valid');343 }344 if (frm.sequencingProtocol.length == 0)345 {346 frm.sequencingProtocol[0] = new Option('- none -', '');347 }348 349 // Load sequencing machines350 var sequencers = getHardware('SEQUENCER');351 for (var i = 0; i < sequencers.length; i++)352 {353 var sequencer = sequencers[i];354 frm.sequencer[frm.sequencer.length] = new Option(sequencer.name, sequencer.id, sequencer.isDefault);355 setInputStatus('sequencer', '', 'valid');356 }357 if (frm.sequencer.length == 0)358 {359 frm.sequencer[0] = new Option('- none -', '');360 }361 362 var index = 0;363 for (var i = 0; i < frm.flowcells.length && index < 2; i++)364 {365 if (frm.flowcells[i].selected)366 {367 var fc = frm.flowcells[i].flowCell;368 var prefix = 'fc-'+index;369 setInnerHTML(prefix+'.externalId', frm[prefix+'.externalId'].value);370 document.getElementById(prefix+'.externalId').title = fc.name;371 frm[prefix+'.sequencingCycles'].value = fc.SequencingCycles;372 sequencingCyclesOnBlur(prefix+'.sequencingCycles');373 index++;374 }375 }376 377 if (index == 1)378 {379 // Only one flow cell selected380 Main.addClass(document.getElementById('step.3.section'), 'hide-fc-1');381 }382 383 frm.sequencingStartDate.focus();384 }385 294 386 295 function getProtocols(subtype) … … 441 350 Main.addOrRemoveClass(frm['fc-0.comments'], 'required', failed); 442 351 Main.addOrRemoveClass(frm['fc-1.comments'], 'required', failed); 443 if (failed)444 {445 Main.hide('step.3.box');446 }447 else448 {449 Main.showInline('step.3.box');450 }451 352 } 452 353 … … 541 442 } 542 443 543 function sequencingCyclesOnBlur(sequencingCyclesField)544 {545 var frm = document.forms['reggie'];546 547 setInputStatus(sequencingCyclesField, '', '');548 sequencingCyclesIsValid[sequencingCyclesField] = false;549 550 var sequencingCycles = frm[sequencingCyclesField].value;551 if (sequencingCycles == '')552 {553 setInputStatus(sequencingCyclesField, 'Sequencing cycles is a required value', 'invalid');554 return;555 }556 if (!sequencingCycles.match(/^\d+\-\d+\-\d+$/))557 {558 setInputStatus(sequencingCyclesField, 'Not a valid Sequencing cycles value', 'invalid');559 return;560 }561 562 sequencingCyclesIsValid[sequencingCyclesField] = true;563 setInputStatus(sequencingCyclesField, '', 'valid');564 }565 444 566 445 … … 569 448 var failed = document.getElementById('outcomeFailed').checked; 570 449 var frm = document.forms['reggie']; 571 if (failed) 572 { 573 if (!step2IsValid()) return; 574 disableStep2(); 575 } 576 else 577 { 578 if (!step3IsValid()) return; 579 Main.addClass(document.getElementById('step.3.section'), 'disabled'); 580 frm.sequencingStartDate.disabled = true; 581 frm.sequencingOperator.disabled = true; 582 frm.sequencingProtocol.disabled = true; 583 frm.sequencer.disabled = true; 584 frm.sequencingComments.disabled = true; 585 } 450 451 if (!step2IsValid()) return; 452 disableStep2(); 586 453 587 454 Main.hide('goregister'); … … 592 459 submitInfo.failed = failed; 593 460 594 // Cluster fields595 submitInfo.clusterProtocol = parseInt(frm.clusterProtocol.value, 10);596 597 if (!failed)598 {599 // Sequence start fields600 submitInfo.sequencingStartDate = frm.sequencingStartDate.value;601 submitInfo.sequencingOperator = frm.sequencingOperator.value;602 submitInfo.sequencingProtocol = parseInt(frm.sequencingProtocol.value, 10);603 submitInfo.sequencer = parseInt(frm.sequencer.value, 10);604 submitInfo.sequencingComments = frm.sequencingComments.value;605 }606 607 461 submitInfo.flowCells = []; 608 462 var index = 0; … … 612 466 { 613 467 var fc = frm.flowcells[i].flowCell; 614 frm['fc-'+index+'.sequencingCycles'].disabled = true;615 468 fc.externalId = frm['fc-'+index+'.externalId'].value; 616 fc.clusterDate = frm['fc-'+index+'.clusterDate'].value; 617 fc.clusterOperator = frm['fc-'+index+'.clusterOperator'].value; 618 fc.cBot = parseInt(frm['fc-'+index+'.cBot'].value, 10); 469 fc.clusterDate = frm.clusterDate.value; 470 fc.clusterOperator = frm.clusterOperator.value; 471 fc.cBot = parseInt(frm.cBot.value, 10); 472 fc.clusterProtocol = parseInt(frm.clusterProtocol.value, 10); 619 473 fc.comments = frm['fc-'+index+'.comments'].value; 620 if (!failed)621 {622 fc.SequencingCycles = frm['fc-'+index+'.sequencingCycles'].value;623 fc.HiSeqPosition = Forms.getCheckedRadio(frm['fc-'+index+'.pos']).value;624 }625 474 submitInfo.flowCells[submitInfo.flowCells.length] = fc; 626 475 index++; … … 676 525 } 677 526 678 function hiseqPosOnClick(index)679 {680 var frm = document.forms['reggie'];681 682 var clicked = frm['fc-'+index+'.pos'];683 var other = frm['fc-'+(1-index)+'.pos'];684 685 other[0].checked = clicked[1].checked;686 other[1].checked = clicked[0].checked;687 688 }689 690 527 </script> 691 528 <style> … … 706 543 <p:path><p:pathelement 707 544 title="Reggie" href="<%="../index.jsp?ID="+ID%>" 708 /><p:pathelement title="Register clustering and sequencing startup"545 /><p:pathelement title="Register clustering" 709 546 /></p:path> 710 547 … … 722 559 %> 723 560 724 <div class="allsteps">725 <div class="step current" id="step.1">1</div>726 ›727 <div class="step future" id="step.2">2</div>728 <span id="step.3.box">729 ›730 <div class="step future" id="step.3">3</div>731 </span>732 </div>733 734 561 735 562 <form name="reggie" onsubmit="return false;"> 736 737 563 <div id="step.1.section"> 738 564 <table class="stepform"> … … 756 582 </tr> 757 583 <tr valign="top"> 584 <td colspan="2"> 585 <div class="messagecontainer note"> 586 <b>Note!</b> 587 Register each flow cell separately if the outcome, cluster date, operator, etc. is different. 588 </div> 589 590 </td> 591 <td class="status" ></td> 592 <td class="help"> 593 </td> 594 </tr> 595 <tr valign="top"> 758 596 <td class="prompt">Outcome</td> 759 597 <td class="input"> 760 598 <input type="radio" name="outcome" id="outcomeSuccess" 761 onchange="outcomeOnChange()" checked><label for="outcomeSuccess">Success</label> - sequencing has started<br>599 onchange="outcomeOnChange()" checked><label for="outcomeSuccess">Success</label> - continue with sequencing<br> 762 600 <input type="radio" name="outcome" id="outcomeFailed" 763 601 onchange="outcomeOnChange()"><label for="outcomeFailed">Failure</label> - no sequencing … … 765 603 <td class="status"></td> 766 604 <td class="help"> 767 Select the <b>Success</b> option if sequencing has been started.605 Select the <b>Success</b> option if the flow cell is ready for sequencing. 768 606 Select the <b>Failure</b> option if it was not poosible to start sequencing 769 607 the flow cells. … … 786 624 <table style="border-collapse: collapse;"> 787 625 <tr valign="top"> 626 <td class="prompt">Start date</td> 627 <td class="input"> 628 <input type="text" class="required" name="clusterDate" value="" size="12" maxlength="10" 629 onblur="dateOnChange(this.name)" onkeypress="focusOnEnter(event, 'clusterOperator')"> 630 <base:icon 631 onclick="Dates.selectDate('Cluster date', 'reggie', 'clusterDate', 'setDate', 'yyyyMMdd')" 632 image="calendar.png" 633 tooltip="Select a date from a calendar" 634 tabindex="-1" 635 /> 636 </td> 637 <td class="status" id="clusterDate.status"></td> 638 <td class="help"> 639 <span id="clusterDate.message" class="message" style="display: none;"></span>Date the clustering was started (YYYYMMDD or MMDD) 640 </td> 641 </tr> 642 <tr valign="top"> 643 <td class="prompt">Operator</td> 644 <td class="input"> 645 <input type="text" name="clusterOperator" value="<%=HTML.encodeTags(user.getName()) %>" 646 style="width: 90%;" maxlength="255" onkeypress="focusOnEnter(event, 'cBot')"> 647 </td> 648 <td class="status" id="clusterOperator.status"></td> 649 <td class="help"> 650 <span id="clusterOperator.message" class="message" style="display: none;"></span> 651 </td> 652 </tr> 653 <tr valign="top"> 654 <td class="prompt">cBot</td> 655 <td class="input"><select style="width:90%" name="cBot" 656 onkeypress="focusOnEnter(event, 'clusterProtocol')"></select></td> 657 <td class="status" id="cBot.status"></td> 658 <td class="help"><span id="cBot.message" class="message" style="display: none;"></span> 659 Select the cBot which was used in the clustering. 660 </td> 661 </tr> 662 <tr valign="top"> 788 663 <td class="prompt">Protocol</td> 789 664 <td class="input"><select style="width:90%" name="clusterProtocol" id="clusterProtocol" … … 794 669 </td> 795 670 </tr> 671 796 672 <tbody class="fc-0"> 797 673 <tr valign="top" style="background-color: #E8E8E8;"> … … 803 679 <tr valign="top"> 804 680 <td class="subprompt">ID</td> 805 <td class="input"><input type="text" class="required" name="fc-0.externalId" onblur="flowCellIdOnBlur(this.name)" onkeypress="focusOnEnter(event, 'fc-0.c lusterDate')"></td>681 <td class="input"><input type="text" class="required" name="fc-0.externalId" onblur="flowCellIdOnBlur(this.name)" onkeypress="focusOnEnter(event, 'fc-0.comments')"></td> 806 682 <td class="status" id="fc-0.externalId.status"></td> 807 <td class="help"><span id="fc-0.externalId.message" class="message"></span></td> 808 </tr> 809 <tr valign="top"> 810 <td class="subprompt">Start date</td> 811 <td class="input"> 812 <input type="text" class="required" name="fc-0.clusterDate" value="" size="12" maxlength="10" 813 onblur="dateOnChange(this.name)" onkeypress="focusOnEnter(event, 'fc-0.clusterOperator')"> 814 <base:icon 815 onclick="Dates.selectDate('Cluster date', 'reggie', 'fc-0.clusterDate', 'setDate', 'yyyyMMdd')" 816 image="calendar.png" 817 tooltip="Select a date from a calendar" 818 tabindex="-1" 819 /> 820 </td> 821 <td class="status" id="fc-0.clusterDate.status"></td> 822 <td class="help"> 823 <span id="fc-0.clusterDate.message" class="message" style="display: none;"></span>Date the clustering was started (YYYYMMDD or MMDD) 824 </td> 825 </tr> 826 <tr valign="top"> 827 <td class="subprompt">Operator</td> 828 <td class="input"> 829 <input type="text" name="fc-0.clusterOperator" value="<%=HTML.encodeTags(user.getName()) %>" 830 style="width: 90%;" maxlength="255" onkeypress="focusOnEnter(event, 'fc-0.cBot')"> 831 </td> 832 <td class="status" id="fc-0.clusterOperator.status"></td> 833 <td class="help"> 834 <span id="fc-0.clusterOperator.message" class="message" style="display: none;"></span> 835 </td> 836 </tr> 837 <tr valign="top"> 838 <td class="subprompt">cBot</td> 839 <td class="input"><select style="width:90%" name="fc-0.cBot" 840 onkeypress="focusOnEnter(event, 'fc-0.comments')"></select></td> 841 <td class="status" id="fc-0.cBot.status"></td> 842 <td class="help"><span id="fc-0.cBot.message" class="message" style="display: none;"></span> 843 Select the cBot which was used in the clustering. 683 <td class="help"><span id="fc-0.externalId.message" class="message"></span> 684 The barcode of the flow cell. 844 685 </td> 845 686 </tr> … … 862 703 <tr valign="top"> 863 704 <td class="subprompt">ID</td> 864 <td class="input"><input type="text" class="required" name="fc-1.externalId" onblur="flowCellIdOnBlur(this.name)" onkeypress="focusOnEnter(event, 'fc-1.c lusterDate')"></td>705 <td class="input"><input type="text" class="required" name="fc-1.externalId" onblur="flowCellIdOnBlur(this.name)" onkeypress="focusOnEnter(event, 'fc-1.comments')"></td> 865 706 <td class="status" id="fc-1.externalId.status"></td> 866 <td class="help"><span id="fc-1.externalId.message" class="message"></span></td> 867 </tr> 868 <tr valign="top"> 869 <td class="subprompt">Start date</td> 870 <td class="input"> 871 <input type="text" class="required" name="fc-1.clusterDate" value="" size="12" maxlength="10" 872 onblur="dateOnChange(this.name)" onkeypress="focusOnEnter(event, 'fc-1.clusterOperator')"> 873 <base:icon 874 onclick="Dates.selectDate('Cluster date', 'reggie', 'fc-1.clusterDate', 'setDate', 'yyyyMMdd')" 875 image="calendar.png" 876 tooltip="Select a date from a calendar" 877 tabindex="-1" 878 /> 879 </td> 880 <td class="status" id="fc-1.clusterDate.status"></td> 881 <td class="help"> 882 <span id="fc-1.clusterDate.message" class="message" style="display: none;"></span>Date the clustering was started (YYYYMMDD or MMDD) 883 </td> 884 </tr> 885 <tr valign="top"> 886 <td class="subprompt">Operator</td> 887 <td class="input"> 888 <input type="text" name="fc-1.clusterOperator" value="<%=HTML.encodeTags(user.getName()) %>" 889 style="width: 90%;" maxlength="255" onkeypress="focusOnEnter(event, 'fc-1.cBot')"> 890 </td> 891 <td class="status" id="fc-1.clusterOperator.status"></td> 892 <td class="help"> 893 <span id="fc-1.clusterOperator.message" class="message" style="display: none;"></span> 894 </td> 895 </tr> 896 <tr valign="top"> 897 <td class="subprompt">cBot</td> 898 <td class="input"><select style="width:90%" name="fc-1.cBot" 899 onkeypress="focusOnEnter(event, 'fc-1.comments')"></select></td> 900 <td class="status" id="fc-1.cBot.status"></td> 901 <td class="help"><span id="fc-1.cBot.message" class="message" style="display: none;"></span> 902 Select the cBot which was used in the clustering. 707 <td class="help"><span id="fc-1.externalId.message" class="message"></span> 708 The barcode of the flow cell. 903 709 </td> 904 710 </tr> … … 918 724 </div> 919 725 920 921 <div id="step.3.section" style="display: none;">922 <table class="stepform">923 <tr>924 <td rowspan="3" class="stepno">3</td>925 <td class="steptitle">Sequencing startup information</td>926 </tr>927 <tr>928 <td class="stepfields">929 <table style="border-collapse: collapse;">930 <tr>931 <td class="prompt">Sequencing start date</td>932 <td class="input" colspan="2">933 <input type="text" class="required" name="sequencingStartDate" maxlength="10" style="width: 8em;"934 onblur="dateOnChange('sequencingStartDate')" onkeypress="focusOnEnter(event, 'sequencingOperator')">935 <base:icon936 onclick="Dates.selectDate('Sequence start date', 'reggie', 'sequencingStartDate', 'setDate', 'yyyyMMdd')"937 image="calendar.png"938 tooltip="Select a date from a calendar"939 tabindex="-1"940 />941 </td>942 <td class="status" id="sequencingStartDate.status"></td>943 <td class="help">944 <span id="sequencingStartDate.message" class="message" style="display: none;"></span>(YYYYMMDD or MMDD)945 </td>946 </tr>947 <tr valign="top">948 <td class="prompt">Operator</td>949 <td class="input" colspan="2">950 <input type="text" name="sequencingOperator" value="<%=HTML.encodeTags(user.getName()) %>"951 style="width: 90%;" maxlength="255" onkeypress="focusOnEnter(event, 'sequencingProtocol')">952 </td>953 <td class="status" id="sequencingOperator.status"></td>954 <td class="help">955 <span id="sequencingOperator.message" class="message" style="display: none;"></span>956 </td>957 </tr>958 <tr valign="top">959 <td class="prompt">Protocol</td>960 <td class="input" colspan="2"><select style="width:90%" name="sequencingProtocol" id="sequencingProtocol"961 onkeypress="focusOnEnter(event, 'sequencer')"></select></td>962 <td class="status" id="sequencingProtocol.status"></td>963 <td class="help"><span id="sequencingProtocol.message" class="message" style="display: none;"></span>964 Select the protocol for the sequencing.965 </td>966 </tr>967 <tr valign="top">968 <td class="prompt">Sequencing machine</td>969 <td class="input" colspan="2"><select style="width:90%" name="sequencer" id="sequencer"970 onkeypress="focusOnEnter(event, 'sequencingComments')"></select></td>971 <td class="status" id="sequencer.status"></td>972 <td class="help"><span id="sequencer.message" class="message" style="display: none;"></span>973 Select the HiSeq machine which is used for sequencing.974 </td>975 </tr>976 977 <tr valign="top" style="border-top: 1em solid transparent;">978 <td class="prompt"></td>979 <td style="font-weight: bold;">HiSeq position</td>980 <td style="font-weight: bold;">Sequencing cycles</td>981 <td class="status"></td>982 <td class="help"></td>983 </tr>984 <tr valign="top">985 <td class="prompt"></td>986 <td></td>987 <td style="font-style: italic;">(Read 1 - Index - Read 2)</td>988 <td class="status"></td>989 <td class="help"></td>990 </tr>991 <tr valign="top" class="fc-0">992 <td class="subprompt"><span id="fc-0.externalId"></span></td>993 <td> 994 <label><input type="radio" name="fc-0.pos" value="A" onclick="hiseqPosOnClick(0)" checked>A</label>995 996 <label><input type="radio" name="fc-0.pos" value="B" onclick="hiseqPosOnClick(0)">B</label>997 </td>998 <td><input type="text" class="required" name="fc-0.sequencingCycles" onblur="sequencingCyclesOnBlur(this.name)"></td>999 <td class="status" id="fc-0.sequencingCycles.status"></td>1000 <td class="help"><span id="fc-0.sequencingCycles.message" class="message"></span></td>1001 </tr>1002 <tr valign="top" class="fc-1">1003 <td class="subprompt"><span id="fc-1.externalId"></span></td>1004 <td> 1005 <label><input type="radio" name="fc-1.pos" value="A" onclick="hiseqPosOnClick(1)">A</label>1006 1007 <label><input type="radio" name="fc-1.pos" value="B" onclick="hiseqPosOnClick(1)" checked>B</label>1008 </td>1009 <td><input type="text" class="required" name="fc-1.sequencingCycles" onblur="sequencingCyclesOnBlur(this.name)"></td>1010 <td class="status" id="fc-1.sequencingCycles.status"></td>1011 <td class="help"><span id="fc-1.sequencingCycles.message" class="message"></span></td>1012 </tr>1013 1014 1015 <tr valign="top" style="border-top: 1em solid transparent;">1016 <td class="prompt">Comments</td>1017 <td class="input" colspan="2"><textarea rows="4" cols="50" style="width: 90%;" name="sequencingComments" value=""></textarea></td>1018 <td class="status" id="sequencingComments.status"></td>1019 <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing startup.</td>1020 </tr>1021 </table>1022 </td>1023 </tr>1024 </table>1025 </div>1026 726 1027 727 <div class="loading" id="loading" style="display: none;"><table><tr><td><img src="../images/loading.gif"></td><td id="loading.msg">Please wait...</td></tr></table></div> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java
r2196 r2202 46 46 import net.sf.basedb.reggie.dao.ReactionPlate; 47 47 import net.sf.basedb.reggie.dao.ReggieRole; 48 import net.sf.basedb.reggie.dao.SequencingRun;49 48 import net.sf.basedb.reggie.dao.Subtype; 50 49 import net.sf.basedb.util.Values; … … 223 222 json.put("flowCellInfo", jsonFlowCellInfo); 224 223 } 225 else if ("Count SequencingFlowCells".equals(cmd))226 { 227 dc = sc.newDbControl(); 228 ItemQuery< DerivedBioAssay> query = DerivedBioAssay.getQuery();224 else if ("CountClusteredFlowCells".equals(cmd)) 225 { 226 dc = sc.newDbControl(); 227 ItemQuery<PhysicalBioAssay> query = PhysicalBioAssay.getQuery(); 229 228 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 230 Subtype.SEQUENCING_RUN.addFilter(dc, query); 231 // Must have a SEQUENCING_START annotation 232 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_START.load(dc), "sst")); 233 query.restrict(Restrictions.neq(Hql.alias("sst"), null)); 234 // Must NOT have a SEQUENCING_END annotation 235 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse")); 236 query.restrict(Restrictions.eq(Hql.alias("sse"), null)); 229 Subtype.FLOW_CELL.addFilter(dc, query); 230 // Must have a creation date 231 query.join(Hql.innerJoin("creationEvent", "ce")); 232 query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null)); 233 // and have a PLATE_PROCESS_RESULT=Success 234 query.join(Annotations.leftJoin(null, Annotationtype.PLATE_PROCESS_RESULT.load(dc), "ppr")); 235 query.restrict(Restrictions.eq(Hql.alias("ppr"), Expressions.string(ReactionPlate.PROCESS_SUCCESSFUL))); 236 // but no child SequencingRun items 237 query.join(Hql.leftJoin("derivedBioAssays", "ssr")); 238 query.restrict(Restrictions.eq(Hql.alias("ssr"), null)); 239 237 240 long count = query.count(dc); 238 241 json.put("count", count); … … 395 398 pools = new HashSet<Extract>(); 396 399 } 397 else398 {399 Number sequencerId = (Number)jsonReq.get("sequencer");400 Hardware sequencer = sequencerId == null ? null : Hardware.getById(dc, sequencerId.intValue());401 402 Number sequencingProtocolId = (Number)jsonReq.get("sequencingProtocol");403 Protocol sequencingProtocol = sequencingProtocolId == null ? null : Protocol.getById(dc, sequencingProtocolId.intValue());404 405 String sequencingComments = Values.getStringOrNull((String)jsonReq.get("sequencingComments"));406 Date sequencingStartDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("sequencingStartDate"));407 String sequencingOperator = Values.getStringOrNull((String)jsonReq.get("sequencingOperator"));408 409 sequenceRun = DerivedBioAssay.getNew(dc, true, null);410 sequenceRun.setItemSubtype(Subtype.SEQUENCING_RUN.get(dc));411 sequenceRun.setName(SequencingRun.generateNamesForBatch(dc, 1, 1).get(0));412 sequenceRun.setDescription(sequencingComments);413 sequenceRun.setHardware(sequencer);414 dc.saveItem(sequenceRun);415 416 Annotationtype.SEQUENCING_START.setAnnotationValue(dc, sequenceRun, sequencingStartDate);417 Annotationtype.SEQUENCING_OPERATOR.setAnnotationValue(dc, sequenceRun, sequencingOperator);418 419 jsonMessages.add("Created '" + sequenceRun.getName()+"'.");420 }421 422 400 423 401 // Clustering information 424 Number clusterProtocolId = (Number)jsonReq.get("clusterProtocol");425 Protocol clusterProtocol = clusterProtocolId == null ? null : Protocol.getById(dc, clusterProtocolId.intValue());426 427 402 for (int fcNo = 0; fcNo < jsonFlowCells.size(); ++fcNo) 428 403 { … … 433 408 Hardware cBot = cBotId == null ? null : Hardware.getById(dc, cBotId.intValue()); 434 409 410 Number clusterProtocolId = (Number)jsonFlowCell.get("clusterProtocol"); 411 Protocol clusterProtocol = clusterProtocolId == null ? null : Protocol.getById(dc, clusterProtocolId.intValue()); 412 435 413 Date clusterDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonFlowCell.get("clusterDate")); 436 414 String clusterOperator = Values.getStringOrNull((String)jsonFlowCell.get("clusterOperator")); … … 481 459 else 482 460 { 483 sequenceRun.addPhysicalBioAssay(flowCell);484 Annotationtype.SEQUENCING_CYCLES.setAnnotationValue(dc, flowCell, jsonFlowCell.get("SequencingCycles"));485 Annotationtype.HISEQ_POSITION.setAnnotationValue(dc, flowCell, jsonFlowCell.get("HiSeqPosition"));486 487 461 Annotationtype.PLATE_PROCESS_RESULT.setAnnotationValue(dc, flowCell, ReactionPlate.PROCESS_SUCCESSFUL); 488 jsonMessages.add(" Sequencing started for flow cell '" + flowCell.getName() + "'.");462 jsonMessages.add("Flow cell '" + flowCell.getName() + "' registered with status: " + (ReactionPlate.PROCESS_SUCCESSFUL)); 489 463 } 490 464 }
Note: See TracChangeset
for help on using the changeset viewer.