Merge pull request #5248 from solgenomics/topic/batch_update_trials
[sgn.git] / mason / tools / simsearch / upload_file.mas
bloba430aa1c3e11dfab4ff5f9335e5fd6d90dfa835a
2 <%args>
3 $filename => ""
4 $user_readable_filename => ""
5 $reference_files_menu => ""
6 $format => ""
7 </%args>
9 <& /page/page_title.mas, title => "SimSearch: File $user_readable_filename uploaded for analysis [ $format format ]" &>
11 (working file name <% $filename %>)
13 <div id="simsearch_input_form">
15    Optional: Select reference genotyping file:<br /> 
17    <% $reference_files_menu %><br /><br />
19    <input id="simsearch_filename" type="hidden" name="filename" value="<% $filename %>" />
21    <button class="btn" id="simsearch_run_button">Run SimSearch</button>
23 </div>
24 <br /><br />
26 <div id="simsearch_results">
28    <table id="simsearch_results_table">
29       <thead>
30          <tr><th>Group #</th><th>Member count</th><th>Max score</th><th>Average score</th><th>Group members</th></tr>
31    </table>
33    <div id="simsearch_results_histogram">[HISTOGRAM]</div>
35 </div>
37 <script>
40 jQuery(document).ready( function() { 
41     jQuery('#simsearch_run_button').click( function() {
42         alert("HELLO!");
43         var filename = jQuery('#simsearch_filename').val();
44         var reference_file = jQuery('#reference_file').val();
46         var histogram;
47         jQuery.ajax({
48             url: '/ajax/tools/simsearch/process_file',
49             data: { 'filename' : filename, 'reference_file' : reference_file },
50             method: 'post',
51             timeout: 360000
52         }).done( function(response) {
53             jQuery('#simsearch_results_table').DataTable({
54                 data: response.data,
55             });
56             alert('HISTOGRAM: '+response.histogram);
57             jQuery('#simsearch_results_histogram').html('<img src="'+response.histogram+'"  />');
58         
59         });
60     });
61 });
63 </script>