summaryrefslogtreecommitdiff
path: root/views/significant_fragments.haml
blob: bd3598d6682cf3ddd64550f9a1cddeee077894d2 (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
%div.modal-body{:style=>"padding:10px;"}
  %button.close{ :type=>" button", data: { dismiss:"modal"}} ×
  - if @type =~ /classification/i
    %div.row
      %div.col-md-4
        %h3{:style=>"margin-left:8px;"}
          Significant fragments:
        %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"}
      - if !@significant_fragments.empty?
        %div.col-md-8
          %table{:id => "sf"}
            %tr
              / @value_map => hash; interpret the effect
              %th{:style=>"border:2px solid #E6E6E6;"}
                Predominantly in compounds with activity "inactive"
              %th{:style=>"border:2px solid #E6E6E6;"}
                p value
              - @significant_fragments.each do |fragments|
                / fragments == [effect, smarts, pValue]
                / fragments[0] = effect
                /- $logger.debug "effect:\t#{fragments[0]}\n"
                - if fragments[0] == @value_map.index("inactive")
                  %tr
                    %td
                      / fragments[1] = smarts 
                      = fragments[1]
                      -#%img{:src => "http://smartsview.de/smartsview/auto/png/1/both/#{CGI.escape(fragments[1])}", :class => "smarts"}
                    %td
                      /fragments[2] = pValue
                      = fragments[2]
            %tr
              %th{:style=>"border:2px solid #E6E6E6;"}
                Predominantly in compounds with activity "active"   
              %th{:style=>"border:2px solid #E6E6E6;"}
                p value
              - @significant_fragments.each do |fragments|
                / fragments == [effect, smarts, pValue]
                - if fragments[0] == @value_map.index("active")
                  %tr
                    %td
                      -#%img{:src => "http://smartsview.de/smartsview/auto/png/1/both/#{CGI.escape(fragments[1])}", :class => "smarts"}
                      = fragments[1]
                    %td
                      = fragments[2]
    %br
  - if @type =~ /regression/i
    %div.row
      %div.col-md-4
        %h3
          Descriptors:
        %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"}
      - if !@significant_fragments.empty?
        %div.col-md-8
          %table{:id =>"de"}
            %tr
              %th{:style=>"border:2px solid #E6E6E6;"}
                Descriptor
              %th{:style=>"border:2px solid #E6E6E6;"}
                value
              - @significant_fragments.each do |fragments|
                %tr
                  %td
                    = fragments[0]
                  %td
                    = fragments[1][0].round(3)
    %br