Changeset 4980
- Timestamp:
- Sep 25, 2018, 9:28:29 AM (4 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/flaggedalignment/search.js
r4978 r4980 475 475 476 476 var tb = tbody[itemNo] || { 'start': 1, 'end': 1 }; 477 var rowspan = tb.rowspan || cmp.messages.length|| 1;477 var rowspan = tb.rowspan || (cmp ? cmp.messages.length : 0) || 1; 478 478 var tbodySpan = tb.tbodyspan || rowspan; 479 479 … … 610 610 } 611 611 612 var options = document.getElementsByClassName('reprocess-options'); 613 for (var i = 0; i < options.length; i++) 614 { 615 Events.addEventHandler(options[i], 'change', search.reprocessOptionOnChange); 616 } 617 612 618 var options = document.getElementsByClassName('donotuse-options'); 613 619 for (var i = 0; i < options.length; i++) … … 645 651 aligned.buglevel = 0; 646 652 aligned.bugText = []; 647 653 648 654 // We need to be able to lookup alignments by name and patient name 649 655 if (!aligned.specimen) … … 670 676 aligned.bugText[aligned.bugText.length] = aligned.lib ? 671 677 'No alignment from this Library' : 'No alignment from this RNA'; 678 var libOrRna = aligned.lib || aligned.rna || {}; 679 // Copy DO_NOT_USE information to make it easier to handle in other places 680 aligned.DO_NOT_USE = libOrRna.DO_NOT_USE; 681 aligned.DO_NOT_USE_COMMENT = libOrRna.DO_NOT_USE_COMMENT 672 682 } 673 683 … … 698 708 aligned.bugText[aligned.bugText.length] = 'High HET'; 699 709 } 710 711 if (aligned.DO_NOT_USE) 712 { 713 aligned.bugText[aligned.bugText.length] = '<span class="donotuse">['+Strings.encodeTags(aligned.DO_NOT_USE)+']</span> ' + Strings.encodeTags(aligned.DO_NOT_USE_COMMENT); 714 if (!aligned.bugged) 715 { 716 aligned.bugged = 1; 717 aligned.buglevel = 1; 718 } 719 } 720 700 721 } 701 722 } … … 814 835 } 815 836 837 /** 838 Display a warning icon if the selected re-process option is marked 'donotuse'. 839 */ 840 search.reprocessOptionOnChange = function(event) 841 { 842 var opt = event.currentTarget[event.currentTarget.selectedIndex]; 843 var tmpId = event.currentTarget.id.replace('reprocess.', ''); 844 Doc.addOrRemoveClass('section.'+tmpId, 'reprocess-warning', opt.classList.contains('donotuse')); 845 } 846 816 847 // Enable/disable the DoNotUse list depending on if the OkToUse is checked or not 817 848 search.okToUseOnChange = function(event) … … 884 915 { 885 916 icons += '<img src="../images/comment.png" title="'+Strings.encodeTags(alignment.QC_GENOTYPE_COMMENT)+'">'; 917 } 918 if (alignment.DO_NOT_USE) 919 { 920 icons += '<img src="../images/donotuse.png" title="DoNotUse-'+Strings.encodeTags(alignment.DO_NOT_USE+': '+alignment.DO_NOT_USE_COMMENT)+'">'; 886 921 } 887 922 if (alignment.flagged) … … 1469 1504 } 1470 1505 1471 var html = ' ';1472 html += '<select id="'+id+'" name="'+id+'" '+(recommendReprocess? 'title="Re-processing is recommended"':'')+'>';1506 var html = '<span class="reprocess-wrapper">'; 1507 html += '<select id="'+id+'" class="reprocess-options" name="'+id+'" '+(recommendReprocess? 'title="Re-processing is recommended"':'')+'>'; 1473 1508 if (!currentReProcess) html += '<option value="" selected> '; 1474 html += '<option '+(currentReProcess=='Specimen'?'value="" selected':'value="specimen"')+'>Specimen';1475 html += '<option '+(currentReProcess=='Lysate'?'value="" selected':'value="lysate"')+'>Lysate';1476 html += '<option '+(currentReProcess=='RNA'?'value="" selected':'value="rna"')+'>RNA';1477 html += '</select> ';1509 html += helper.reprocessOption('Specimen', 'specimen', currentReProcess, aligned.specimen.DO_NOT_USE); 1510 html += helper.reprocessOption('Lysate', 'lysate', currentReProcess, aligned.lysate.DO_NOT_USE); 1511 html += helper.reprocessOption('RNA', 'rna', currentReProcess, aligned.rna.DO_NOT_USE); 1512 html += '</select></span>'; 1478 1513 1479 1514 if (currentReProcess != null) … … 1483 1518 1484 1519 return html; 1520 } 1521 1522 helper.reprocessOption = function(text, value, currentReProcess, doNotUse) 1523 { 1524 var opt = '<option '; 1525 if (currentReProcess==text) 1526 { 1527 opt += 'value="" selected'; 1528 } 1529 else 1530 { 1531 opt += 'value="'+value+'"'; 1532 } 1533 if (doNotUse) opt += ' class="donotuse" title="'+text+' is marked as DoNotUse"'; 1534 opt += '>'+text; 1535 if (doNotUse) opt += ' (!)'; 1536 return opt; 1485 1537 } 1486 1538 … … 1505 1557 helper.resolveOptions = function(aligned, filterType) 1506 1558 { 1507 var idDoNotUse = 'donotuse.'+aligned.tmpId;1508 var idOkToUse = 'oktouse.'+aligned.tmpId;1509 1510 var cls = aligned.flagged && filterType != 'HET' ? 'required' : '';1511 1512 1559 var html = ''; 1513 if (aligned. flagged)1514 { 1515 var okValue = filterType == 'QIACUBE' ? 'ok-rna' : 'ok-library';1516 html += '<input type="checkbox" value="'+okValue+'" id="'+idOkToUse+'" name="'+idOkToUse+'" class="oktouse" title="Check this to indicate that the flagged item is ok to use.">';1560 if (aligned.DO_NOT_USE) 1561 { 1562 html += '<input type="checkbox" style="visibility: hidden;">'; 1563 html += aligned.DO_NOT_USE; 1517 1564 } 1518 1565 else 1519 1566 { 1520 // Dummy checkbox that is hidden. Used to make the selection lists align 1521 html += '<input type="checkbox" style="visibility: hidden;">'; 1522 } 1523 1524 html += '<select id="'+idDoNotUse+'" name="'+idDoNotUse+'" class="donotuse-options '+cls+'">'; 1525 html += '<option value=""> '; 1526 if (filterType != 'QIACUBE') 1527 { 1528 html += '<option value="library">Library'; 1529 } 1530 html += '<option value="rna">RNA'; 1531 html += '<option value="lysate">Lysate'; 1532 html += '<option value="specimen">Specimen'; 1533 html += '</select>'; 1567 var idDoNotUse = 'donotuse.'+aligned.tmpId; 1568 var idOkToUse = 'oktouse.'+aligned.tmpId; 1569 var cls = aligned.flagged && filterType != 'HET' ? 'required' : ''; 1570 1571 if (aligned.flagged) 1572 { 1573 var okValue = filterType == 'QIACUBE' ? 'ok-rna' : 'ok-library'; 1574 html += '<input type="checkbox" value="'+okValue+'" id="'+idOkToUse+'" name="'+idOkToUse+'" class="oktouse" title="Check this to indicate that the flagged item is ok to use.">'; 1575 } 1576 else 1577 { 1578 // Dummy checkbox that is hidden. Used to make the selection lists align 1579 html += '<input type="checkbox" style="visibility: hidden;">'; 1580 } 1581 1582 html += '<select id="'+idDoNotUse+'" name="'+idDoNotUse+'" class="donotuse-options '+cls+'">'; 1583 html += '<option value=""> '; 1584 if (filterType != 'QIACUBE') 1585 { 1586 html += '<option value="library">Library'; 1587 } 1588 html += '<option value="rna">RNA'; 1589 html += '<option value="lysate">Lysate'; 1590 html += '<option value="specimen">Specimen'; 1591 html += '</select>'; 1592 } 1534 1593 1535 1594 return html; … … 1538 1597 helper.resolveComment = function(aligned) 1539 1598 { 1540 var id = 'resolvecomment.'+aligned.tmpId; 1541 html = '<input type="text" id="'+id+'" name="'+id+'" value="'+Strings.encodeTags(aligned.QC_GENOTYPE_COMMENT)+'">'; 1599 var html = ''; 1600 if (aligned.DO_NOT_USE) 1601 { 1602 html += Strings.encodeTags(aligned.DO_NOT_USE_COMMENT); 1603 } 1604 else 1605 { 1606 var id = 'resolvecomment.'+aligned.tmpId; 1607 html += '<input type="text" id="'+id+'" name="'+id+'" value="'+Strings.encodeTags(aligned.QC_GENOTYPE_COMMENT)+'">'; 1608 } 1609 1542 1610 return html; 1543 1611 } -
extensions/net.sf.basedb.reggie/trunk/resources/flaggedalignment/search.jsp
r4976 r4980 223 223 border-right-width: 8px; 224 224 border-right-color: #2288AA; 225 } 226 227 span.donotuse 228 { 229 font-style: italic; 230 color: #666666; 231 } 232 233 option.donotuse 234 { 235 color: #999999; 236 } 237 238 .reprocess-warning .reprocess-wrapper:after 239 { 240 content: url('../images/warning.png'); 241 vertical-align: bottom; 242 padding: 2px; 225 243 } 226 244 </style> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/GenotypeServlet.java
r4979 r4980 826 826 827 827 828 private void loadLibraryAnnotations(DbControl dc, SnapshotManager manager, Library lib) 829 { 830 if (lib == null) return; 831 Extract libExtract = lib.getExtract(); 832 lib.loadBioPlateLocation(); 833 lib.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null); 834 lib.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null); 835 } 836 828 837 private void loadRnaAnnotations(DbControl dc, SnapshotManager manager, Rna rna) 829 838 { … … 834 843 rna.loadAnnotations(dc, manager, "QIACUBE_POSITION", Annotationtype.QIACUBE_POSITION, null); 835 844 rna.loadAnnotations(dc, manager, "AutoProcessing", Annotationtype.AUTO_PROCESSING, null); 845 rna.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null); 846 rna.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null); 836 847 rna.setAnnotation("remainingQuantity", rnaExtract.getRemainingQuantity()); 837 848 rna.setAnnotation("originalQuantity", rnaExtract.getOriginalQuantity()); … … 915 926 as.loadAnnotations(dc, manager, "QC_GENOTYPE_VERIFIED", Annotationtype.QC_GENOTYPE_VERIFIED, null); 916 927 as.loadAnnotations(dc, manager, "QC_GENOTYPE_COMMENT", Annotationtype.QC_GENOTYPE_COMMENT, null); 928 as.loadAnnotations(dc, manager, "DO_NOT_USE", Annotationtype.DO_NOT_USE, null); 929 as.loadAnnotations(dc, manager, "DO_NOT_USE_COMMENT", Annotationtype.DO_NOT_USE_COMMENT, null); 917 930 as.setAnnotation("QC_GENOTYPE_STATUS", qcStatus); 918 931 as.setAnnotation("flagged", checker.isFlagged(as.getItem())); 919 932 Library lib = as.getLibrary(dc); 920 lib.loadBioPlateLocation();921 933 Rna rna = lib.getRna(dc, false); 922 934 Lysate lys = rna != null ? rna.getLysate() : null; 923 935 SpecimenTube sp = lys != null ? lys.getSpecimen() : null; 924 936 937 loadLibraryAnnotations(dc, manager, lib); 925 938 loadRnaAnnotations(dc, manager, rna); 926 939 loadLysateAnnotations(dc, manager, lys); … … 973 986 { 974 987 lib = Library.get(e); 975 lib.loadBioPlateLocation();976 988 rna = lib.getRna(dc, false); 977 989 // Can be null here if the library is external … … 980 992 } 981 993 994 loadLibraryAnnotations(dc, manager, lib); 982 995 loadRnaAnnotations(dc, manager, rna); 983 996 loadLysateAnnotations(dc, manager, lys);
Note: See TracChangeset
for help on using the changeset viewer.