lazar-gui 1.1.3 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  %h3 Neighbors:
3
3
  / tabs div
4
4
  #tabs
5
- %ul.nav.nav-tabs.nav-justified{:id=>"neighborTabs", :role=>"tablist"}
5
+ %ul.nav.nav-tabs.nav-justified{:id=>"neighborTabs", :role=>"tablist", :style=>"width:100%;overflow-x:auto;"}
6
6
  - @models.each_with_index do |model,i|
7
7
  / get predictionFeature type
8
8
  - m = Model::Lazar.find model.model_id.to_s
@@ -68,7 +68,7 @@
68
68
  = (type == "Regression") ? neighbor[:measurement].collect{|value| "#{value.delog10.signif(3)} (#{unit})</br>#{c.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("</br>") : neighbor[:measurement].join(", ")
69
69
  - else
70
70
  - if !neighbor[:measurement].nil?
71
- = (type == "Regression") ? "#{neighbor[:measurement].delog10.signif(3)} (#{unit})</br>#{c.mmol_to_mg(neighbor[:measurement].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : neighbor[:measurement]
71
+ = (type == "Regression") ? "#{neighbor[:measurement].delog10.signif(3)} (#{unit})</br>#{c.mmol_to_mg(neighbor[:measurement].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : neighbor[:measurement]
72
72
  / Similarity = tanimoto
73
73
  %td{:style =>"vertical-align:middle;padding-left:1em;width:20%;"}
74
74
  = neighbor[:similarity].round(3)
@@ -126,12 +126,11 @@
126
126
  %input{:type => 'text', :name => 'identifier', :id => 'identifier', :size => '60'}
127
127
  %p
128
128
  -#%label{:for=>"fileselect"}
129
- or upload a CSV file for batch predictions (disabled in public version)
129
+ or upload a CSV file for batch predictions:
130
130
  -#%a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :title=>"File format", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"auto", html:"true", content:"One column with compounds and keyword SMILES or InChI in the first row."}}
131
131
  -#%br
132
- -#%span.btn.btn-default.btn-file
133
- -#%input{:type=>"file", :name=> "fileselect", :id=>"fileselect", :accept=>"text/csv", :disabled=>"disabled"}
134
- %input{:type=>"hidden", :name=> "fileselect", :id=>"fileselect", :accept=>"text/csv", :disabled=>"disabled"}
132
+ %span.btn.btn-default.btn-file{:style=>"display:none;"}
133
+ %input{:type=>"file", :name=> "fileselect", :id=>"fileselect", :accept=>"text/csv", :disabled=>"disabled", :type=>"hidden"}
135
134
 
136
135
  %fieldset#middle.well
137
136
  %h2 2. Select one or more endpoints
@@ -140,19 +139,26 @@
140
139
  %div{:id=>endpoint.gsub(/\s+/, "_")}
141
140
  %h4.head-back=endpoint
142
141
  - @models.select{|m| m.endpoint == endpoint}.each do |model|
143
- %div.row{:id => model.id}
144
- %span.col-sm-4
142
+ %div.row{:id => model.id,:style=>"margin-bottom:1em;"}
143
+ %span.col-lg-4.col-md-4.col-sm-4.col-xs-4
145
144
  %input{:type => "checkbox", :name => "selection[#{model.id}]", :id => "selection[#{model.species.gsub(/\s+/, "_")}]", :value => true, :disabled => false}
146
145
  %label{:for => "selection[#{model.species.gsub(/\s+/, "_")}]"}
147
146
  = model.species
148
- %span.col-sm-8
147
+ %span.col-lg-8.col-md-8.col-sm-8.col-xs-8
149
148
  %a.btn.btn-default.btn-xs{:data=>{:toggle=>"collapse"}, :href=>"#details#{model.id}", :onclick=>"load#{model.id}Details('#{model}')", :id => "link#{model.id}", :style=>"font-size:small;"}
149
+ %span.glyphicon.glyphicon-menu-right
150
150
  Details | Validation
151
151
  %img.h2{:src=>"/images/wait30trans.gif", :id=>"circle#{model.id}", :class=>"circle#{model.id}", :alt=>"wait", :style=>"display:none;"}
152
152
  %div.panel-collapse.collapse{:id=>"details#{model.id}", :style=>"margin-left:1em;"}
153
153
  :javascript
154
154
  function load#{model.id}Details(model) {
155
155
  button = document.getElementById("link#{model.id}");
156
+ span = button.childNodes[1];
157
+ if (span.className == "glyphicon glyphicon-menu-right"){
158
+ span.className = "glyphicon glyphicon-menu-down";
159
+ } else if (span.className = "glyphicon glyphicon-menu-down"){
160
+ span.className = "glyphicon glyphicon-menu-right";
161
+ };
156
162
  image = document.getElementById("circle#{model.id}");
157
163
  if ($('modeldetails#{model.id}').length == 0) {
158
164
  $(button).hide();
@@ -170,9 +176,10 @@
170
176
  }
171
177
  %fieldset#bottom.well
172
178
  %div.row
173
- %div.col-md-2
179
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2
174
180
  %h2
175
181
  3. Predict
176
- %div.col-md-10
177
- %input.btn.btn-warning.h2{ :type => "submit", :id => "submit", :value=>">>", :onclick => "getsmiles()"}
182
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10
183
+ %button.has-feedback.btn.btn-warning.h2{:type => "submit", :id => "submit", :value=>"", :onclick => "getsmiles()"}
184
+ %span.glyphicon.glyphicon-play
178
185
  %img.h2{:src=>"/images/wait30trans.gif", :id=>"circle", :class=>"circle", :alt=>"wait", :style=>"display:none;"}
@@ -1,3 +1,11 @@
1
+ :javascript
2
+ $(document).ready(function(){
3
+ $('[data-toggle="popover"]').popover();
4
+ $('.modal').on('hidden.bs.modal', function () {
5
+ $(this).removeData('bs.modal');
6
+ });
7
+ });
8
+
1
9
  %div.well
2
10
  %a.btn.btn-warning{:href => to('/predict')}
3
11
  %i.glyphicon.glyphicon-menu-left
@@ -8,7 +16,7 @@
8
16
  %table.table.table-bordered{:id=>"overview"}
9
17
  %tbody
10
18
  %tr
11
- %td{:id=>"compound", :style=>"vertical-align:top;"}
19
+ %td{:id=>"compound", :style=>"vertical-align:top;text-align:center;"}
12
20
  %a.btn.btn-link{:href => "#details0", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(@compound.id.to_s)}/details"), :id=>"link01"}}
13
21
  = @compound.svg
14
22
  %p= @compound.smiles
@@ -23,7 +31,6 @@
23
31
  = "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})"
24
32
 
25
33
  / check for prediction
26
- /- if prediction[:neighbors].size > 0
27
34
  - if prediction[:neighbors] and !prediction[:value].nil?
28
35
  %p
29
36
  / show model type (classification|regression)
@@ -36,14 +43,17 @@
36
43
 
37
44
  / show message about dbhit and measurements
38
45
  %p
39
- %b Compound is part of the training dataset
46
+ :plain
47
+ This compound was part of the training dataset. <i>All</i> information </br>
48
+ from this compound was removed from the training data before the </br>
49
+ prediction, to obtain unbiased results.
40
50
  %p
41
51
  %b Measured activity:
42
52
  %br
43
53
  - if prediction[:measurements].is_a?(Array)
44
54
  = (type == "Regression") ? prediction[:measurements].collect{|value| "#{value.delog10.signif(3)} (#{unit})</br>#{@compound.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("</br>") : prediction[:measurements].join(", ")
45
55
  - else
46
- = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})</br>#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements]
56
+ = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})</br>#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements]
47
57
 
