annotate NCBI Blast reference example_files/format.js @ 120:2729c2326235

Fix for Rikilt issue 13 Hit e-value and identity% should be taken from the hsp with the highest bit score. Previously each of these values was calculated independently. Also use arrays for cover calculation instead of python lists and refactor the hit_info() code a bit.
author Jan Kanis <jan.code@jankanis.nl>
date Thu, 31 Jul 2014 16:14:36 +0200
parents 344cd76f6fd2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
1
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
2 function UpdateDisplayTypes(displayTypes) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
3 dispMenu = displayTypes.options;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
4 for(i=0; i < dispMenu.length; i++) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
5 //if(!utils.hasClass(displayTypes,"psiBlast") && !utils.hasClass(displayTypes,"phiBlast") ||
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
6 if($("stepNumber").value == "" || $("stepNumber").value < 2) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
7 if(dispMenu[i].value.indexOf("PSSM") != -1) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
8 dispMenu[i--] = null;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
9 //break;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
10 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
11 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
12 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
13 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
14
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
15 function GetIndexByValue(selectElem,val) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
16 var idx = 0;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
17 var opts = selectElem.options;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
18 for(i=0; i < opts.length; i++) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
19 if(opts[i].value == val) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
20 idx = i;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
21 break;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
22 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
23 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
24 return idx;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
25 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
26
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
27 function resetAdvView(show)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
28 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
29 var advView = $("advView");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
30 if(show) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
31 if(utils.hasClass(advView, "hidden")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
32 utils.removeClass(advView, "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
33 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
34 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
35 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
36 utils.addClass(advView, "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
37 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
38 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
39
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
40
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
41 function ShowOrHide(hide,elem)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
42 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
43 if(hide) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
44 if(!utils.hasClass(elem, "hidden")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
45 utils.addClass(elem, "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
46 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
47 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
48 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
49 if(utils.hasClass(elem, "hidden")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
50 utils.removeClass(elem, "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
51 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
52 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
53 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
54
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
55 function UpdateFormatTypes(form) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
56 var selectedObjType = form.FORMAT_OBJECT[form.FORMAT_OBJECT.selectedIndex].value;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
57 var hideAdvView = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
58 bioseqFormatHide = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
59 pssmFormatHide = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
60 pssmScFormatHide = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
61 formatTypeHide = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
62 if (selectedObjType == "Alignment") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
63 formatObjectSelectedIndex = 0; //HTML
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
64 formatTypeHide = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
65 hideAdvView = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
66 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
67 if (selectedObjType == "PSSM") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
68 formatObjectSelectedIndex = GetIndexByValue(form.FORMAT_TYPE,"Text");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
69 pssmFormatHide = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
70 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
71 if (selectedObjType == "PSSM_Scoremat") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
72 formatObjectSelectedIndex = GetIndexByValue(form.FORMAT_TYPE,"ASN.1");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
73 pssmScFormatHide = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
74 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
75 else if (selectedObjType == "Bioseq") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
76 formatObjectSelectedIndex = GetIndexByValue(form.FORMAT_TYPE,"ASN.1");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
77 bioseqFormatHide = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
78 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
79 form.FORMAT_TYPE.selectedIndex = formatObjectSelectedIndex;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
80 ShowOrHide(formatTypeHide,form.FORMAT_TYPE);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
81 if ($("bioseqFormat")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
82 ShowOrHide(bioseqFormatHide,$("bioseqFormat"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
83 $("bioseqFormat").readOnly=true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
84 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
85 if ($("pssmFormat")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
86 ShowOrHide(pssmFormatHide,$("pssmFormat"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
87 $("pssmFormat").readOnly=true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
88 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
89 if ($("pssmScFormat")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
90 ShowOrHide(pssmScFormatHide,$("pssmScFormat"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
91 $("pssmScFormat").readOnly=true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
92 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
93 resetAdvView(hideAdvView);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
94 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
95
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
96 function ResetForm()
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
97 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
98 //var defValNodes = cssQuery(".reset");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
99 defValNodes = $("FormatForm").elements;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
100 for(i=0; i < defValNodes.length; i++) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
101 if(utils.hasClass(defValNodes[i],"reset"))
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
102 setDefalValue(defValNodes[i]);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
103 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
104 if ($("FormatForm").FORMAT_OBJECT.type == "select-one") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
105 UpdateFormatTypes($("FormatForm"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
106 UpdateDisplayTypes($("FormatForm").FORMAT_OBJECT);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
107 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
108 if($("FormatForm").RUN_PSIBLAST.checked) setDefalValue($("FormatForm").I_THRESH)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
109 else $("FormatForm").I_THRESH.value="";
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
110 //resetOrganismSuggest($("FormatForm").FORMAT_ORGANISM);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
111 resetOrganismControls($("FormatForm").FORMAT_ORGANISM);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
112 //TO DO: add threshold
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
113 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
114
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
115 function LimitByHitlistSize(list)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
116 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
117 var listBreak = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
118 var optSel = false;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
119 for(i=0; i < list.options.length; i++) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
120 var optVal = parseInt(list.options[i].value ,10);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
121 var hitListSize = parseInt($("maxNumSeq").value ,10);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
122 if(list.options[i].selected) optSel = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
123 if(optVal >= hitListSize) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
124 if(!optSel) {list.options[i].selected = true;}
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
125 list.options.length = i + 1;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
126 break;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
127 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
128 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
129 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
130
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
131 function AddFormatOrgField(e) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
132 AddOrgRow(e, "FORMAT_ORGANISM", "FORMAT_ORG_EXCLUDE");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
133 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
134
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
135 function initSubmit() {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
136
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
137
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
138 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
139
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
140 function adjustFormatOptions()
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
141 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
142 var alignView = $("FormatForm").ALIGNMENT_VIEW;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
143 var formatType = $("FormatForm").FORMAT_TYPE;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
144 var queryAnch = formatType[formatType.selectedIndex].value == "HTML" && (alignView[alignView.selectedIndex].value != "Pairwise" && alignView[alignView.selectedIndex].value != "PairwiseWithIdentities");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
145 var dynFormatQA = !$("FormatForm").OLD_VIEW.checked && queryAnch;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
146 dynFormatPW = !$("FormatForm").OLD_VIEW.checked && formatType[formatType.selectedIndex].value == "HTML" && (alignView[alignView.selectedIndex].value == "Pairwise" || alignView[alignView.selectedIndex].value == "PairwiseWithIdentities");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
147
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
148 UpdateDescriptions(dynFormatPW);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
149 if (dynFormatPW) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
150 jQuery("#frmAln").addClass("hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
151 if (!utils.hasClass($("shl"), "hidden")) jQuery("#shl").addClass("hidden"); //hide SHOW_LINKOUT
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
152 jQuery("#gts").addClass("hidden"); //hide GET_SEQUENCE
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
153 jQuery("#scf").removeClass("hidden");//show CDS_FEAT
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
154 $("FormatForm").SHOW_LINKOUT.checked = true;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
155 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
156 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
157 if(dynFormatQA) $("FRM_ALIGNMENTS").selectedIndex = $("FRM_DESCRIPTIONS").selectedIndex;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
158
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
159 jQuery("#frmAln").removeClass("hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
160 if (dynFormatQA) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
161 if (!utils.hasClass($("shl"), "hidden")) jQuery("#shl").addClass("hidden"); //hide SHOW_LINKOUT
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
162 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
163 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
164 jQuery("#shl").removeClass("hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
165 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
166 if (queryAnch) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
167 jQuery("#scf").addClass("hidden"); //hide CDS_FEAT
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
168 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
169 else {//pairwise old_view=false
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
170 jQuery("#scf").removeClass("hidden"); //hide CDS_FEAT
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
171 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
172 jQuery("#gts").removeClass("hidden"); //GET_SEQUENCE
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
173 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
174 if ($("blastSpec").value == "VecScreen") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
175 adjustVecscreen(dynFormatPW);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
176 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
177 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
178
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
179 function adjustVecscreen(dynFormatPW)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
180 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
181 var dfltDescrInd = 0; //0
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
182 var dfltDynDescrInd = 5; //1000
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
183 var dfltAlnInd = 6; //1000
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
184 if (dynFormatPW) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
185 utils.addClass($("lr"), "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
186 $("FRM_DESCRIPTIONS").selectedIndex = dfltDynDescrInd;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
187 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
188 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
189 utils.removeClass($("lr"), "hidden");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
190 $("FRM_DESCRIPTIONS").selectedIndex = dfltDescrInd;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
191 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
192 $("FRM_ALIGNMENTS").selectedIndex = dfltAlnInd;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
193 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
194
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
195
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
196 function UpdateDescriptions(removeZero)
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
197 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
198 if (removeZero) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
199 dispMenu = $("FormatForm").DESCRIPTIONS;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
200 dispMenu.remove(0);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
201 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
202 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
203 dispMenu = $("FormatForm").DESCRIPTIONS;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
204 if (dispMenu.options[0].value != "0") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
205 if (navigator.userAgent.match(/ie/i)) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
206 dispMenu.add(new Option("0", "0"), 0);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
207 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
208 else {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
209 dispMenu.add(new Option("0", "0"), dispMenu[0]);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
210 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
211 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
212 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
213 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
214
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
215 function InitDynFormatOptions()
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
216 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
217 if ($("OLD_VIEW")) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
218 utils.addEvent($("FormatForm").OLD_VIEW, "click", adjustFormatOptions, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
219 utils.addEvent($("FormatForm").ALIGNMENT_VIEW,"change", adjustFormatOptions, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
220 utils.addEvent($("FormatForm").FORMAT_TYPE, "change", adjustFormatOptions, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
221 adjustFormatOptions();
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
222 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
223 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
224
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
225 function InitFormatPage()
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
226 {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
227 if ($("FormatForm").FORMAT_OBJECT.type == "select-one") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
228 UpdateDisplayTypes($("FormatForm").FORMAT_OBJECT);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
229 UpdateFormatTypes($("FormatForm"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
230 list = $("FormatForm").FORMAT_OBJECT;
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
231 utils.addEvent(list, "change", function() {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
232 UpdateFormatTypes($("FormatForm"));
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
233 },
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
234 false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
235 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
236 utils.addEvent($("resetAll"), "click", ResetForm, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
237 if($("maxNumSeq") != null) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
238 if($("maxNumSeq").value != "") {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
239 LimitByHitlistSize($("FormatForm").DESCRIPTIONS);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
240 LimitByHitlistSize($("FormatForm").ALIGNMENTS);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
241 LimitByHitlistSize($("FormatForm").NUM_OVERVIEW);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
242 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
243 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
244 setupOrganismSuggest($("FormatForm").FORMAT_ORGANISM);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
245 utils.addEvent($("FormatForm"), "submit", function() {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
246 adjustOrgVal($("FormatForm").FORMAT_ORGANISM);},
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
247 false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
248
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
249 if ($("addOrg")) utils.addEvent($("addOrg"), "click", AddFormatOrgField, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
250 InitDynFormatOptions();
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
251 /* add this code if decide image for View Report
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
252 var imgButtons = jQuery("[class='viewReport']");
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
253 for (var i = 0; i < imgButtons.length; i++) {
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
254 var l = imgButtons[i];
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
255 utils.addEvent(l, "click", function() {$("FormatForm").submit();}, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
256 utils.addEvent(l, "mouseover", function() {l.src = l.getAttribute("mouseovImg");}, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
257 utils.addEvent(l, "mouseout", function() {l.src = l.getAttribute("mouseoutImg");}, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
258 utils.addEvent(l, "mousedown", function() {l.src = l.getAttribute("mousedownImg");}, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
259 utils.addEvent(l, "mouseup", function() {l.src = l.getAttribute("mouseupImg");}, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
260 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
261 */
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
262 }
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
263
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
264 utils.addEvent(window, 'load', InitFormatPage, false);
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
265
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
266
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
267
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
268
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
269
bad241dc701f add example input blast xml and output html page
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
270