6 $preselected_database => ''
7 $preselected_category => ''
23 foreach my $d (keys(%$databases)) {
24 $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 );
27 my $substitution_matrix_select = $m->scomp('/page/html_select.mas',
29 params=>"class\=\"form-control input-sm blast_select_box\"",
31 choices => [ [ 'BLOSUM62', 'BLOSUM62 (default)' ],
32 [ 'BLOSUM80', 'BLOSUM80 (recent divergence)' ],
33 [ 'BLOSUM45', 'BLOSUM45 (ancient divergence)' ],
38 #print STDERR "INPUT OPTIONS: ".Data::Dumper::Dumper(\@input_options);
39 my $input_options_select = $m->scomp('/page/html_select.mas', name=>'input_options', params=>"class\=\"form-control input-sm blast_select_box\"", id=>'input_options',
40 choices => \@input_options, selected=>$preload_type,
43 # array with the preselected output formats
44 my @parse_options_selected = ();
45 foreach my $po (@parse_options) {
46 if ($po->[0] eq "SGN") {
47 push @parse_options_selected, $po;
49 # if (($po->[0] ne "Basic") && ($po->[0] ne "Table") && ($po->[0] ne "Coverage") && ($po->[0] ne "SGN")) {
50 # push @parse_options_selected, $po;
54 # output formats alphabetically sorted
55 my $parse_options_select = $m->scomp('/page/html_select.mas', name=>'parse_options', id=>'parse_options', params=>"size = \"6\" class\=\"form-control input-sm blast_select_box\"", choices => [sort (map { $_->[0] } @parse_options) ], multiple=>1, selected=> [ sort ( map { $_->[0] } @parse_options_selected) ] );
57 # print STDERR "OUTPUT OPTIONS: ".(join ", ", (sort (map { $_->[0] } @parse_options) ))."\n";
58 # print STDERR "OUTPUT SELECTED: ".(join ", ", (sort (map { $_->[0] } @parse_options_selected) ))."\n";
62 foreach my $g (keys %$databases) {
63 foreach my $d (@{$databases->{$g}}) {
64 $db_type->{$d->[0]} = $d->[2];
67 my $database_type_json = JSON::Any->encode($db_type);
69 #print STDERR Data::Dumper::Dumper($database_type_json);
74 foreach my $t (@input_options) {
75 $q_type->{$t->[1]} = $t->[2];
76 $q_example->{$t->[1]} = $t->[3];
79 #print STDERR Data::Dumper::Dumper($q_type);
80 my $input_option_json = JSON::Any->encode($q_type);
81 my $input_example_json = JSON::Any->encode($q_example);
84 if ($preload_id && $preload_type) {
85 $preload = $preload_id;
89 $preload = $preload_seq;
92 #print STDERR "MENUS: ".Data::Dumper::Dumper($menus);
96 <& /util/import_javascript.mas, classes => [ 'CXGN.Blast' , 'jqueryui'] &>
98 <& /page/page_title.mas, title=>"BLAST" &>
100 <&| /page/info_section.mas, id=>"input_parameter_section", title=>"Input parameters", collapsible=>1, collapsed=>0, subtitle=>'<a class="btn btn-link pull-right" href="/help/tools/blast" target="_blank">Help <span class="glyphicon glyphicon-question-sign"></span></a>' &>
101 <input type="hidden" name="outformat" value="0" />
103 <div class="form-group form-inline">
104 <label class="blast_select_label" for="dataset_select">Categories </label>
106 <& /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" &>
108 % if ($blast_db_icons) {
109 <!-- images to get direct access to the model plant dbs. db_id is the blast_db_id on the SGN database -->
110 <img class="fruit_icon" height="25" src="/documents/img/blast_icons/tomato.png" db_id="28" title="Tomato current DB">
111 <img class="fruit_icon" height="18" src="/documents/img/blast_icons/potato.png" db_id="10" title="Potato current DB">
112 <img class="fruit_icon" height="25" src="/documents/img/blast_icons/pepper.png" db_id="21" title="Pepper current DB">
113 <img class="fruit_icon" height="25" src="/documents/img/blast_icons/eggplant.png" db_id="29" title="Eggplant current DB">
114 <img class="fruit_icon" height="25" src="/documents/img/blast_icons/benth.png" db_id="9" title="N.benthamiana current DB">
119 <label class="blast_select_label" for="database_select">Database </label>
121 <span id='database_select' ></span><a style="font-size: 80%" title="View details of each database" href="/tools/blast/dbinfo">db details</a>
124 <label class="blast_select_label" for="program_select">Program </label>
125 <& /page/html_select.mas, name=>'program_select', id=>'program_select', params=>"class\=\"form-control input-sm blast_select_box\"", choices=>$programs &>
128 <label class="blast_select_label" for="input_example">Query </label>
129 <% $input_options_select %><a id="input_example" style="font-size: 80%;cursor:pointer;">Show example</a>
132 <textarea name="sequence" id="sequence" class="form-control" rows="8" cols="80"><% $preload %></textarea></td></tr>
135 <div style="text-align: center">
136 <button class="btn btn-primary" id="submit_blast_button" type="submit" name="search" value="Search">BLAST</button>
140 <&| /page/info_section.mas, title=>"Advanced Options", collapsible=>1, collapsed =>1, is_subsection=>"1" &>
142 <& /page/info_table.mas, title=>'', data => [
143 'Expect (e-value) Threshold' => '<input id="evalue" class="blast_select_box form-control" type="text" size="6" value="1e-10" name="expect" />',
144 'Substitution Matrix' => $substitution_matrix_select,
145 'Output Options' => $parse_options_select,
146 'Max. hits to show' => '<input id="maxhits" class="blast_select_box form-control" type="text" name="maxhits" size="6" value="20" />',
147 'Filters' => '<div class="checkbox"><label><input type="checkbox" name="filterq" checked="1" /> Filter Low complexity</label>',
150 __tableattrs => 'width="80%"',
158 <&| /page/info_section.mas, title=>"Extract sequences from BLAST databases", collapsible=>1, collapsed =>1 &>
160 <div class="form-inline form-group" style="width:100%">
161 <input class="form-control" value="putrescine" id="blast_desc"/>
162 <button id="search_by_desc" class="btn btn-primary">Search</button>
164 <div class="well well-sm">Select a BLAST database and paste a gene name or description. Eg: Solyc07g063040 or ribulose</div>
167 <&| /page/info_section.mas, title=>"Results", collapsible=>1, collapsed=>0, subtitle=>'<a id="download_table" class="download_tag" target="_blank" href="javascript:download_table();" title="Download results in tabular format">Table⇣</a> <a id="download_basic" class="download_tag" target="_blank" href="javascript:download();" title="Download results in basic format">Basic⇣</a>' &>
169 <tr><td><div id="prereqs"></div></td></tr>
170 <tr><td><div id="Overview_output"></div></td></tr>
171 <tr><td><div id="Coverage_output"></div></td></tr>
172 <tr><td><div id="Table_output" style="min-width:900px;"></div></td></tr>
173 <tr><td><div id="SGN_output"></div></td></tr>
174 <tr><td><div id="Bioperl_output"></div></td></tr>
175 <tr><td><div id="Basic_output"></div></td></tr>
179 <div id="jobid" style="display:none;"></div>
181 <div class="modal fade" id="myModal" role="dialog">
182 <div class="modal-dialog modal-sm">
184 <!-- Modal content-->
185 <div class="modal-content">
186 <div class="modal-header">
187 <h4 class="modal-title">BLAST status</h4>
189 <div class="modal-body">
191 <img src="/img/wheel.gif" />
192 <p id="bs_working_msg"></p>
201 <div class="modal fade" id="search_modal" role="dialog">
202 <div class="modal-dialog modal-lg">
204 <!-- Modal content-->
205 <div class="modal-content">
206 <div class="modal-header">
207 <button type="button" class="close" data-dismiss="modal">×</button>
208 <h4 class="modal-title">Search Result</h4>
211 <div class="modal-body">
212 <p id="search_output" style="max-height:300px;overflow:scroll;"></p>
215 <div class="modal-footer">
216 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
228 jQuery(document).ready(function() {
230 //function to select category and database when click on fruit images
231 jQuery('.fruit_icon').click( function() {
232 var db_id = jQuery(this).attr('db_id');
234 jQuery('#dataset_select').val(db_id);
238 swap_menu(jQuery('#dataset_select').find(':selected').attr('value'));
240 jQuery('#sequence').attr('spellcheck',false);
242 jQuery('#dataset_select').change( function() {
243 var selectedId = jQuery('#dataset_select').find(':selected').attr('value');
244 swap_menu(selectedId);
247 var input_examples = eval(<% $input_example_json %>);
248 var database_types = eval (<% $database_type_json %>);
249 var input_option_types = eval(<% $input_option_json %>);
251 jQuery('#input_example').click( function() {
252 jQuery('#sequence').html( input_examples[jQuery('#input_options').val() ] );
255 jQuery('#submit_blast_button').click( function() {
256 var pasted_seq = jQuery('#sequence').val();
258 if (pasted_seq.match(/>/)) {
259 var seq_num = pasted_seq.match(/>/g);
261 if (seq_num.length <= 20 ) {
262 run_blast(database_types, input_option_types);
264 alert("Please, do not run more than 20 sequences");
267 run_blast(database_types, input_option_types);
271 //search blastdb by description
272 jQuery('#search_by_desc').click( function() {
273 var database = jQuery('#database').val();
274 var blast_desc = jQuery('#blast_desc').val();
275 // alert("db: "+database+", blast_desc: "+blast_desc);
279 url: '/tools/blast/desc_search/',
281 data: {'blast_desc':blast_desc, 'database': database},
282 success: function(response) {
284 $('#search_output').html(response.output_seq);
285 $('#search_modal').modal("show");
288 error: function(response) {
289 alert("An error occurred. The service may not be available right now.");
297 function swap_menu(group_id) {
298 var menu_html = eval( <% JSON::Any->encode($menus) %>);
299 jQuery('#database_select').html(menu_html[group_id]);
327 .blast_select_label {
339 vertical-align:middle;
350 background-color:#EEEEFE;
362 /* min-width: 700px;*/