-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex_dailytest.html
executable file
·944 lines (736 loc) · 30.2 KB
/
index_dailytest.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.form-radio {
-webkit-appearance:none;
width:20px;
height:20px;
border:1px solid darkgray;
border-radius:50%;
outline:none;
cursor: pointer;
margin-right: 7px;
display: inline-block;
position: relative;
background-color: #f1f1f1;
// box-shadow:0 0 5px 0px gray inset;
}
.form-radio:hover {
box-shadow:0 0 5px 0px orange inset;
}
.form-radio:before {
content:'';
display:block;
width:10px; /* updated */
height:10px; /* updated */
margin: 20% auto;
border-radius:50%;
}
.form-radio:checked:before {
background-color: rgb(86,155,248); //blue;
font: 13px/1 'Open Sans', sans-serif;
outline:none;
}
.form-radio:checked:focus {
outline:none;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 20px;
width: 20px;
background-color: #eee;
}
label
{
font: 15px/1.7 'Open Sans', sans-serif;
color: #333;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
// cursor: pointer;
font-weight:normal !important;
}
line {
width: 300px;
margin-left: auto;
margin-right: auto;
height: 100px;
background-color:#2020ab;
opcaity: 0.5;
}
div.content {
width: 1100px;
margin: auto;
}
ul {
list-style-type: none;
margin: auto;
/*padding: 6px;*/
text-align: center;
padding-left: 20px;
width: 1090px;
font-size:14px;
overflow: hidden;
background-color: #007399;
}
li {
float: left;
}
li.right {
float: right;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
header_font {
font-family: "Times New Roman", Times, serif;
font-size: 45px;
}
header_small_font {
font-family: "Times New Roman", Times, serif;
font-size: 20px;
}
.topnav-right {
padding-left: 25px;
}
.table_div {
position: relative;
height: 50px;
width: 200px;
}
.cell_checkbox {
position: absolute;
top: 30%;
left: 0%;
}
.cell_span {
position: absolute;
float: left;
top: 5%;
left: 12%;
}
.cell_select {
position: absolute;
float: left;
top: 45%;
left: 12%;
background-color: inherit;
}
</style>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="images/shutterstock_443040703-1000x480.jpg"/>
<title>chromEvol</title>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="/jquery-csv-master/src/jquery.csv.js"></script>
<script src='js/purl.js'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
var data;
var num_data_col;
var params_list;
$(document).ready(function(){
data = [];
params_list = ['_baseNumberR', '_duplConstR', '_gainConstR', '_lossConstR', '_demiPloidyR'];
params_list_UI_names = ['Base (monoploid) number addition rate', 'Duplication rate', 'Ascending dysploidy rate', 'Descending dysploidy rate', 'Duplication by 1.5 rate'];
num_data_col = 0;
LoadParamTable()
//AddDefaultModel()
//-------------------------------------------------------------
// Load file of user into Text Area of node dating section:
function readTextFile(file, callback, encoding) {
var reader = new FileReader();
reader.addEventListener('load', function (e) {
callback(this.result);
});
if (encoding) reader.readAsText(file, encoding);
else reader.readAsText(file);
}
function fileChosen(input, output) {
if (input.files && input.files[0]) {
readTextFile(
input.files[0],
function (str) {
output.value = str;
}
);
}
}
$('#TreeFile').on('change', function () {
fileChosen(this, document.getElementById('TreeFile_txt'));
});
$('#CountsFile').on('change', function () {
fileChosen(this, document.getElementById('CountsFile_txt'));
});
});
$(document).keyup(function(event) {
if ($("#JobToLoadID").is(":focus") && event.key == "Enter") {
window.location.href ='http://chromEvol.tau.ac.il/results.html?jobId='+document.getElementById('JobToLoadID').value;
}
});
$(function () {
$("#popover1").popover({ container: 'body'});
$("#popover2").popover({ container: 'body'});
$("#popover3").popover({ container: 'body'});
$("#popover4").popover({ container: 'body'});
$("#popover5").popover({ container: 'body'});
$("#popover6").popover({ container: 'body'});
});
function selectAll() {
var items = ["model_BASE_NUM","model_BASE_NUM_DUPL","model_CONST_RATE","model_CONST_RATE_NO_DUPL","model_CONST_RATE_DEMI","model_CONST_RATE_DEMI_EST"];
for (var i = 0; i < items.length; i++) {
document.getElementById(items[i]).checked = true;
}
}
function UnSelectAll() {
var items = ["model_BASE_NUM","model_BASE_NUM_DUPL","model_CONST_RATE","model_CONST_RATE_NO_DUPL","model_CONST_RATE_DEMI","model_CONST_RATE_DEMI_EST"];
for (var i = 0; i < items.length; i++) {
document.getElementById(items[i]).checked = false;
}
}
function eraseInputText() {
document.getElementById("inputText").value = "";
}
function eraseInputTextCounts() {
$(".inputTextCounts").text = "";
}
function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files; // FileList object.
// files is a FileList of File objects. List some properties.
var output = [];
for (var i = 0, f; f = files[i]; i++) {
output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',
f.size, ' bytes, last modified: ',
f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',
'</li>');
}
document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';
}
function handleDragOver(evt) {
evt.stopPropagation();
evt.preventDefault();
evt.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
}
function validateForm() {
// verify there is input
var treeFile = document.forms["myForm"]["TreeFile"].value;
var countsFile = document.forms["myForm"]["CountsFile"].value;
var flag_var = "false";
//if ( (treeFile == "") || (countsFile == ""))
//{
// alert('Please enter tree and counts data !!');
// return false;
//}
//remove empty entries
data_condensed = []
var i;
for (i = 0; i < data.length; i++) {
if (!data_record_is_empty(data[i])) {
data_condensed.push(data[i]);
}
}
//alert(data.length);
if (data_condensed.length == 0) {
alert('Please define at least one model !!');
return false;
}
document.getElementById('definedModels').value = JSON.stringify(data_condensed).replace(/\\"/g, '"').slice(1, -1);
}
$(function(){
$("#header").load("header.html");
//$("#footer").load("footer.html");
});
</script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body onload="javascript:myOnLoad()">
<div class="content">
<div id="header"></div>
<div class="topnav-right">
<br><input type="text" id="JobToLoadID" value="" placeholder="Enter your results ID"/>
<a href='' id="LoadJob_button" onclick="this.href='http://chromEvol.tau.ac.il/results.html?jobId='+document.getElementById('JobToLoadID').value">Load previous results</a>
</div>
<!-- chromEvol_newGUI.cgi testModels.cgi-->
<form name="myForm" method="post" action="../cgi-bin/chromEvol.cgi" enctype="multipart/form-data">
<div class = "col-md-12 col-lg-12">
<br><br>
<div style="text-align:justify"><font face = "serif" size = "5">ChromEvol analyzes changes in chromosome-numbers along a phylogeny and infers polyploidy upon request.<br>
Given a phylogeny and chromosome number data, the program infers the locations and types of chromosome number transitions along the tree.<br></font>
<br><div style="text-align:justify"><font face = "serif" size = "4" >
<span style="font-weight:normal">
If you use (1) chromEvol or the (2) model adequacy framework, please use the following citations:<br>
(1) Glick, Lior, and Itay Mayrose. "ChromEvol: assessing the pattern of chromosome number evolution and the inference of polyploidy along a phylogeny." Molecular Biology and Evolution 31.7 (2014): 1914-1922. <a href="https://doi.org/10.1093/molbev/msu122" target='_blank'>Abstract</a><br>
(2) Rice, Anna, and Itay Mayrose. "Model Adequacy Tests for Probabilistic Models of Chromosome-Number Evolution." New Phytologist (2020). <a href="https://doi.org/10.1111/nph.17106" target='_blank'>Abstract</a>
</span></font>
</div>
<br><br>
</div>
<div class = "col-md-12 col-lg-12">
<div class="col-md-6 col-lg-6">
<font face="serif" size="5" color="#4271bc">Load your Tree file:</font><a id="popover5" data-trigger="hover" class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true"
data-content="Upload tree file in NEWICK format."><span class="glyphicon glyphicon-info-sign infoIcon"></span></a><br>
<input type="file" id="TreeFile" name="TreeFile" >
<textarea id="TreeFile_txt" name="TreeFile_txt" rows=8 cols=50>((((Abutilon_purpusii:0.0148873,Abutilon_geminiflorum:0.0148873):0.016554473,(Abutilon_muelleri_fridericii:0.024721147,Abutilon_regnellii:0.02472114):0.006720628):0.008213082,Abutilon_megapotamicum:0.039654854):0.04234435,(((Abutilon_theophrasti:0.05533544,(Abutilon_fruticosum:0.01260136,Abutilon_indicum:0.01260136):0.04273407):0.005922509,((Abutilon_malacum:0.04835173,(Abutilon_incanum:0.03468077,Abutilon_menziesii:0.03468078):0.01367096):0.005972893,Abutilon_abutiloides:0.05432462):0.006933321):0.006492928,Abutilon_grandifolium:0.06775088):0.01424833);
</textarea>
<br><br></div>
<div class="col-md-6 col-lg-6">
<font face="serif" size="5" color="#4271bc">Load your chromosome counts file:</font><a id="popover6" data-trigger="hover" class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true"
data-content="Upload counts data in FASTA format. For example:<br>>TAXON_NAME1<br>5<br>>TAXON_NAME2<br>7"><span class="glyphicon glyphicon-info-sign infoIcon"></span></a><br>
<input type="file" id="CountsFile" name="CountsFile" >
<textarea id="CountsFile_txt" name="CountsFile_txt" rows=8 cols=50>
>Abutilon_theophrasti
7
>Abutilon_incanum
7
>Abutilon_muelleri_fridericii
8
>Abutilon_indicum
7
>Abutilon_abutiloides
3
>Abutilon_fruticosum
7
>Abutilon_grandifolium
7
>Abutilon_regnellii
8
>Abutilon_purpusii
8
>Abutilon_menziesii
3
>Abutilon_megapotamicum
8
>Abutilon_geminiflorum
8
>Abutilon_malacum
7
</textarea>
<br><br></div>
</div>
<script>
$(function(){
$("#includedContent").load("results.html");
});
</script>
<div class = "col-md-12 col-lg-12">
<div class="col-md-6 col-lg-6">
<font face="serif" size="5" color="#4271bc">Match counts to phylogeny:</font><a id="popover1" data-trigger="hover" class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true"
data-content="(1) Remove from the tree taxa without counts data OR (2) Assign the missing taxa with an X in the counts data.<br>
NOTE: model adequacy test does not consider missing data."><span class="glyphicon glyphicon-info-sign infoIcon"></span></a><br>
<input type="radio" name="PruneCounts" value="PruneTree" id="PruneCounts" class="form-radio" checked="checked"><label for="radio-two">
   Remove tips with no counts data</label>
<br>
<input type="radio" name="PruneCounts" value="Xcounts" id="PruneCounts" class="form-radio"><label for="radio-two">
   Assign taxa with no counts as missing data ('X')</label>
</div><br>
</div><br>
<div class = "col-md-12 col-lg-12">
<!--<div class="col-md-6 col-lg-6" >-->
<font face="serif" size="5" color="#4271bc">Define models:</font><a id="popover2" data-trigger="hover" class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true"
data-content="Select which models to run chromEvol on. Each model is defined by a set of rate parameters. Ascending and descending dysploidies can be executed using constant or linear functions. Click Add model and define its name to load a single model. Click Load default models to use six pre-defined models. The maximal number of evaluated models is six."><span class="glyphicon glyphicon-info-sign infoIcon"></span></a><br>
<button type="button" onclick="AddModel()" id="addModel">+ Add model</button>
<input type="text" id="addModelText" size="6">
<button type="button" onclick="AddDefaultModel()">Load default models</button>
<button type="button" id="clearModels" onclick="ClearModels()">Clear All</button>
<div id='paramTable'>
</div>
<input type="hidden" name="definedModels" id="definedModels" value='[{"name":"DysBnum","_baseNumberR":1,"_duplConstR":0,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":0},{"name":"DysBnumDup","_baseNumberR":1,"_duplConstR":1,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":0},{"name":"DysDup","_baseNumberR":0,"_duplConstR":1,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":0},{"name":"DysDupDem=","_baseNumberR":0,"_duplConstR":1,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":-2},{"name":"DysDupDem","_baseNumberR":0,"_duplConstR":1,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":1},{"name":"Dys","_baseNumberR":0,"_duplConstR":0,"_gainConstR":1,"_lossConstR":1,"_demiPloidyR":0}]'>
<!--</div>-->
</div><br>
<div class = "col-md-12 col-lg-12">
</div><br>
<div class="col-md-12 col-lg-12">
<div class="col-md-6 col-lg-6">
<input type="hidden" name="AdeqTest" value='YES' />
<input type="checkbox" checked="checked" class="checkmark" onclick='onClickAdequacyText(this)'>
<font face="serif" size="5" color="#4271bc">   Run adequacy test:</font><a id="popover3" data-trigger="hover" class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true"
data-content="Select on which models to run model adequacy test:<br>(1) The best selected model (2) One of the models specified by the user (3) All selected models<br>NOTE: running model adequacy on models that include the base-number parameter performs another round of model optimization and will increase running time"><span class="glyphicon glyphicon-info-sign infoIcon"></span></a>
<div style="display:block;" id="AdeqTest_DIV">
<input class="testingDataSetCheckBox" type="radio" checked="checked" name="MA_AdequacyTest" id="MA_AdequacyTest11" value='ChromBestModel' onclick="MA_AdequacyTest_chrom()"/> Chromevol best model<br>
<input class="testingDataSetCheckBox" type="radio" name="MA_AdequacyTest" id="MA_AdequacyTest22" value='MA_AdequacyTest_user' onclick="MA_AdequacyTest_user()" /> Select model<br>
<div style="display:none;" id="MA_AdequacyTest_UserDiv">
<select type="text" name="MA_userModelSelect" id="MA_userModelSelect" class="form-control" />
</select>
</div>
<input class="testingDataSetCheckBox" type="radio" name="MA_AdequacyTest" id="MA_AdequacyTest33" value='AllModels' class="form-radio" onclick="MA_AdequacyTest_all()"/> All models<br><br>
<div style="display:none;" id="MA_AdequacyTest_ChromDiv">
</div>
<!--div style="display:none;" id="MA_AdequacyTest_AllDiv">
<select type="text" name="MA_ModelList" id="MA_ModelList" class="form-control" /></select>
</div-->
</div>
</div>
</div>
<div class="col-md-12 col-lg-12">
<!--/div-->
<!--COMMENTED OUT BY ANNA -- PROBLEM IN PLOIDY INFERENCE (PLOIDY.CSV)-->
<div class="col-md-6 col-lg-6"> <font face="serif" size="5" color="#4271bc">
<input type="checkbox" name="ploidy_ON" id ="ploidy_ON" value="On" class="checkmark" >   Perform ploidy inference</input>
<a id="popover4" data-trigger="hover"
class="btn btn-default transparentBorder fontSize_23px" rel="popover" data-html="true" data-content="Select if you wish to perform ploidy-level inference of the input taxa. This step is computationally intensive."><span class="glyphicon glyphicon-info-sign infoIcon"></span></a><br>
</div><br></font>
<br>
</div>
<div class="col-md-12 col-lg-12">
<div class="col-md-6 col-lg-6">
<label for="inputEmail"><font face="serif" size="5" color="#4271bc">Email address for notifications:</font></label>
<input type="email" class="form-control" name="inputEmail" placeholder="Enter email" value="[email protected]" required>
<br>
</div>
</div>
<div class="col-md-12 col-lg-12">
<div class="col-md-6 col-lg-6">
<label for="jobTitle"><font face="serif" size="5" color="#4271bc">Job Name:</font></label>
<input type="text" class="form-control" name="jobTitle" placeholder="Enter Job Name" value="daily test" required>
</div>
</div>
<br><br>
<div class="col-md-12 col-lg-12" style="text-align:center">
<p><input class="submitButton" type="submit" size="7" name="Submit" value=" Submit " id="submitFormBtn" onsubmit="return validateForm()"></p>
</div>
<br><br><br><br><br><br><br><br>
<div class="col-md-12 col-lg-12" id="phyd3">
<br><br>This site is using phyD3, phylogenetic tree viewer based on D3.js http://phyd3.bits.vib.be Copyright (c) BITS VIB 2016
<!--a href="http://chromevol.tau.ac.il/phyd3-master/view.php?id=example&f=newick" target="_blank">Interactive species tree</a-->
</div>
<!--div class="col-md-12 col-lg-12">
<br><br>
<font face="serif" size="5" color="#4271bc">Select number of Trees:</font>
<span class="glyphicon glyphicon-info-sign infoIcon" data-toggle="tooltip" title="Enter the number of trees to select from the input file"></span><br>
<input name="NumberOfTrees" type="number" value="1" min="1" max="100" step="1" default=> </input>
</div-->
</div>
<link href="bootstrap-3.0.3/dist/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="bootstrap-3.0.3/examples/navbar/navbar.css" rel="stylesheet">
<!-- dataTables is for a sortable table-->
<link rel="stylesheet" type="text/css" media="screen and (min-aspect-ratio: 1/1)" href="http://OneTwoTree.tau.ac.il/css/onetwotree_web.css">
<link rel="stylesheet" type="text/css" media="screen and (max-aspect-ratio: 1/1)" href="http://OneTwoTree.tau.ac.il/css/onetwotree_mobile.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js"></script>
<script src="/js/googleAnalytics.js"></script>
</form>
<script>
function AddModel() {
num_data_col = data.length;
data[num_data_col] = { name: '', _baseNumberR: 0, _duplConstR: 0, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 0};
if (document.getElementById("addModelText").value != "") {
data[num_data_col].name = document.getElementById("addModelText").value;
} else {
data[num_data_col].name = 'model'+(num_data_col+1).toString();
}
document.getElementById("addModelText").value = '';
LoadParamTable();
}
function AddDefaultModel() {
data = [];
data[0] = { name: 'DysBnum', _baseNumberR: 1, _duplConstR: 0, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 0};
data[1] = { name: 'DysBnumDup', _baseNumberR: 1, _duplConstR: 1, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 0};
data[2] = { name: 'DysDup', _baseNumberR: 0, _duplConstR: 1, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 0};
data[3] = { name: 'DysDupDem=', _baseNumberR: 0, _duplConstR: 1, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: -2};
data[4] = { name: 'DysDupDem', _baseNumberR: 0, _duplConstR: 1, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 1};
data[5] = { name: 'Dys', _baseNumberR: 0, _duplConstR: 0, _gainConstR: 1, _lossConstR: 1, _demiPloidyR: 0};
num_data_col = 6;
LoadParamTable();
}
function ClearModels() {
data = [];
num_data_col = 0;
LoadParamTable();
}
function RemoveModel(i) {
if (data.length > 0) {
data.splice(i,1);
}
LoadParamTable();
}
function checkTransition(e, i, j) {
var disabled;
var opacity;
var val;
if (e.checked) {
disabled = false;
opacity = 1.0;
val = 1;
}
else {
disabled = true;
opacity = 0.3;
val = 0;
}
var div = e.parentElement;
div.disabled = disabled;
var nodes = div.getElementsByTagName('*');
for(var k = 0; k < nodes.length; k++){
if (nodes[k].getAttribute('type') != 'checkbox') {
nodes[k].disabled = disabled;
nodes[k].style.opacity = opacity;
}
}
switch (j) {
case 1: data[i]._baseNumberR = val;
break;
case 2: data[i]._duplConstR = val;
break;
case 3: data[i]._gainConstR = val;
break;
case 4: data[i]._lossConstR = val;
break;
case 5: data[i]._demiPloidyR = val;
break;
default: break;
}
//alert(JSON.stringify(data).replace(/\\"/g, '"').slice(1, -1));
}
function selectParam(e, i, j) {
switch (j) {
case 1: data[i]._baseNumberR = parseInt(e.value);
break;
case 2: data[i]._duplConstR = parseInt(e.value);
break;
case 3: data[i]._gainConstR = parseFloat(e.value);
break;
case 4: data[i]._lossConstR = parseFloat(e.value);
break;
case 5: data[i]._demiPloidyR = parseInt(e.value);
break;
default: break;
}
}
function LoadParamTable() {
var html = '<table style="table-layout: fixed; width: 100%; background-color: #F9F9F7;" id="myDataTable" name="myDataTable" class="table Tablefont table-responsive table-bordered rerunTable">';
num_data_col = data.length + 1;
var width_num = ( 85 / num_data_col).toString();
//var header_col = (100 - num_data_col*(( 85 / num_data_col))).toString();
var header_col = '15%';
html += '<col align="center" style="width:'+ header_col + ';">';
if (num_data_col > 1) {
for (var head_i = 0; head_i < num_data_col-1; head_i++){
html += '<col align="center" style="width:' + width_num + '%; ">';
}
html += '<thead><tr bgcolor="#c0c0c0"><td align="center" style="font-size:15px"><span style="font-weight:bold">Transition Type / Model</td></span>';
for (var head_i = 0; head_i < num_data_col-1; head_i++){
html += '<td align="center" style="font-size:15px; padding-top:5; padding-right:0;">\
<div style="position:relative; overflow: auto; height: 100%;">\
<span style="font-weight:bold;">'+data[head_i].name +'<div style="position:absolute; top:-6px; right:0px;">\
<button type="button" onclick="RemoveModel(' + head_i + ')" style="font-size: 6px;">X</button>\
</div></td></span>\
</div>'
}
html += '</thead><tbody>';
for (var i = 1; i < 6; i++) {
html += '<tr>';
html += '<td align="center" style="vertical-align:middle;">'+params_list_UI_names[i-1]+'</td>';
for (var head_i = 0; head_i < num_data_col-1; head_i++){
switch (i) {
case 1: val = data[head_i]._baseNumberR;
break;
case 2: val = data[head_i]._duplConstR;
break;
case 3: val = data[head_i]._gainConstR;
break;
case 4: val = data[head_i]._lossConstR;
break;
case 5: val = data[head_i]._demiPloidyR;
break;
default: break;
}
onchangeArgs = 'this, ' + head_i + ',' + i;
checkedStr = '';
optionStr = '';
selectedStr = '';
opacityStr = 'style="opacity: 0.3;"';
disabledStr = 'disabled';
if (val != 0) {
checkedStr = 'checked';
opacityStr = 'style="opacity: 1.0;"';
disabledStr = ''
}
if (params_list[i-1] == '_demiPloidyR') {
if (val == -2) {
selectedStr = 'selected';
}
optionStr = '<option value="-2" ' + selectedStr + '>= dupl. rate</option>';
}
else if (params_list[i-1] == '_gainConstR' || params_list[i-1] == '_lossConstR') {
if (val == 0.5) {
selectedStr = 'selected';
}
optionStr = '<option value="0.5" ' + selectedStr + '>linear</option>';
}
html += '<td style="height:inherit" align="center">\
<div class="table_div">\
<input type="checkbox" class="cell_checkbox" onchange="checkTransition(' + onchangeArgs + ')" ' + checkedStr + '>\
<span class="cell_span" ' + opacityStr + '>  function:</span>\
<select class="cell_select" ' + opacityStr + ' onchange="selectParam(' + onchangeArgs + ')" ' + disabledStr + '>\
<option value="1">constant</option>\
' + optionStr + '\
</select>\
</div>\
</td>';
}
}
if (num_data_col == 7) {
document.getElementById("addModel").disabled = true;
document.getElementById("addModelText").placeholder = '';
}
else {
document.getElementById("addModel").disabled = false;
document.getElementById("addModelText").placeholder = 'model'+ num_data_col.toString();
}
document.getElementById("clearModels").disabled = false;
}
else {
document.getElementById("addModel").disabled = false;
document.getElementById("clearModels").disabled = true;
document.getElementById("addModelText").placeholder = 'model'+ num_data_col.toString();
}
// close table tags
html += '</tbody>';
html += '</table>';
document.getElementById("paramTable").innerHTML = html;
//$('#paramTable').innerHTML = html;
}
function data_record_is_empty(r) {
//alert ('hi' + r._baseNumberR + ' ' + r._duplConstR + ' ' + r._gainConstR + ' ' + r._lossConstR + ' ' + r._demiPloidyR);
if (r._baseNumberR ==0 && r._duplConstR ==0 && r._gainConstR ==0 && r._lossConstR ==0 && r._demiPloidyR ==0) {
return true;
}
else {
return false;
}
}
function getFoodItem(){
var list1 = document.getElementById('firstList');
var list2 = document.getElementById("secondList");
var list1SelectedValue = list1.options[list1.selectedIndex].value;
list2.options.length=0;
list2.options[0] = new Option('--Select--', '');
if (list1SelectedValue=='Snacks') {
//do something
//list2.options[1] = new Option('Burger123', 'Burger123');
list2.options[2] = new Option('Pizza123', 'Pizza123');
}
if (list1SelectedValue=='Snacks')
{
//list2.options.length=0;
//list2.options[0] = new Option('--Select--', '');
//list2.options[1] = new Option('Burger', 'Burger');
//list2.options[2] = new Option('Pizza', 'Pizza');
list2.options[3] = new Option('Hotdog', 'Hotdog');
list2.options[4] = new Option('Potato Chips', 'Potato Chips');
list2.options[5] = new Option('French Fries', 'French Fries');
}
else if (list1SelectedValue=='Drinks')
{
list2.options.length=0;
list2.options[0] = new Option('--Select--', '');
list2.options[1] = new Option('Coca Cola', 'Coca Cola');
list2.options[2] = new Option('7up', '7up');
list2.options[3] = new Option('Pepsi', 'Pepsi');
list2.options[4] = new Option('Coffee', 'Coffee');
list2.options[5] = new Option('Tea', 'Tea');
}
}
//function MA_AdequacyTest_user() {
// var MA_user_div = document.getElementById("MA_AdequacyTest_UserDiv");
// var MA_chrom_div = document.getElementById("MA_AdequacyTest_ChromDiv");
// var MA_all_div = document.getElementById("MA_AdequacyTest_AllDiv");
// MA_user_div.style.display = "block";
// MA_chrom_div.style.display = "none";
// MA_all_div.style.display = "none";
//
//}
function MA_AdequacyTest_chrom() {
var MA_user_div = document.getElementById("MA_AdequacyTest_UserDiv");
var MA_chrom_div = document.getElementById("MA_AdequacyTest_ChromDiv");
//var MA_all_div = document.getElementById("MA_AdequacyTest_AllDiv");
MA_user_div.style.display = "none";
MA_chrom_div.style.display = "block";
//MA_all_div.style.display = "none";
}
var AdeqDiv = document.getElementById("AdeqTest_DIV");
AdeqDiv.style.display = "block";
function onClickAdequacyText(cb) {
if (cb.checked) {
ShowAdeqTest();
}
else {
RemoveAdeqTest();
}
}
function ShowAdeqTest() {
var AdeqDiv = document.getElementById("AdeqTest_DIV");
//document.getElementById("AdeqTest").value = "On";
AdeqDiv.disabled = false;
var nodes = AdeqDiv.getElementsByTagName('*');
for(var i = 0; i < nodes.length; i++){
nodes[i].disabled = false;
}
AdeqDiv.style.opacity = 1.0;
var AdeqTest = document.getElementsByName("AdeqTest");
AdeqTest[0].value = "YES";
//AdeqDiv.style.display = "block";
}
function RemoveAdeqTest() {
var AdeqDiv = document.getElementById("AdeqTest_DIV");
//document.getElementById("AdeqTest").value = "Off";
//AdeqDiv.style.display = "none";
AdeqDiv.disabled = true;
var nodes = AdeqDiv.getElementsByTagName('*');
for(var i = 0; i < nodes.length; i++){
nodes[i].disabled = true;
}
AdeqDiv.style.opacity = 0.7;
var AdeqTest = document.getElementsByName("AdeqTest");
AdeqTest[0].value = "NO";
}
function MA_AdequacyTest_user() {
//Code for populating dropdown lists:
var list1 = document.getElementById('MA_userModelSelect');
var index=0;
list1.options.length=0;
list1.options[0] = new Option('--Select--', '');
index=index+1;
var i;
for (i = 0; i < num_data_col-1; i++) {
model = data[i].name;
list1.options[index] = new Option(model, model);
index=index+1;
}
var MA_chrom_div = document.getElementById("MA_AdequacyTest_ChromDiv");
var MA_user_div = document.getElementById("MA_AdequacyTest_UserDiv");
var MA_all_div = document.getElementById("MA_AdequacyTest_AllDiv");
var MA_userMo_div = document.getElementById("MA_userModelSelect");
MA_userMo_div.style.display = "block";
MA_chrom_div.style.display = "none";
MA_user_div.style.display = "block";
MA_all_div.style.display = "none";
}
function MA_AdequacyTest_all() {
var MA_user_div = document.getElementById("MA_AdequacyTest_UserDiv");
var MA_userMo_div = document.getElementById("MA_userModelSelect");
MA_userMo_div.style.display = "none";
MA_user_div.style.display = "none";
}
</script>
<br> <br> <br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br>
<br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br>
<br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br>
<br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br>
</div>
</body>
</html>