7092 |
04 Apr 23 |
nicklas |
var BwaMem2 = function() |
7092 |
04 Apr 23 |
nicklas |
2 |
{ |
7092 |
04 Apr 23 |
nicklas |
var bwa = {}; |
7092 |
04 Apr 23 |
nicklas |
var debug = 0; |
7092 |
04 Apr 23 |
nicklas |
5 |
|
7092 |
04 Apr 23 |
nicklas |
var JOB_IMAGE = { 'DONE': 'ok.png', 'ERROR': 'error.png'}; |
7092 |
04 Apr 23 |
nicklas |
7 |
|
7092 |
04 Apr 23 |
nicklas |
var alignedSequences; |
7092 |
04 Apr 23 |
nicklas |
9 |
|
7092 |
04 Apr 23 |
nicklas |
// Page initialization |
7092 |
04 Apr 23 |
nicklas |
bwa.initPage = function() |
7092 |
04 Apr 23 |
nicklas |
12 |
{ |
7092 |
04 Apr 23 |
nicklas |
13 |
|
7092 |
04 Apr 23 |
nicklas |
// Step 1 |
7092 |
04 Apr 23 |
nicklas |
15 |
|
7092 |
04 Apr 23 |
nicklas |
// Navigation |
7092 |
04 Apr 23 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
7092 |
04 Apr 23 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
7092 |
04 Apr 23 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
7092 |
04 Apr 23 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
7092 |
04 Apr 23 |
nicklas |
21 |
|
7092 |
04 Apr 23 |
nicklas |
// Final registration |
7092 |
04 Apr 23 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', bwa.submit); |
7092 |
04 Apr 23 |
nicklas |
24 |
|
7092 |
04 Apr 23 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
7092 |
04 Apr 23 |
nicklas |
var url = '../BwaMem2.servlet?ID='+App.getSessionId(); |
7092 |
04 Apr 23 |
nicklas |
url += '&cmd=GetUnconfirmedAlignedSequences'; |
7092 |
04 Apr 23 |
nicklas |
Wizard.asyncJsonRequest(url, bwa.initializeStep1); |
7092 |
04 Apr 23 |
nicklas |
29 |
} |
7092 |
04 Apr 23 |
nicklas |
30 |
|
7092 |
04 Apr 23 |
nicklas |
// --- Step 1 ----------------------------------- |
7092 |
04 Apr 23 |
nicklas |
bwa.initializeStep1 = function(response) |
7092 |
04 Apr 23 |
nicklas |
33 |
{ |
7092 |
04 Apr 23 |
nicklas |
alignedSequences = response.alignedSequences; |
7092 |
04 Apr 23 |
nicklas |
if (alignedSequences.length == 0) |
7092 |
04 Apr 23 |
nicklas |
36 |
{ |
7092 |
04 Apr 23 |
nicklas |
Wizard.setFatalError('No aligned sequences available for processing.'); |
7092 |
04 Apr 23 |
nicklas |
return; |
7092 |
04 Apr 23 |
nicklas |
39 |
} |
7119 |
19 Apr 23 |
nicklas |
var limits = response.limits; |
7092 |
04 Apr 23 |
nicklas |
41 |
|
7092 |
04 Apr 23 |
nicklas |
var html = '<table id="alignedSequencesTable">'; |
7092 |
04 Apr 23 |
nicklas |
html += '<thead class="bg-filled-100">'; |
7092 |
04 Apr 23 |
nicklas |
// Header row |
7092 |
04 Apr 23 |
nicklas |
html += '<tr>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">Sample</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th class="dottedleft">PF Reads</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>Aligned pairs</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>Duplicates</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th class="dottedleft">PF Bases</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>Q30 Bases</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>Mean</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft" colspan="3">Genotypes QC</th>' |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft"></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft"></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft" colspan="2">Actions</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">Comment</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</tr>'; |
7092 |
04 Apr 23 |
nicklas |
60 |
|
7092 |
04 Apr 23 |
nicklas |
html += '<tr>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th>Library</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">type</th>'; |
7114 |
14 Apr 23 |
nicklas |
64 |
|
7114 |
14 Apr 23 |
nicklas |
html += '<th class="dottedleft">(millions)</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>(millions)</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>(optical)</th>'; |
7114 |
14 Apr 23 |
nicklas |
68 |
|
7114 |
14 Apr 23 |
nicklas |
html += '<th class="dottedleft">(billions)</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>(billions)</th>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<th>coverage</th>'; |
7114 |
14 Apr 23 |
nicklas |
72 |
|
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">Count</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th>HET</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="icon-col"></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">Job</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft">Files</th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th><span id="realign" data-prefix="realign" class="interactable link" title="Toggle selection – use CTRL, ALT or SHIFT to clear">Re-align</span></th>'; |
7119 |
19 Apr 23 |
nicklas |
html += '<th><span id="confirmAlign" data-prefix="confirm" class="interactable link" title="Toggle selection – use CTRL, ALT or SHIFT to clear">Confirm</span></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<th class="dottedleft"></th>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</tr>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</thead>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<tbody>'; |
7092 |
04 Apr 23 |
nicklas |
var numWithError = 0; |
7092 |
04 Apr 23 |
nicklas |
for (var alignedNo = 0; alignedNo < alignedSequences.length; alignedNo++) |
7092 |
04 Apr 23 |
nicklas |
86 |
{ |
7092 |
04 Apr 23 |
nicklas |
var aligned = alignedSequences[alignedNo]; |
7092 |
04 Apr 23 |
nicklas |
var merged = aligned.merged; |
7092 |
04 Apr 23 |
nicklas |
89 |
|
7120 |
20 Apr 23 |
nicklas |
var reads = merged.READS == null ? '-' : Numbers.formatNumber(merged.READS/1000000, 1); |
7120 |
20 Apr 23 |
nicklas |
var alignedReads = aligned.ALIGNED_PAIRS == null ? '-' : Numbers.formatNumber(aligned.ALIGNED_PAIRS/1000000, 1); |
7120 |
20 Apr 23 |
nicklas |
var alignedPercent = aligned.ALIGNED_PAIRS && merged.READS ? ' ('+Numbers.formatNumber(100*aligned.ALIGNED_PAIRS/merged.READS, 1, '%')+')' : ''; |
7120 |
20 Apr 23 |
nicklas |
var pfBases = aligned.PF_BASES == null ? '-' : Numbers.formatNumber(aligned.PF_BASES/1000000000, 1); |
7120 |
20 Apr 23 |
nicklas |
var q30Bases = aligned.PF_Q30_BASES == null ? '-' : Numbers.formatNumber(aligned.PF_Q30_BASES/1000000000, 1); |
7120 |
20 Apr 23 |
nicklas |
var q30Percent = aligned.PF_Q30_BASES && aligned.PF_BASES ? ' ('+Numbers.formatNumber(100*aligned.PF_Q30_BASES/aligned.PF_BASES, 1, '%')+')' : ''; |
7120 |
20 Apr 23 |
nicklas |
var percentDuplicates = aligned.FRACTION_DUPLICATION == null ? '-' : Numbers.formatNumber(100*aligned.FRACTION_DUPLICATION, 1, '%'); |
7120 |
20 Apr 23 |
nicklas |
var opticalDuplicates = aligned.FRACTION_OPTICAL_DUPLICATION == null ? '' : ' ('+Numbers.formatNumber(100*aligned.FRACTION_OPTICAL_DUPLICATION, 1, '%')+')'; |
7120 |
20 Apr 23 |
nicklas |
var meanCoverage = aligned.MEAN_COVERAGE == null ? '-' : Numbers.formatNumber(aligned.MEAN_COVERAGE, 1); |
7092 |
04 Apr 23 |
nicklas |
var genotypeCount = aligned.QC_GENOTYPE_COUNT || '-'; |
7120 |
20 Apr 23 |
nicklas |
var hetPct = aligned.QC_GENOTYPE_HET_PCT == null ? '' : Numbers.formatNumber(aligned.QC_GENOTYPE_HET_PCT, 0, '%'); |
7092 |
04 Apr 23 |
nicklas |
var job = aligned.job; |
7134 |
24 Apr 23 |
nicklas |
102 |
|
7092 |
04 Apr 23 |
nicklas |
var isError = job.status == 'ERROR'; |
7092 |
04 Apr 23 |
nicklas |
104 |
|
7119 |
19 Apr 23 |
nicklas |
// Warnings |
7119 |
19 Apr 23 |
nicklas |
var alignedWarning = ''; |
7119 |
19 Apr 23 |
nicklas |
var duplicationWarning = ''; |
7119 |
19 Apr 23 |
nicklas |
var hetWarning = ''; |
7119 |
19 Apr 23 |
nicklas |
var coverageWarning = ''; |
7134 |
24 Apr 23 |
nicklas |
if (!job.debug) |
7119 |
19 Apr 23 |
nicklas |
111 |
{ |
7134 |
24 Apr 23 |
nicklas |
if (aligned.ALIGNED_PAIRS != null && aligned.ALIGNED_PAIRS < limits.minAlignedPairs) |
7134 |
24 Apr 23 |
nicklas |
113 |
{ |
7134 |
24 Apr 23 |
nicklas |
alignedWarning = ' <img src="../images/warning.png" title="Less than '+Reggie.formatCount(limits.minAlignedPairs) + ' aligned pairs">'; |
7134 |
24 Apr 23 |
nicklas |
115 |
} |
7134 |
24 Apr 23 |
nicklas |
if (aligned.FRACTION_DUPLICATION != null && aligned.FRACTION_DUPLICATION > limits.maxFractionDuplication) |
7134 |
24 Apr 23 |
nicklas |
117 |
{ |
7134 |
24 Apr 23 |
nicklas |
duplicationWarning = ' <img src="../images/warning.png" title="More than '+Math.round(100*limits.maxFractionDuplication)+'% duplication">'; |
7134 |
24 Apr 23 |
nicklas |
119 |
} |
7134 |
24 Apr 23 |
nicklas |
if (aligned.QC_GENOTYPE_HET_PCT != null && aligned.QC_GENOTYPE_HET_PCT > limits.maxHetPct) |
7134 |
24 Apr 23 |
nicklas |
121 |
{ |
7134 |
24 Apr 23 |
nicklas |
hetWarning = ' <img src="../images/warning.png" title="More than '+Math.round(limits.maxHetPct)+'% HET may indicate contamination">'; |
7134 |
24 Apr 23 |
nicklas |
123 |
} |
7134 |
24 Apr 23 |
nicklas |
if (aligned.MEAN_COVERAGE != null && aligned.MEAN_COVERAGE < limits.minMeanCoverage) |
7134 |
24 Apr 23 |
nicklas |
125 |
{ |
7134 |
24 Apr 23 |
nicklas |
coverageWarning = ' <img src="../images/warning.png" title="Less than '+Math.round(limits.minMeanCoverage)+' coverage">'; |
7134 |
24 Apr 23 |
nicklas |
127 |
} |
7119 |
19 Apr 23 |
nicklas |
128 |
} |
7119 |
19 Apr 23 |
nicklas |
129 |
|
7092 |
04 Apr 23 |
nicklas |
html += '<tr class="highlight ' + (alignedNo % 4 < 2 ? 'evenrow' : 'oddrow') + '">'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="prompt if-yellow">'+aligned.name+'</td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">'+(aligned.PIPELINE=='DNA/Tumor/WGS'?'Tumor':'Normal')+'</td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">'+reads+'</td>'; |
7119 |
19 Apr 23 |
nicklas |
html += '<td>'+alignedReads+alignedPercent+alignedWarning+'</td>'; |
7119 |
19 Apr 23 |
nicklas |
html += '<td>'+percentDuplicates+opticalDuplicates+duplicationWarning+'</td>'; |
7119 |
19 Apr 23 |
nicklas |
136 |
|
7114 |
14 Apr 23 |
nicklas |
html += '<td class="dottedleft">'+pfBases+'</td>'; |
7114 |
14 Apr 23 |
nicklas |
html += '<td>'+q30Bases+q30Percent+'</td>'; |
7092 |
04 Apr 23 |
nicklas |
139 |
|
7119 |
19 Apr 23 |
nicklas |
html += '<td>'+meanCoverage+coverageWarning+'</td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">'+genotypeCount+'</td>'; |
7119 |
19 Apr 23 |
nicklas |
html += '<td>'+hetPct+hetWarning+'</td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="icon-col">'; |
7092 |
04 Apr 23 |
nicklas |
if (aligned.qcVcf) |
7092 |
04 Apr 23 |
nicklas |
145 |
{ |
7092 |
04 Apr 23 |
nicklas |
html += '<span class="link vcf-link" data-file-id="'+aligned.qcVcf.id+'" data-item-id="'+aligned.id+'" title="View VCF statistics"><img src="../images/vcf_file.png"></span>'; |
7092 |
04 Apr 23 |
nicklas |
147 |
} |
7092 |
04 Apr 23 |
nicklas |
html += '</td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">'; |
7092 |
04 Apr 23 |
nicklas |
html += '<span class="link item-link" data-item-type="JOB" data-item-id="'+job.id+'" title="'+Strings.encodeTags(job.statusMessage)+'"><img src="../images/'+JOB_IMAGE[job.status]+'"></span>'; |
7134 |
24 Apr 23 |
nicklas |
if (job.debug) |
7134 |
24 Apr 23 |
nicklas |
152 |
{ |
7134 |
24 Apr 23 |
nicklas |
html += '<img src="../images/'+(isError?'bug-red':'bug-green')+'.png" title="This job was run in DEBUG mode">' |
7134 |
24 Apr 23 |
nicklas |
154 |
} |
7092 |
04 Apr 23 |
nicklas |
html += '</td>'; |
7092 |
04 Apr 23 |
nicklas |
if (aligned.DataFilesFolder && job.server) |
7092 |
04 Apr 23 |
nicklas |
157 |
{ |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">'; |
7092 |
04 Apr 23 |
nicklas |
html += '<span class="link file-link" data-server="'+Strings.encodeTags(job.server)+'" data-folder="'+Strings.encodeTags(aligned.DataFilesFolder)+'" data-item-id="'+aligned.id+'" title="View generated files"><img src="../images/remote_folder.png"></span>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</td>'; |
7092 |
04 Apr 23 |
nicklas |
161 |
} |
7092 |
04 Apr 23 |
nicklas |
else |
7092 |
04 Apr 23 |
nicklas |
163 |
{ |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft">-</td>'; |
7092 |
04 Apr 23 |
nicklas |
165 |
} |
7092 |
04 Apr 23 |
nicklas |
166 |
|
7119 |
19 Apr 23 |
nicklas |
var confirmChecked = !isError ? ' checked' : ''; |
7092 |
04 Apr 23 |
nicklas |
var realignChecked = isError ? ' checked' : ''; |
7119 |
19 Apr 23 |
nicklas |
var confirmDisabled = isError ? ' disabled' : ''; |
7092 |
04 Apr 23 |
nicklas |
if (isError) numWithError++; |
7092 |
04 Apr 23 |
nicklas |
171 |
|
7092 |
04 Apr 23 |
nicklas |
html += '<td><input type="checkbox" name="realign.'+aligned.id+'"'+realignChecked+'></td>'; |
7119 |
19 Apr 23 |
nicklas |
html += '<td><input type="checkbox" name="confirm.'+aligned.id+'"'+confirmChecked+confirmDisabled+'></td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '<td class="dottedleft comment"><input type="text" name="comment.'+aligned.id+'"></td>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</tr>'; |
7092 |
04 Apr 23 |
nicklas |
176 |
|
7092 |
04 Apr 23 |
nicklas |
177 |
} |
7092 |
04 Apr 23 |
nicklas |
html += '</tbody>'; |
7092 |
04 Apr 23 |
nicklas |
html += '</table>'; |
7092 |
04 Apr 23 |
nicklas |
Doc.element('alignedSequences').innerHTML = html; |
7092 |
04 Apr 23 |
nicklas |
if (numWithError > 0) Doc.show('delete-items', 'table'); |
7092 |
04 Apr 23 |
nicklas |
182 |
|
7092 |
04 Apr 23 |
nicklas |
Events.addEventHandler('realign', 'click', bwa.toggleSelection); |
7119 |
19 Apr 23 |
nicklas |
Events.addEventHandler('confirmAlign', 'click', bwa.toggleSelection); |
7092 |
04 Apr 23 |
nicklas |
185 |
|
7092 |
04 Apr 23 |
nicklas |
// Add click handler to items |
7092 |
04 Apr 23 |
nicklas |
var clickableItems = document.getElementsByClassName('item-link'); |
7092 |
04 Apr 23 |
nicklas |
for (var i = 0; i < clickableItems.length; i++) |
7092 |
04 Apr 23 |
nicklas |
189 |
{ |
7092 |
04 Apr 23 |
nicklas |
Events.addEventHandler(clickableItems[i], 'click', Items.itemOnClick); |
7092 |
04 Apr 23 |
nicklas |
191 |
} |
7092 |
04 Apr 23 |
nicklas |
192 |
|
7092 |
04 Apr 23 |
nicklas |
// Add click handler to file links |
7092 |
04 Apr 23 |
nicklas |
var clickableItems = document.getElementsByClassName('file-link'); |
7092 |
04 Apr 23 |
nicklas |
for (var i = 0; i < clickableItems.length; i++) |
7092 |
04 Apr 23 |
nicklas |
196 |
{ |
7092 |
04 Apr 23 |
nicklas |
Events.addEventHandler(clickableItems[i], 'click', bwa.fileLinkOnClick); |
7092 |
04 Apr 23 |
nicklas |
198 |
} |
7092 |
04 Apr 23 |
nicklas |
199 |
|
7092 |
04 Apr 23 |
nicklas |
// Add click handler to VCF files |
7092 |
04 Apr 23 |
nicklas |
var clickableItems = document.getElementsByClassName('vcf-link'); |
7092 |
04 Apr 23 |
nicklas |
for (var i = 0; i < clickableItems.length; i++) |
7092 |
04 Apr 23 |
nicklas |
203 |
{ |
7092 |
04 Apr 23 |
nicklas |
Events.addEventHandler(clickableItems[i], 'click', bwa.vcfLinkOnClick); |
7092 |
04 Apr 23 |
nicklas |
205 |
} |
7092 |
04 Apr 23 |
nicklas |
206 |
|
7092 |
04 Apr 23 |
nicklas |
Doc.show('step-1'); |
7092 |
04 Apr 23 |
nicklas |
Doc.show('goregister'); |
7092 |
04 Apr 23 |
nicklas |
209 |
} |
7092 |
04 Apr 23 |
nicklas |
210 |
|
7092 |
04 Apr 23 |
nicklas |
bwa.fileLinkOnClick = function(event) |
7092 |
04 Apr 23 |
nicklas |
212 |
{ |
7092 |
04 Apr 23 |
nicklas |
var folder = Data.get(event.currentTarget, 'folder'); |
7092 |
04 Apr 23 |
nicklas |
var server = Data.get(event.currentTarget, 'server'); |
7092 |
04 Apr 23 |
nicklas |
var itemId = Data.get(event.currentTarget, 'item-id'); |
7092 |
04 Apr 23 |
nicklas |
server = server.replace(/\s*\[.*\]/, ''); |
7092 |
04 Apr 23 |
nicklas |
var url = '../analysis/view_remote_files.jsp?ID=' + App.getSessionId(); |
7092 |
04 Apr 23 |
nicklas |
url += '&clusterId='+server; |
7092 |
04 Apr 23 |
nicklas |
url += '&archive=project-archive-dna'; |
7092 |
04 Apr 23 |
nicklas |
url += '&path='+encodeURIComponent(folder); |
7092 |
04 Apr 23 |
nicklas |
url += '&itemType=DERIVEDBIOASSAY&itemId='+itemId; |
7092 |
04 Apr 23 |
nicklas |
Dialogs.openPopup(url, 'ViewProjectFiles', 750, 500); |
7092 |
04 Apr 23 |
nicklas |
223 |
} |
7092 |
04 Apr 23 |
nicklas |
224 |
|
7092 |
04 Apr 23 |
nicklas |
bwa.vcfLinkOnClick = function(event) |
7092 |
04 Apr 23 |
nicklas |
226 |
{ |
7092 |
04 Apr 23 |
nicklas |
var fileId = Data.int(event.currentTarget, 'file-id'); |
7092 |
04 Apr 23 |
nicklas |
var itemId = Data.get(event.currentTarget, 'item-id'); |
7092 |
04 Apr 23 |
nicklas |
229 |
|
7092 |
04 Apr 23 |
nicklas |
var url = '../analysis/view_genotypes.jsp?ID=' + App.getSessionId(); |
7092 |
04 Apr 23 |
nicklas |
url += '&fileId='+fileId; |
7092 |
04 Apr 23 |
nicklas |
url += '&itemId='+itemId; |
7092 |
04 Apr 23 |
nicklas |
Dialogs.openPopup(url, 'ViewVcf', 750, 500); |
7092 |
04 Apr 23 |
nicklas |
234 |
} |
7092 |
04 Apr 23 |
nicklas |
235 |
|
7092 |
04 Apr 23 |
nicklas |
bwa.toggleSelection = function(event) |
7092 |
04 Apr 23 |
nicklas |
237 |
{ |
7092 |
04 Apr 23 |
nicklas |
var prefix = Data.get(event.currentTarget, 'prefix'); |
7092 |
04 Apr 23 |
nicklas |
var specialKey = event.altKey || event.ctrlKey || event.shiftKey; |
7092 |
04 Apr 23 |
nicklas |
240 |
|
7092 |
04 Apr 23 |
nicklas |
var frm = document.forms['reggie']; |
7092 |
04 Apr 23 |
nicklas |
for (var alignedNo = 0; alignedNo < alignedSequences.length; alignedNo++) |
7092 |
04 Apr 23 |
nicklas |
243 |
{ |
7092 |
04 Apr 23 |
nicklas |
var aligned = alignedSequences[alignedNo]; |
7092 |
04 Apr 23 |
nicklas |
var chk = frm[prefix+'.'+aligned.id]; |
7092 |
04 Apr 23 |
nicklas |
if (chk && !chk.disabled) |
7092 |
04 Apr 23 |
nicklas |
247 |
{ |
7092 |
04 Apr 23 |
nicklas |
chk.checked = specialKey ? false : !chk.checked; |
7092 |
04 Apr 23 |
nicklas |
249 |
} |
7092 |
04 Apr 23 |
nicklas |
250 |
} |
7092 |
04 Apr 23 |
nicklas |
251 |
} |
7092 |
04 Apr 23 |
nicklas |
252 |
|
7092 |
04 Apr 23 |
nicklas |
bwa.submit = function() |
7092 |
04 Apr 23 |
nicklas |
254 |
{ |
7092 |
04 Apr 23 |
nicklas |
var frm = document.forms['reggie']; |
7092 |
04 Apr 23 |
nicklas |
var submitInfo = {}; |
7092 |
04 Apr 23 |
nicklas |
submitInfo.deleteItemsCreatedByFailedJobs = frm.deleteItemsCreatedByFailedJobs.checked; |
7092 |
04 Apr 23 |
nicklas |
258 |
|
7092 |
04 Apr 23 |
nicklas |
var all = []; |
7092 |
04 Apr 23 |
nicklas |
submitInfo.alignedSequences = all; |
7092 |
04 Apr 23 |
nicklas |
for (var alignedNo = 0; alignedNo < alignedSequences.length; alignedNo++) |
7092 |
04 Apr 23 |
nicklas |
262 |
{ |
7092 |
04 Apr 23 |
nicklas |
var aligned = alignedSequences[alignedNo]; |
7092 |
04 Apr 23 |
nicklas |
var tmp = {}; |
7092 |
04 Apr 23 |
nicklas |
tmp.id = aligned.id; |
7092 |
04 Apr 23 |
nicklas |
266 |
|
7092 |
04 Apr 23 |
nicklas |
tmp.realign = frm['realign.'+aligned.id].checked; |
7119 |
19 Apr 23 |
nicklas |
tmp.confirm = frm['confirm.'+aligned.id].checked; |
7092 |
04 Apr 23 |
nicklas |
tmp.comment = frm['comment.'+aligned.id].value; |
7092 |
04 Apr 23 |
nicklas |
270 |
|
7092 |
04 Apr 23 |
nicklas |
all[all.length] = tmp; |
7092 |
04 Apr 23 |
nicklas |
272 |
} |
7092 |
04 Apr 23 |
nicklas |
273 |
|
7092 |
04 Apr 23 |
nicklas |
var url = '../BwaMem2.servlet?ID='+App.getSessionId(); |
7092 |
04 Apr 23 |
nicklas |
url += '&cmd=RegisterBwaMem2Alignment'; |
7092 |
04 Apr 23 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
7092 |
04 Apr 23 |
nicklas |
Wizard.asyncJsonRequest(url, bwa.submissionResults, 'POST', JSON.stringify(submitInfo)); |
7092 |
04 Apr 23 |
nicklas |
278 |
} |
7092 |
04 Apr 23 |
nicklas |
279 |
|
7092 |
04 Apr 23 |
nicklas |
bwa.submissionResults = function(response) |
7092 |
04 Apr 23 |
nicklas |
281 |
{ |
7092 |
04 Apr 23 |
nicklas |
Wizard.showFinalMessage(response.messages); |
7092 |
04 Apr 23 |
nicklas |
Doc.show('gorestart'); |
7092 |
04 Apr 23 |
nicklas |
284 |
} |
7092 |
04 Apr 23 |
nicklas |
285 |
|
7092 |
04 Apr 23 |
nicklas |
286 |
|
7092 |
04 Apr 23 |
nicklas |
return bwa; |
7092 |
04 Apr 23 |
nicklas |
288 |
}(); |
7092 |
04 Apr 23 |
nicklas |
289 |
|
7092 |
04 Apr 23 |
nicklas |
Doc.onLoad(BwaMem2.initPage); |
7092 |
04 Apr 23 |
nicklas |
291 |
|