forked from Dave-Matthews/The-Triticeae-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster3.js
84 lines (78 loc) · 2.65 KB
/
cluster3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*global $,Ajax,Element,window*/
var php_self = document.location.href;
var title = document.title;
var mmm = 10;
var mml = 10;
var mmaf = 5;
var clusters = 5;
function run_rscript(unq_file) {
window.location ="cluster3d.php?clusters=" + clusters + "&time=" + unq_file + "&mmaf=" + mmaf + "&mmm=" + mmm + "&mml=" + mml;
}
function get_alleles(unq_file) {
mmm = $('mmm').getValue();
mml = $('mml').getValue();
mmaf = $('mmaf').getValue();
clusters = $('clusters').getValue();
Element.show('spinner');
var url = "cluster_getalleles.php?time=" + unq_file + "&mmaf=" + mmaf + "&mmm=" + mmm + "&mml=" + mml;
var tmp = new Ajax.Request(url, {
onComplete : function() {
document.title = title;
run_rscript(unq_file);
}
});
}
function get_alleles2(unq_file) {
var url = "cluster_getalleles.php?time=" + unq_file + "&mmaf=" + mmaf + "&mmm=" + mmm + "&mml=" + mml;
var tmp = new Ajax.Request(url, {
onComplete : function() {
document.title = title;
run_rscript(unq_file);
}
});
}
function run_status(unq_file) {
window.location ="cluster3_status.php?clusters=" + clusters + "&time=" + unq_file + "&mmaf=" + mmaf + "&mmm=" + mmm + "&mml=" + mml;
}
function recluster(unq_file) {
mmm = $('mmm').getValue();
mml = $('mml').getValue();
mmaf = $('mmaf').getValue();
var i = document.myForm.elements.length;
var j = document.myForm.elements;
var k = 0;
var param = "function=recluster";
for (k=0; k<i; k++) {
if (document.myForm.elements[k].checked === true) {
param += '&' + document.myForm.elements[k].name + '=' + document.myForm.elements[k].value;
} else if (document.myForm.elements[k].name == 'time') {
param += '&' + document.myForm.elements[k].name + '=' + document.myForm.elements[k].value;
}
}
clusters = $('clusters').getValue();
window.scrollTo(0,0);
document.getElementById('primaryContent').innerHTML = "Creating data file";
Element.show('spinner');
var url = "cluster_lines3d.php";
var tmp = new Ajax.Request(url, {
method: 'post',
postBody: param,
onComplete : function() {
document.title = title;
get_alleles2(unq_file);
}
});
}
function filter_lines() {
var mmm = $('mmm').getValue();
var mml = $('mml').getValue();
var mmaf = $('mmaf').getValue();
var url = "cluster_getalleles.php?mmaf=" + mmaf + "&mmm=" + mmm + "&mml=" + mml;
var tmp = new Ajax.Updater($('filter'), url, {
onCreate: function () { Element.show('spinner'); },
onComplete : function () {
Element.hide('spinner');
document.title = title;
}
});
}