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="word_size">word_size</label>
134 <input class="blast_select_box form-control" type="text" size="10" value="7" name="word_size" />
140 <label class="blast_select_label" for="filterq">Filter low complexity</label>
143 <td><input type="checkbox" checked="checked" name="filterq" /></td>
151 <button id="run_blast" class="btn btn-primary">Run</button>
152 <!-- <button id="run_blast" class="btn btn-primary" type="submit" form="PCRform" formaction="/tools/pcr_results" formmethod="post" formenctype="multipart/form-data">Run</button> -->
157 <div class="modal fade" id="pcr_help" role="dialog">
158 <div class="modal-dialog">
160 <!-- Modal content-->
161 <div class="modal-content">
162 <div class="modal-header">
163 <button type="button" class="close" data-dismiss="modal">×</button>
164 <h4 class="modal-title">PCR Parameters Help</h4>
167 <div class="modal-body">
168 <p>Paste your primers, the maximum distance between them and the number of missmatches</p>
171 <div class="modal-footer">
172 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
179 <div class="modal fade" id="blast_help" role="dialog">
180 <div class="modal-dialog">
182 <!-- Modal content-->
183 <div class="modal-content">
184 <div class="modal-header">
185 <button type="button" class="close" data-dismiss="modal">×</button>
186 <h4 class="modal-title">BLAST Parameters Help</h4>
189 <div class="modal-body">
190 <p>Select a genomic database and the other BLAST parameters</p>
193 <div class="modal-footer">
194 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
205 jQuery(document).ready(function() {
206 swap_menu(jQuery('#dataset_select').find(':selected').attr('value'));
208 $("#run_blast").click(function(){
210 $('#PCRform').submit();
213 $("#fprimer").focusout(function(){
214 validate_primer($("#fprimer"));
217 $("#rprimer").focusout(function(){
218 validate_primer($("#rprimer"));
221 $("#product_length").focusout(function(){
222 validate_input_integer($("#product_length"),"Max Product Length should be a positive digit.");
225 $("#allowed_mm").focusout(function(){
226 validate_input_integer($("#allowed_mm"),"Allowed mismatches should be a positive digit.");
229 function swap_menu(group_id) {
230 var menu_html = eval( <% JSON::Any->encode($menus) %>);
231 jQuery('#database_select').html(menu_html[group_id]);
234 function validate_primer(primer) {
236 $(primer).removeClass("alert-danger");
237 $(primer).parent().find("p:first").html("");
239 if ($(primer).val().length < 10) {
240 $(primer).addClass("alert-danger");
241 $(primer).parent().find("p:first").html("Primer must be 10 nt long at least. ");
244 if ($(primer).val().search(/[^ACGT]+/i) > 0) {
245 $(primer).addClass("alert-danger");
246 $(primer).parent().find("p:first").append("Primer can only contain valid nt. ");
251 function validate_input_integer(input,msg) {
253 $(input).removeClass("alert-danger");
254 $(input).parent().find("p:first").html("");
256 if (($(input).val().length < 0) || ($(input).val().search(/[\D]+/) > 0)) {
257 $(input).addClass("alert-danger");
258 $(input).parent().find("p:first").html(msg);
262 // function validate_form() {
264 // validate_primer($("#fprimer"));
265 // validate_primer($("#rprimer"));
266 // validate_input_integer($("#product_length"),"Max Product Length should be a positive digit.");
267 // validate_input_integer($("#allowed_mm"),"Allowed mismatches should be a positive digit.");
282 .blast_select_label {