summaryrefslogtreecommitdiff
path: root/views/significant_fragments.haml
blob: 5bb4c317b28484a4389ba802c656054704cfe5e8 (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
%link{ :href=>"/stylesheets/screen.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"}
/TODO put smiles in div if compound image is not available, prevent overlay to table
.content
  %button{:id=>"closebutton", :onclick=>"parent.$('#iframe_details').bPopup().close();parent.$('#iframe_overview').bPopup().close();"}
    X
- if @type =~ /classification/i
  .significant_fragments{:style=>"padding:0.5em;min-height:400px"}
    %h2{:style=>"margin:0px;margin-left:8px;"}
      Significant fragments:

    %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"}
    - if !@significant_fragments.empty?
      %table{:id => "sf1"}
        %tr
          %th{:style=>"border:2px solid #E6E6E6;"}
            Predominantly in compounds with activity "non-active"
          %th{:style=>"border:2px solid #E6E6E6;"}
            p value
          - @significant_fragments.each do |fragments|
            / fragments == [1||2, smarts, pValue]
            - if fragments[0] == 1
              %tr
                %td
                  = fragments[1]
                %td
                  = fragments[2]
        %tr
          %td
            %br
        %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 == [1||2, smarts, pValue]
            - if fragments[0] == 2
              %tr
                %td
                  = fragments[1]
                %td
                  = fragments[2]

- if @type =~ /regression/i
  .descriptors{:style=>"padding:0.5em;min-height:400px"}
    %h2{:style=>"margin:0px;margin-left:8px;"}
      Descriptors:

    %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"}
    - if !@significant_fragments.empty?
      %table{:id => "sf2"}
        %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)