summaryrefslogtreecommitdiff
path: root/views/prediction.haml
blob: ef928fada1b65b4b5925b026db7affaf84edb942 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
:javascript
  $(function() {
    $("#tabs").tabs();
  });

.predictions
  .back
    %h1
      %img{:src=>"/images/arrow_left_float.png", :alt=>"arrow"}
        %a{:href => to('/predict')} New Prediction  

  .overview
    %table{:width=>"100%", :cellspacing=>"1", :id=>"overview"}
      %thead
        %tr
          %caption
            %h2 Prediction Results:
            %i= @identifier
      %tbody
        %tr
          %td{:id=>"compound"}
            %img{:src=>"#{@compound.uri}/image", :alt=>@compound.uri, :width=>"100px"}
          - count=0
          - @predictions.each do |pa|
            - pa.each do |p|
              - p.get
              %td
                %b= @prediction_models[count].title
                - count+=1
                %br
                  = "Result:\n"
                  %b= p.data_entries[0][1]
                %br
                  = "Confidence:\n"
                  = p.data_entries[0][2].round(3)
    
  %script{:src=>"/javascripts/jquery.tablesorter.min.js"}
   
  .results
    #tabs
      %ul
        - count_m = 0
        - @prediction_models.each do |m|
          - count_m += 1
          %li
            %a{:href => "#results_#{count_m}", :id => "link#{m.title}"}
              = m.title
      - count_rs = 0
      - @predictions.each do |pa|
        - count_rs += 1
        #results{:id=>"#{count_rs}"}
          - pa.each do |p|
            / get prediction OpenTox::Dataset   
            - p.get
            / prepare dataset for neighbours table
            - p.data_entries.shift
            - p.compounds.shift

            :javascript
              $(document).ready(function(){ 
                // call the tablesorter plugin 
                $("table##{count_rs}").tablesorter({
                  // debug for development
                  debug: true,
                  widgets: ['zebra'],
                  // disable first column
                  headers: {0: {sorter: false},3: {sorter: false}},
                  // presort similarity asc
                  sortList: [[2,0]]
                });
              });
            / TODO catch table error if tbody is empty      
            %h3= "Neighbours: "
            %table{:id=>"#{count_rs}", :class=>"tablesorter", :cellspacing=>"1"}
              %thead
                %tr
                  %th
                    Compound
                  %th
                    Measured Activity
                  %th
                    Similarity
                  %th
                    Details
              -#%tbody
              - count = 0
              - p.compounds.each do |neighbour_compound|
                %tr
                  %td
                    %img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"}
                  %td= p.data_entries[count][0]
                  %td
                    = p.data_entries[count][3].round(3)
                    
                  %td
                    %a{:href => "#info_#{count}", :id=>"linkNeighbour#{count}"}
                      %img{:src=>"/images/arrow_right_float.png", :alt=>"arrow"}
                    #info{:id=>"#{count}", :style => "display: none;"}
                      info names smiles inchies Eigenschaften physic chem Verwandte links zu anderen Datenbanken info names smiles inchies Eigenschaften physic chem Verwandte links zu anderen Datenbanken info names smiles inchies Eigenschaften physic chem Verwandte links zu anderen Datenbanken info names smiles inchies Eigenschaften physic chem Verwandte links zu anderen Datenbanken info names smiles inchies Eigenschaften physic chem Verwandte links zu anderen Datenbanken
                      
                    :javascript
                      $("a#linkNeighbour#{count}").click(function () {
                        $("#info_#{count}").toggle();
                        document.location = document.location + "#" + "linkNeighbour#{count}";
                      });
                      
                  - count += 1