48
58
  - else
49
59
  - @dbhit[i] = false
@@ -54,7 +64,7 @@
54
64
  / prediction popover
55
65
  %a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"<p>lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.<p><b>Classification:</b></br>Majority vote of neighbor activities weighted by similarity.<p><b>Regression:</b></br>Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.<p><a href=\"http://www.frontiersin.org/Journal/10.3389/fphar.2013.00038/abstract\", target=\"_blank\"> Original publication</a>.<hr></hr><a href=\"https://doi.org/10.3389/fphar.2013.00038\", target=\"_blank\"><img src=\"https://zenodo.org/badge/DOI/10.3389/zenodo.10.3389.svg\" alt=\"DOI\"></a>"}}
56
66
  %br
57
- = (type == "Regression") ? "#{prediction[:value].delog10.signif(3)} (#{unit})</br>#{@compound.mmol_to_mg(prediction[:value].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value]
67
+ = (type == "Regression") ? "#{prediction[:value].delog10.signif(3)} (#{unit})</br>#{@compound.mmol_to_mg(prediction[:value].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value]
58
68
 
59
69
  / show prediction interval or probability
60
70
  %p
@@ -66,7 +76,7 @@
66
76
  %br
67
77
  = interval.nil? ? "--" : "#{interval[1].delog10.signif(3)} - #{interval[0].delog10.signif(3)} (#{unit})"
68
78
  %br
69
- = "#{@compound.mmol_to_mg(interval[1].delog10).signif(3)} - #{@compound.mmol_to_mg(interval[0].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !prediction[:prediction_interval].nil?
79
+ = "#{@compound.mmol_to_mg(interval[1].delog10).signif(3)} - #{@compound.mmol_to_mg(interval[0].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !interval.nil?
70
80
  - else
71
81
  %b Probability:
72
82
  / probability popover
@@ -80,28 +90,26 @@
80
90
 
