summaryrefslogtreecommitdiff
path: root/views/lazar.haml
blob: 3f1d030926e490bfa18ab48c638c299838642117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%p= link_to "New prediction", "/predict"
.lazar-predictions

  -# explanations
  = haml :lazar_algorithm, :layout => false
  = haml :confidence, :layout => false
  = haml :similarity, :layout => false
  = haml :significant_fragments, :layout => false
  = haml :training_data, :layout => false

  %a{:name => "prediction"}
  %table
    %thead
      %tr
        %th= @prediction.title
        %th= toggle_link("#lazar_algorithm","Prediction")
        %th= toggle_link("#confidence","Confidence")
        %th Supporting information

      %tr
        %td.image= compound_image(@compound,@prediction.descriptors(@compound))
        %td= activity_markup(@prediction.value(@compound))
        %td= sprintf('%.03g', @prediction.confidence(@compound)) 
        %td
          %ul
            %li
              %a{:href => "#prediction", :id => "show_names"} Names and synonyms
              :javascript
                $("a#show_names").click(function () {
                  $("#compound_names").load("#{File.join("/compound",@compound.inchi)}");  
                  $("tr#names").toggle();  
                });
            %li= toggle_link("#fragments","Significant fragments")

      %tr#names{ :style => "display: none;" }
        %td{:colspan => '4'}
          %a{:name => 'names'}
          = hide_link('#names')
          #compound_names
      %tr#fragments{ :style => "display: none;" }
        %td{:colspan => '4'}
          = hide_link('#fragments')
          = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound))}, :layout => false

    %tbody#neighbors
      = haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page},  :layout => false