2 $preselected_database => ''
3 $preselected_category => ''
15 foreach my $d (keys(%$databases)) {
16 $menus->{$d} = $m->scomp('/page/html_select.mas', name=>"database", params=>"class\=\"form-control input-sm blast_select_box\"", id=>"database", choices => [ @{$databases->{$d}} ], selected=> $preselected_database );
20 if ($preload_id && $preload_type) {
21 $preload = $preload_id;
27 <& /page/page_title.mas, title=>"In Silico PCR" &>
29 <form id="PCRform" method="post" action="/tools/pcr_results/" enctype="multipart/form-data">
30 <&| /page/info_section.mas, id=>"pcr_parameter_section", title=>"PCR Primers", collapsible=>1, collapsed=>0, subtitle=>'<button type="button" class="btn btn-link pull-right" data-toggle="modal" data-target="#pcr_help" style="padding:0px">Help <span class="glyphicon glyphicon-question-sign"></span></button>' &>
34 <label class="blast_select_label" for="fprimer">Forward Primer </label>
37 <input id="fprimer" class="form-control" size="65" value="CCAGCAATCCTCTTCAAAGC" name="fprimer" />
38 <p id="fprimer_alert" class="text-danger"></p>
44 <input id="frevcom" type="checkbox" name="frevcom"/> <label class="blast_select_label" for="frevcom">Reverse Complement </label>
49 <label class="blast_select_label" for="rprimer">Reverse Primer </label>
52 <input id="rprimer" class="form-control" size="65" value="TGATCCACTGCAAAGTACGC" name="rprimer" />
53 <p id="rprimer_alert" class="text-danger"></p>
60 <input id="rrevcom" type="checkbox" name="rrevcom" /> <label class="blast_select_label" for="rrevcom">Reverse Complement </label>
65 <label class="blast_select_label" for="productLength">Product Maximum Length </label>
68 <input id="product_length" class="blast_select_box form-control" size="5" value="5000" name="productLength" />
69 <p id="product_length_alert" class="text-danger"></p>
74 <label class="blast_select_label" for="allowedMismatches">Allowed Mismatches</label>
77 <input id="allowed_mm" class="blast_select_box form-control" size="5" value="0" name="allowedMismatches" />
78 <p id="allowed_mm_alert" class="text-danger"></p>
85 <&| /page/info_section.mas, id=>"blast_parameter_section", title=>"BLAST parameters", collapsible=>1, collapsed=>0, subtitle=>'<button type="button" class="btn btn-link pull-right" data-toggle="modal" data-target="#blast_help" style="padding:0px">Help <span class="glyphicon glyphicon-question-sign"></span></button>' &>
86 <input type="hidden" name="outformat" value="0" />
88 <div class="form-group form-inline">
90 <tr style="display:none">
94 <& /page/html_select.mas, name=>'Datasets', choices=> $dataset_groups, id=>"dataset_select", name=>"dataset_select", params=>"class\=\"form-control input-sm blast_select_box\"", selected=>"$preselected_category" &>
100 <label class="blast_select_label" for="database_select">Database </label>
103 <span id='database_select' ></span>
109 <label class="blast_select_label" for="matrix">Substitution Matrix</label>
112 <select name="matrix" class="form-control input-sm blast_select_box">
113 <option value="BLOSUM62">BLOSUM62 (default)</option>
114 <option value="BLOSUM80">BLOSUM80 (recent divergence)</option>
115 <option value="BLOSUM45">BLOSUM45 (ancient divergence)</option>
116 <option value="PAM30">PAM30</option>
117 <option value="PAM70">PAM70</option>
123 <label class="blast_select_label" for="evalue">e value</label>
126 <input class="blast_select_box form-control" type="text" size="10" value="10" name="evalue" />
131 <label class="blast_select_label" for="filterq">Filter low complexity</label>
134 <td><input type="checkbox" checked="checked" name="filterq" /></td>
142 <button id="run_blast" class="btn btn-primary">Run</button>
143 <!-- <button id="run_blast" class="btn btn-primary" type="submit" form="PCRform" formaction="/tools/pcr_results" formmethod="post" formenctype="multipart/form-data">Run</button> -->
148 <div class="modal fade" id="pcr_help" role="dialog">
149 <div class="modal-dialog">
151 <!-- Modal content-->
152 <div class="modal-content">
153 <div class="modal-header">
154 <button type="button" class="close" data-dismiss="modal">×</button>
155 <h4 class="modal-title">PCR Parameters Help</h4>
158 <div class="modal-body">
159 <p>Paste your primers, the maximum distance between them and the number of missmatches</p>
162 <div class="modal-footer">
163 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
170 <div class="modal fade" id="blast_help" role="dialog">
171 <div class="modal-dialog">
173 <!-- Modal content-->
174 <div class="modal-content">
175 <div class="modal-header">
176 <button type="button" class="close" data-dismiss="modal">×</button>
177 <h4 class="modal-title">BLAST Parameters Help</h4>
180 <div class="modal-body">
181 <p>Select a genomic database and the other BLAST parameters</p>
184 <div class="modal-footer">
185 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
196 jQuery(document).ready(function() {
197 swap_menu(jQuery('#dataset_select').find(':selected').attr('value'));
199 $("#run_blast").click(function(){
201 $('#PCRform').submit();
204 $("#fprimer").focusout(function(){
205 validate_primer($("#fprimer"));
208 $("#rprimer").focusout(function(){
209 validate_primer($("#rprimer"));
212 $("#product_length").focusout(function(){
213 validate_input_integer($("#product_length"),"Max Product Length should be a positive digit.");
216 $("#allowed_mm").focusout(function(){
217 validate_input_integer($("#allowed_mm"),"Allowed mismatches should be a positive digit.");
220 function swap_menu(group_id) {
221 var menu_html = eval( <% JSON::Any->encode($menus) %>);
222 jQuery('#database_select').html(menu_html[group_id]);
225 function validate_primer(primer) {
227 $(primer).removeClass("alert-danger");
228 $(primer).parent().find("p:first").html("");
230 if ($(primer).val().length < 10) {
231 $(primer).addClass("alert-danger");
232 $(primer).parent().find("p:first").html("Primer must be 10 nt long at least. ");
235 if ($(primer).val().search(/[^ACGT]+/i) > 0) {
236 $(primer).addClass("alert-danger");
237 $(primer).parent().find("p:first").append("Primer can only contain valid nt. ");
242 function validate_input_integer(input,msg) {
244 $(input).removeClass("alert-danger");
245 $(input).parent().find("p:first").html("");
247 if (($(input).val().length < 0) || ($(input).val().search(/[\D]+/) > 0)) {
248 $(input).addClass("alert-danger");
249 $(input).parent().find("p:first").html(msg);
253 // function validate_form() {
255 // validate_primer($("#fprimer"));
256 // validate_primer($("#rprimer"));
257 // validate_input_integer($("#product_length"),"Max Product Length should be a positive digit.");
258 // validate_input_integer($("#allowed_mm"),"Allowed mismatches should be a positive digit.");
273 .blast_select_label {