81
91
  / show warnings and info
82
92
  %p
83
- - if !prediction[:info].blank?
84
- %b info:
85
- %br
86
- %p=prediction[:info].sub(/excluded/, "excluded<br>")
87
- - if !prediction[:warnings].blank?
88
- %b warnings:
89
- - prediction[:warnings].uniq.each do |warning|
93
+ - if !prediction[:info].blank?
94
+ %b Info:
90
95
  %br
91
- %p=warning
92
- %p=warning.sub(/substances/, "substances<br>").sub(/prediction\:/, "prediction\:<br>")
96
+ %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",<br>")
97
+ - if !prediction[:warnings].blank?
98
+ %b Warnings:
99
+ - prediction[:warnings].uniq.each do |warning|
100
+ %p=warning #.sub(/,/, ",<br>")
101
+ /%p=warning.sub(/substances/, "substances<br>").sub(/prediction\:/, "prediction\:<br>")
93
102
  - else
94
103
  %br
95
- - @dbhit[i] = false
96
104
  - if !prediction[:info].blank?
97
- %b info:
105
+ %b Info:
98
106
  %br
99
- %p=prediction[:info].sub(/excluded/, "excluded<br>")
107
+ %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",<br>")
100
108
  - if !prediction[:warnings].blank?
101
- %b warnings:
109
+ %b Warnings:
102
110
  - prediction[:warnings].uniq.each do |warning|
103
111
  %br
104
- %p=warning.sub(/substances/, "substances<br>").sub(/prediction\:/, "prediction\:<br>")
112
+ %p=warning.sub(/,/, ",<br>")
105
113
 
106
114
  / always show the neighbors table, message is given there
107
115
  = haml :neighbors, :layout => false, :model_type => @model_types, :dbhit => @dbhit
@@ -35,14 +35,13 @@ h4.head-back, h5.head-back{
35
35
  }
36
36
  .nav-tabs {
37
37
  background-color: #E7E7E7;
38
- //margin-bottom: 0;
39
38
 
40
39
  li.active a:hover {
41
40
  background-color: #f5f5f5;
42
41
  }
43
42
 
44
43
  li a {
45
- height: 7em;
44
+ //height: 7em;
46
45
  }
47
46
  }
48
47
  img {
@@ -84,11 +83,10 @@ ul.share-buttons{
84
83
  padding-right: 5px;
85
84
  }
86
85
  supporters{
87
- background-color: white;
88
86
  text-align:center;
89
87
  img{
90
88
  width: 200px;
91
- margin-right: 1em;
89
+ margin: 1em;
92
90
  }
93
91
  }
94
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazar-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Helma
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-26 00:00:00.000000000 Z
12
+ date: 2018-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lazar
@@ -17,16 +17,16 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.0
20
+ version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 1.0.0
27
+ version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: gem-path
29
+ name: sinatra
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
@@ -40,7 +40,7 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: sinatra
43
+ name: sinatra-reloader
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -109,6 +109,34 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: qsar-report
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: gem-path
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
112
140
  description: Graphical User Interface for Lazar Toxicology Predictions
113
141
  email:
114
142
  - helma@in-silico.ch
@@ -203,6 +231,7 @@ files:
203
231
  - public/images/ot_logo.png
204
232
  - public/images/wait30trans.gif
205
233
  - public/javascripts/bootstrap.min.js
234
+ - public/javascripts/google_analytics_lazar.js
206
235
  - public/javascripts/jquery-1.11.2.min.js
207
236
  - public/javascripts/jquery-1.8.3.min.js
208
237
  - public/javascripts/jquery-ui-1.10.3.custom.min.js
@@ -383,8 +412,10 @@ files:
383
412
  - public/jsme/jsme.nocache.js
384
413
  - public/rect.png
385
414
  - public/stylesheets/jquery-ui.css
415
+ - qmrf_report.rb
386
416
  - test/lazarweb.rb
387
417
  - test/setup.rb
418
+ - tmp/.gitignore
388
419
  - unicorn.rb
389
420
  - views/batch.haml
390
421
  - views/details.haml
@@ -405,7 +436,7 @@ homepage: http://github.com/opentox/lazar-gui
405
436
  licenses:
406
437
  - GPL-3.0
407
438
  metadata: {}
408
- post_install_message: "\n Service cmds:\n lazar-start &\n lazar-stop\n "
439
+ post_install_message: "\n Service commands:\n lazar-start\n lazar-stop\n "
409
440
  rdoc_options: []
410
441
  require_paths:
411
442
  - lib
@@ -421,7 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
452
  version: '0'
422
453
  requirements: []
423
454
  rubyforge_project: lazar-gui
424
- rubygems_version: 2.5.2
455
+ rubygems_version: 2.6.8
425
456
  signing_key:
426
457
  specification_version: 4
427
458
  summary: lazar-gui