5850 |
04 Mar 20 |
nicklas |
var VcfActions = function() |
5850 |
04 Mar 20 |
nicklas |
2 |
{ |
5850 |
04 Mar 20 |
nicklas |
var vcf = {}; |
5850 |
04 Mar 20 |
nicklas |
4 |
|
5850 |
04 Mar 20 |
nicklas |
vcf.initElement = function(element, autoInit) |
5850 |
04 Mar 20 |
nicklas |
6 |
{ |
5850 |
04 Mar 20 |
nicklas |
if (autoInit == 'view-variants') |
5850 |
04 Mar 20 |
nicklas |
8 |
{ |
5850 |
04 Mar 20 |
nicklas |
Events.addEventHandler(element, 'click', vcf.viewVariants); |
5850 |
04 Mar 20 |
nicklas |
10 |
} |
5850 |
04 Mar 20 |
nicklas |
else if (autoInit == 'view-genotype') |
5850 |
04 Mar 20 |
nicklas |
12 |
{ |
5850 |
04 Mar 20 |
nicklas |
Events.addEventHandler(element, 'click', vcf.viewGenotype); |
5850 |
04 Mar 20 |
nicklas |
14 |
} |
5850 |
04 Mar 20 |
nicklas |
15 |
} |
5850 |
04 Mar 20 |
nicklas |
16 |
|
5850 |
04 Mar 20 |
nicklas |
vcf.viewGenotype = function(event) |
5850 |
04 Mar 20 |
nicklas |
18 |
{ |
5850 |
04 Mar 20 |
nicklas |
var fileId = Data.int(event.currentTarget, 'file-id'); |
5850 |
04 Mar 20 |
nicklas |
var itemId = Data.get(event.currentTarget, 'item-id'); |
5850 |
04 Mar 20 |
nicklas |
var homeUrl = Data.get(event.currentTarget, 'home'); |
5850 |
04 Mar 20 |
nicklas |
22 |
|
5850 |
04 Mar 20 |
nicklas |
var url = homeUrl+'/analysis/view_genotypes.jsp?ID=' + App.getSessionId(); |
5850 |
04 Mar 20 |
nicklas |
url += '&fileId='+fileId; |
5850 |
04 Mar 20 |
nicklas |
url += '&itemId='+itemId; |
6387 |
15 Sep 21 |
nicklas |
Dialogs.openPopup(url, 'ViewGenotype'+fileId, 750, 500); |
5850 |
04 Mar 20 |
nicklas |
27 |
} |
5850 |
04 Mar 20 |
nicklas |
28 |
|
5850 |
04 Mar 20 |
nicklas |
vcf.viewVariants = function(event) |
5850 |
04 Mar 20 |
nicklas |
30 |
{ |
5850 |
04 Mar 20 |
nicklas |
var fileId = Data.int(event.currentTarget, 'file-id'); |
6387 |
15 Sep 21 |
nicklas |
var itemId = Data.int(event.currentTarget, 'item-id'); |
6387 |
15 Sep 21 |
nicklas |
var mode = Data.get(event.currentTarget, 'mode'); |
5850 |
04 Mar 20 |
nicklas |
var homeUrl = Data.get(event.currentTarget, 'home'); |
5850 |
04 Mar 20 |
nicklas |
35 |
|
7423 |
14 Nov 23 |
nicklas |
var url; |
7423 |
14 Nov 23 |
nicklas |
if (mode == 'variant-call-wgs') |
7423 |
14 Nov 23 |
nicklas |
38 |
{ |
7423 |
14 Nov 23 |
nicklas |
url = homeUrl+'/dnaseq-analysis/view_variants.jsp?ID=' + App.getSessionId(); |
7423 |
14 Nov 23 |
nicklas |
40 |
} |
7423 |
14 Nov 23 |
nicklas |
else |
7423 |
14 Nov 23 |
nicklas |
42 |
{ |
7423 |
14 Nov 23 |
nicklas |
url = homeUrl+'/analysis/view_variants.jsp?ID=' + App.getSessionId(); |
7423 |
14 Nov 23 |
nicklas |
44 |
} |
5850 |
04 Mar 20 |
nicklas |
url += '&fileId='+fileId; |
5850 |
04 Mar 20 |
nicklas |
url += '&itemId='+itemId; |
6387 |
15 Sep 21 |
nicklas |
url += '&mode='+encodeURIComponent(mode); |
7427 |
14 Nov 23 |
nicklas |
Dialogs.openPopup(url, 'ViewVariants'+fileId, 1100, 700); |
5850 |
04 Mar 20 |
nicklas |
49 |
} |
5850 |
04 Mar 20 |
nicklas |
50 |
|
5850 |
04 Mar 20 |
nicklas |
return vcf; |
5850 |
04 Mar 20 |
nicklas |
52 |
}(); |
5850 |
04 Mar 20 |
nicklas |
53 |
|
5850 |
04 Mar 20 |
nicklas |
Doc.addElementInitializer(VcfActions.initElement); |