nano-lazar 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/Gemfile +8 -0
  4. data/LICENSE.md +596 -0
  5. data/README.md +52 -0
  6. data/VERSION +1 -0
  7. data/application.rb +185 -0
  8. data/bin/nano-lazar-start +8 -0
  9. data/bin/nano-lazar-start.sh +8 -0
  10. data/bin/nano-lazar-stop +5 -0
  11. data/bin/nano-lazar-stop.sh +52 -0
  12. data/config.ru +13 -0
  13. data/feature-filter.rb +36 -0
  14. data/helper.rb +1 -0
  15. data/nano-lazar.gemspec +31 -0
  16. data/npo.rb +11 -0
  17. data/public/css/bootstrap.min.css +6 -0
  18. data/public/css/images/black-asc.gif +0 -0
  19. data/public/css/images/black-desc.gif +0 -0
  20. data/public/css/images/black-unsorted.gif +0 -0
  21. data/public/css/images/bootstrap-black-unsorted.png +0 -0
  22. data/public/css/images/bootstrap-white-unsorted.png +0 -0
  23. data/public/css/images/dragtable-handle.png +0 -0
  24. data/public/css/images/dragtable-handle.svg +7 -0
  25. data/public/css/images/dropbox-asc-hovered.png +0 -0
  26. data/public/css/images/dropbox-asc.png +0 -0
  27. data/public/css/images/dropbox-desc-hovered.png +0 -0
  28. data/public/css/images/dropbox-desc.png +0 -0
  29. data/public/css/images/first.png +0 -0
  30. data/public/css/images/green-asc.gif +0 -0
  31. data/public/css/images/green-desc.gif +0 -0
  32. data/public/css/images/green-header.gif +0 -0
  33. data/public/css/images/green-unsorted.gif +0 -0
  34. data/public/css/images/ice-asc.gif +0 -0
  35. data/public/css/images/ice-desc.gif +0 -0
  36. data/public/css/images/ice-unsorted.gif +0 -0
  37. data/public/css/images/last.png +0 -0
  38. data/public/css/images/loading.gif +0 -0
  39. data/public/css/images/metro-black-asc.png +0 -0
  40. data/public/css/images/metro-black-desc.png +0 -0
  41. data/public/css/images/metro-loading.gif +0 -0
  42. data/public/css/images/metro-unsorted.png +0 -0
  43. data/public/css/images/metro-white-asc.png +0 -0
  44. data/public/css/images/metro-white-desc.png +0 -0
  45. data/public/css/images/next.png +0 -0
  46. data/public/css/images/prev.png +0 -0
  47. data/public/css/images/white-asc.gif +0 -0
  48. data/public/css/images/white-desc.gif +0 -0
  49. data/public/css/images/white-unsorted.gif +0 -0
  50. data/public/css/jquery-ui.css +1225 -0
  51. data/public/css/jquery-ui.theme.min.css +5 -0
  52. data/public/css/style.css +16 -0
  53. data/public/css/theme.bootstrap.min.css +1 -0
  54. data/public/css/theme.default.min.css +1 -0
  55. data/public/enm-workshop.html +468 -0
  56. data/public/enm-workshop.rst +98 -0
  57. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  58. data/public/fonts/glyphicons-halflings-regular.svg +288 -0
  59. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  60. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  61. data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  62. data/public/images/Email.png +0 -0
  63. data/public/images/Facebook.png +0 -0
  64. data/public/images/Google+.png +0 -0
  65. data/public/images/IST_logo_s.png +0 -0
  66. data/public/images/LinkedIn.png +0 -0
  67. data/public/images/Twitter.png +0 -0
  68. data/public/images/enm-sm.jpg +0 -0
  69. data/public/images/enm_logo.png +0 -0
  70. data/public/images/favicon.ico +0 -0
  71. data/public/images/ist_logo.png +0 -0
  72. data/public/images/wait30trans.gif +0 -0
  73. data/public/javascripts/bootstrap.min.js +7 -0
  74. data/public/javascripts/google_analytics.js +7 -0
  75. data/public/javascripts/jquery-1.11.2.min.js +4 -0
  76. data/public/javascripts/jquery-ui-1.10.3.custom.min.js +6 -0
  77. data/public/javascripts/jquery.bpopup.min.js +7 -0
  78. data/public/javascripts/jquery.doubleScroll.js +126 -0
  79. data/public/javascripts/jquery.tablesorter.min.js +2 -0
  80. data/public/javascripts/jquery.tablesorter.staticrow.min.js +1 -0
  81. data/public/javascripts/jquery.tablesorter.widgets.js +2917 -0
  82. data/public/javascripts/jquery.tools.min.js +5 -0
  83. data/public/javascripts/lazar-gui.js +11 -0
  84. data/public/javascripts/nanolazar.js +11 -0
  85. data/public/javascripts/widget-scroller.js +921 -0
  86. data/public/ui/small-white/blank.gif +0 -0
  87. data/public/ui/small-white/framing.css +24 -0
  88. data/public/ui/small-white/iepngfix.htc +42 -0
  89. data/public/ui/small-white/opera.css +8 -0
  90. data/public/ui/small-white/outline.css +16 -0
  91. data/public/ui/small-white/pretty.css +114 -0
  92. data/public/ui/small-white/print.css +24 -0
  93. data/public/ui/small-white/s5-core.css +11 -0
  94. data/public/ui/small-white/slides.css +10 -0
  95. data/public/ui/small-white/slides.js +558 -0
  96. data/unicorn.rb +2 -0
  97. data/views/layout.haml +95 -0
  98. data/views/license.haml +1 -0
  99. data/views/predict.haml +299 -0
  100. data/views/prediction.haml +152 -0
  101. metadata +235 -0
@@ -0,0 +1,299 @@
1
+ :javascript
2
+
3
+ $(window).bind("pageshow", function(event) {
4
+ $("img.circle").hide();
5
+ });
6
+
7
+ function showcircle() {
8
+ $("img.circle").show();
9
+ };
10
+
11
+ function addCoating(type, coatings) {
12
+ //console.log(type, coatings);
13
+ var allCoatings = coatings;
14
+ var usedCoatings = [];
15
+ var removedCoating = [];
16
+ var div = document.getElementById("coatings");
17
+ var selectChilds = div.getElementsByTagName("select");
18
+ console.log(selectChilds);
19
+ // iterate the whole select elements and decide to add or remove;
20
+ // last coating should be always present; remove all used coatings
21
+ // from the option list for new elements, but add them back if a
22
+ // select element was removed;
23
+ for(i=0; i < selectChilds.length; i++){
24
+ id = selectChilds[i].id;
25
+ console.log(selectChilds[i].id);
26
+ value = selectChilds[i].value;
27
+ console.log(selectChilds[i].value);
28
+
29
+ if (type === "add"){
30
+ var element = document.getElementById(id);
31
+ var clone = element.cloneNode(true);
32
+ console.log(i);
33
+ console.log(i+1);
34
+ clone.id = "selCoating" + (selectChilds.length + 1);
35
+ clone.name = "input_coating_" + (selectChilds.length + 1);
36
+ console.log(clone.name);
37
+ div.appendChild(clone);
38
+ break;
39
+ };
40
+ if (type === "remove" && i !== 0){
41
+ var id = selectChilds[selectChilds.length - 1].id
42
+ document.getElementById(id).remove();
43
+ break;
44
+ }else{
45
+ //alert("One coating is required.")
46
+ };
47
+ };
48
+ };
49
+
50
+ $(document).ready(function(){
51
+ $('#selCore1').change(function(){
52
+ var selection = $(this).val();
53
+ switch(selection){
54
+ case "Ag":
55
+ $("#physchem1").prop('disabled', false);
56
+ $("#physchem2").prop('disabled', false);
57
+ $("#physchem3").prop('disabled', true);
58
+ $("#physchem4").prop('disabled', true);
59
+ $("#physchem5").prop('disabled', true);
60
+ $("#physchem6").prop('disabled', false);
61
+ $("#physchem7").prop('disabled', true);
62
+ $("#physchem8").prop('disabled', true);
63
+ $("#physchem9").prop('disabled', true);
64
+ $("#physchem10").prop('disabled', true);
65
+ break;
66
+ case "Au":
67
+ $("#physchem1").prop('disabled', false);
68
+ $("#physchem2").prop('disabled', false);
69
+ $("#physchem3").prop('disabled', false);
70
+ $("#physchem4").prop('disabled', false);
71
+ $("#physchem5").prop('disabled', false);
72
+ $("#physchem6").prop('disabled', false);
73
+ $("#physchem7").prop('disabled', false);
74
+ $("#physchem8").prop('disabled', false);
75
+ $("#physchem9").prop('disabled', false);
76
+ $("#physchem10").prop('disabled', false);
77
+ break;
78
+ };
79
+ });
80
+ });
81
+
82
+ %div.well
83
+ %h3.help-block
84
+ Select an endpoint:
85
+ #tabs
86
+ %ul.nav.nav-tabs{:id=>"modelTab", :role=>"tablist"}
87
+ - @prediction_models.each_with_index do |m, idx|
88
+ %li{:class => ("active" if idx == 0)}
89
+ %a{:href => "#model_#{idx}", :id => "linkTab#{idx}", data: {toggle:"tab"}}
90
+ = "#{idx+1}. #{m["type"].capitalize}"
91
+ %div.tab-content
92
+ - @prediction_models.each_with_index do |m, idx|
93
+ - case m["type"]
94
+ - when "fingerprint"
95
+ - example = @example_fingerprint
96
+ - type = "fingerprint"
97
+ - relevant_features = @fingerprint_relevant_features
98
+ - when "physchem"
99
+ - example = @example_physchem
100
+ - type = "physchem"
101
+ - relevant_features = @physchem_relevant_features
102
+ - when "proteomics"
103
+ - example = @example_proteomics
104
+ - type = "proteomics"
105
+ - relevant_features = @proteomics_relevant_features
106
+
107
+ #model.tab-pane{:id=>"#{idx}", :class => ("active" if idx == 0)}
108
+ %b Model:
109
+ %br
110
+ Name:
111
+ = m.model.name
112
+ %br
113
+ Type: regression
114
+ %br
115
+ Source:
116
+ %a{:href=>"#{m.source}", :alt=>"source", :rel=>"external"}
117
+ = m.source
118
+ %br
119
+ Species:
120
+ = m.species
121
+ %br
122
+ Training nanoparticles:
123
+ = m.model.training_dataset.nanoparticles.size
124
+ %br
125
+ Endpoint:
126
+ = m.endpoint
127
+ %br
128
+ Unit:
129
+ = m.unit
130
+ %br
131
+ %b Algorithms:
132
+ %br
133
+ Similarity:
134
+ %a{:href=> "http://www.rubydoc.info/gems/lazar/OpenTox%2F#{m.model.algorithms["similarity"]["method"].sub("::", "%2F")}", :rel=>"external"}
135
+ = m.model.algorithms["similarity"]["method"]
136
+ = ", min: #{m.model.algorithms["similarity"]["min"]}"
137
+ %br
138
+ Prediction:
139
+ %a{:href=>"http://www.rubydoc.info/gems/lazar/OpenTox%2F#{m.model.algorithms["prediction"]["method"].sub("::","%2f")}", :rel=>"external"}
140
+ = m.model.algorithms["prediction"]["method"]
141
+ %br
142
+ Feature selection:
143
+ = m.model.algorithms["feature_selection"]["method"].split(".").last if m.model.algorithms["feature_selection"]
144
+ %br
145
+ Descriptors:
146
+ = m.model.algorithms["descriptors"]["method"]+","
147
+ = m.model.algorithms["descriptors"]["categories"]
148
+ %p
149
+ %b Independent crossvalidations (log2 transformed):
150
+ %div.row{:id=>"validations#{m.id}", :style=>"background-color:#f5f5f5;"}
151
+ - m.crossvalidations.each do |cv|
152
+ %span.col-xs-2.col-sm-2.col-md-2.col-lg-2
153
+ = "Num folds:\t"
154
+ = cv.folds
155
+ %br
156
+ = "Num instances:\t"
157
+ = cv.nr_instances
158
+ %br
159
+ = "Num unpredicted"
160
+ = cv.nr_unpredicted
161
+ %br
162
+ %a.ht5{:href=>"https://en.wikipedia.org/wiki/Root-mean-square_deviation", :rel=>"external"} RMSE:
163
+ = cv.rmse.round(3) if cv.rmse
164
+ %br
165
+ %a.ht5{:href=>"https://en.wikipedia.org/wiki/Mean_absolute_error", :rel=>"external"} MAE:
166
+ = cv.mae.round(3) if cv.mae
167
+ %br
168
+ %a.ht5{:href=>"https://en.wikipedia.org/wiki/Coefficient_of_determination", :rel=>"external"}= "R"+"<sup>2</sup>"+":"
169
+ = cv.r_squared.round(3) if cv.r_squared
170
+ %br
171
+ %b QMRF report
172
+ %p
173
+ %a.btn.btn-default{:href=>to('/qmrf-report/'+m.id), :rel=>"external"} download
174
+ %hr
175
+ %form{:id=>idx, :role=>"form", :action=> to("/predict"), :method=>"post"}
176
+ %h3.help-block
177
+ Please characterise a nanoparticle:
178
+
179
+ - if type == "fingerprint"
180
+
181
+ %div.form-group
182
+ // type = fingerprint
183
+ // send hidden example data to compare
184
+ %input{:id=>"type",:type=>"hidden",:name=>"type",:value=>"#{type}"}
185
+ %input{:id=>"example_core",:type=>"hidden",:name=>"example_core",:value=>"#{example.core["name"]}"}
186
+ - example.coating.each_with_index do |ex_coating, idx|
187
+ %input{:id=>"example_coating_#{idx}",:type=>"hidden",:name=>"example_coating_#{idx}",:value=>"#{ex_coating["name"]}"}
188
+ %input{:id=>"example_pc",:type=>"hidden",:name=>"example_pc",:value=>"{}"}
189
+ %input{:id=>"id",:type=>"hidden",:name=>"example_id",:value=>example.id}
190
+
191
+ // input form parameters to transfer
192
+ // core
193
+ %div.form-group
194
+ %label{:for=>"selCore#{idx}"} Core
195
+ %select.form-control{:id=>"selCore#{idx}", :autocomplete=>"off", :name=>"input_core",:value=>example.core["name"]}
196
+ %option{:selected => ("selected" if example.core["name"] == "Ag"), :value => "Ag"} Ag
197
+ %option{:selected => ("selected" if example.core["name"] == "Au"), :value => "Au"} Au
198
+
199
+ // coating
200
+ - coatings = $coating_list.collect{|nano| nano.coating.collect{|co| co["name"]}}.flatten.compact.uniq.sort_by(&:downcase)
201
+ %div.form-group{:id=>"coatings"}
202
+ %label{:for=>"selCoating#{idx}"} Coating
203
+ - example.coating.each_with_index do |ex_coating, idx|
204
+ %select.form-control{:id=>"selCoating#{idx}", :autocomplete=>"off", :name=>"input_coating_#{idx}",:value=>ex_coating["name"]}
205
+ - coatings.each do |co|
206
+ %option{:selected => ("selected" if ex_coating["name"] == co), :value => co}
207
+ = co
208
+
209
+ %div{:id=>"coating_buttons"}
210
+ %span.btn.glyphicon.glyphicon-plus{:onclick=>"addCoating(\"add\", #{coatings});"}
211
+ %span.btn.glyphicon.glyphicon-minus{:onclick=>"addCoating(\"remove\", #{coatings});"}
212
+
213
+ - if type =~ /physchem/
214
+ %div.form-group
215
+ // type = physchem,proteomics
216
+ // send hidden example data to compare
217
+ %input{:id=>"type",:type=>"hidden",:name=>"type",:value=>"#{type}"}
218
+ %input{:id=>"example_core",:type=>"hidden",:name=>"example_core",:value=>"#{example.core["name"]}"}
219
+ %input{:id=>"example_coating",:type=>"hidden",:name=>"example_coating",:value=>"#{example.coating[0]["name"]}"}
220
+ %input{:id=>"example_pc",:type=>"hidden",:name=>"example_pc",:value=>"#{example.properties}"}
221
+ - size = relevant_features.size
222
+ %input{:id=>"size",:type=>"hidden",:name=>"size",:value=>size}
223
+ %input{:id=>"id",:type=>"hidden",:name=>"example_id",:value=>example.id}
224
+
225
+ // input form parameters to transfer
226
+ // core
227
+ %div.form-group
228
+ %label{:for=>"selCore#{idx}"} Core
229
+ %select.form-control{:id=>"selCore#{idx}", :autocomplete=>"off", :name=>"input_core",:value=>example.core["name"]}
230
+ %option{:selected => ("selected" if example.core["name"] == "Ag"), :value => "Ag"} Ag
231
+ %option{:selected => ("selected" if example.core["name"] == "Au"), :value => "Au"} Au
232
+
233
+ // relevant features
234
+ - relevant_features.sort_by{|f| f.name}.each_with_index do |relf,id|
235
+ - feature = relf
236
+ - v = example.properties.find{|id,v| id == feature.id.to_s }
237
+ - name = feature.name
238
+ - if feature[:conditions] && !feature[:conditions]["MEDIUM"].blank?
239
+ - name = feature.name + " / " + feature[:conditions]["MEDIUM"]
240
+ - else
241
+ - name = feature.name
242
+ - val = !v.nil? ? v[1] : ""
243
+ - id = id + 1
244
+
245
+ %h5
246
+ %a.descriptor{:href=>$npo[feature.name], :rel=>"external"}= name + (feature.unit.blank? ? "" : " (#{feature.unit})")
247
+
248
+ // input physchem parameters
249
+ %input.input-sm.form-control{:id=>"physchem#{id}",:type=>"text",:name=>"input_value_#{id}",:value=>"#{val[0]}", :disabled=>("disabled" if val[0].blank?)}
250
+ %input{:id=>id,:type=>"hidden",:name=>"input_key_#{id}",:value=>feature.id}
251
+
252
+ - if type =~ /proteomics/
253
+ %div.form-group
254
+ // type = physchem,proteomics
255
+ // send hidden example data to compare
256
+ %input{:id=>"type",:type=>"hidden",:name=>"type",:value=>"#{type}"}
257
+ %input{:id=>"example_core",:type=>"hidden",:name=>"example_core",:value=>"#{example.core["name"]}"}
258
+ %input{:id=>"example_coating",:type=>"hidden",:name=>"example_coating",:value=>"#{example.coating[0]["name"]}"}
259
+ %input{:id=>"example_pc",:type=>"hidden",:name=>"example_pc",:value=>"#{example.properties}"}
260
+ - size = relevant_features.size
261
+ %input{:id=>"size",:type=>"hidden",:name=>"size",:value=>size}
262
+ %input{:id=>"id",:type=>"hidden",:name=>"example_id",:value=>example.id}
263
+
264
+ // input form parameters to transfer
265
+ // core
266
+ %div.form-group
267
+ %label{:for=>"selCore#{idx}"} Core
268
+ %select.form-control{:id=>"selCore#{idx}", :autocomplete=>"off", :name=>"input_core",:value=>example.core["name"]}
269
+ %option{:selected => ("selected" if example.core["name"] == "Ag"), :value => "Ag"} Ag
270
+ %option{:selected => ("selected" if example.core["name"] == "Au"), :value => "Au"} Au
271
+
272
+ // relevant features
273
+ - relevant_features.sort_by{|f| f.name}.each_with_index do |relf,id|
274
+ - feature = relf
275
+ - v = example.properties.find{|id,v| id == feature.id.to_s }
276
+ - name = feature.name
277
+ - if feature[:conditions] && !feature[:conditions]["MEDIUM"].blank?
278
+ - name = feature.name + " / " + feature[:conditions]["MEDIUM"]
279
+ - else
280
+ - name = feature.name
281
+ - val = !v.nil? ? v[1] : ""
282
+ - id = id + 1
283
+
284
+ %h5
285
+ %a{:href=>"http://www.uniprot.org/uniprot/#{name}", :rel=>"external"}= name + (feature.unit.blank? ? "" : " (#{feature.unit})")
286
+
287
+ // input physchem parameters
288
+ %input.input-sm.form-control{:id=>"#{id}",:type=>"text",:name=>"input_value_#{id}",:value=>"#{val[0]}"}
289
+ %input{:id=>id,:type=>"hidden",:name=>"input_key_#{id}",:value=>feature.id}
290
+
291
+ // prediction model id
292
+ %input{:id=>"prediction_model",:type=>"hidden",:name=>"prediction_model",:value=>m.id}
293
+
294
+ %hr
295
+ #predict
296
+ %button.btn.btn-success{:id=>"submitbutton", :type=>"submit", :onclick=>"showcircle();"}
297
+ Find similar nano particles
298
+ %span.glyphicon.glyphicon-chevron-right{:id=>"span"}
299
+ %img{:src=>"/images/wait30trans.gif", :id=>"circle", :class=>"circle", :alt=>"wait", :style=>"display:none;"}
@@ -0,0 +1,152 @@
1
+ %div
2
+ %a.btn.btn-xs.btn-default{:href => to('/predict'), :style=>"margin-bottom:1em;"}
3
+ %span.glyphicon.glyphicon-chevron-left
4
+ New Prediction
5
+
6
+ %h3.help-block
7
+ Similar particles
8
+
9
+ %hr
10
+ :javascript
11
+ $(document).ready(function(){
12
+ $(".tablesorter").tablesorter({
13
+ debug: false,
14
+ theme: "bootstrap",
15
+ //headerTemplate: '{content} {icon}',
16
+ widgets: ['uitheme', 'staticRow', 'stickyHeaders'],
17
+ widgetOptions: {
18
+ stickyHeaders_attachTo: 'neighbors',
19
+ stickyHeaders_offset: 0,
20
+ stickyHeaders_xScroll : null
21
+ },
22
+ sortList: [[1,1]],
23
+ widthFixed: false,
24
+ });
25
+ $('#neighbors').doubleScroll();
26
+ });
27
+
28
+
29
+ #neighbors.table-responsive
30
+ /%table.tablesorter{:style => "max-width:100%;white-space:nowrap;"}
31
+ %table.tablesorter
32
+ %thead
33
+ %tr
34
+ %th
35
+ ID
36
+ %th
37
+ Similarity
38
+ %th
39
+ Composition
40
+ %th.tox{:style => "max-width:100%;white-space:nowrap;"}
41
+ Toxicity
42
+ %br
43
+ Net cell association
44
+ %br
45
+ [mL/ug(Mg)]
46
+ - if @type =~ /physchem|proteomics/
47
+ - @input.each{|d| Feature.find(d[0]).category}.each do |key|
48
+ - feature = Feature.find_by(:id=>key[0])
49
+ - name = feature.name
50
+ - if (feature[:conditions] && !feature[:conditions]["MEDIUM"].blank?)
51
+ - name = feature.name + " / " + feature[:conditions]["MEDIUM"]
52
+ - else
53
+ - name = feature.name
54
+ %th.physchem.sorter-false
55
+ %a.descriptor{:href=>$npo[feature.name], :rel=>"external"}= name + (feature.unit.blank? ? "" : " (#{feature.unit})")
56
+ %tbody
57
+ / query and match combined
58
+ %tr.static
59
+ / id
60
+ %td
61
+ - if @match
62
+ %a{:href=> $ambit_search+@name, :rel=>"external"}
63
+ %h5.th5= @name
64
+ - else
65
+ %h5.th5 Query
66
+ / similarity
67
+ %td
68
+ %h5.th5 1.0
69
+ / composition
70
+ %td
71
+ - core = Substance.find @nanoparticle[:core_id]
72
+ %h5.th5 Core:
73
+ %a{:href=>core.source, :rel=>"external"}= "["+core.name+"]"
74
+ %br
75
+ - if @type == "fingerprint"
76
+ - coating = []
77
+ - @nanoparticle[:coating_ids].each{|id| coating << Substance.find(id) }
78
+ %h5.th5 Coating:
79
+ - coating.each do |co|
80
+ %a{:href=>co.source, :rel=>"external"}= co.name
81
+ %br
82
+ / tox
83
+ %td.tox
84
+ - if @prediction[:value]
85
+ %h5.th5 Prediction:
86
+ = @prediction[:value].round(3)
87
+ %br
88
+ - if @prediction[:value].blank?
89
+ %h5.th5 Prediction:
90
+ = "not available"
91
+ %br
92
+ - if @prediction[:prediction_interval]
93
+ %h5
94
+ %a{:href=>"https://en.wikipedia.org/wiki/Prediction_interval", :rel=>"external"} 95% Prediction interval:
95
+ - interval = @prediction[:prediction_interval].nil? ? " - - " : @prediction[:prediction_interval].collect{|i| i.round(2)}
96
+ = "#{interval[0]} - #{interval[1]}"
97
+ - if @prediction[:measurements]
98
+ %br
99
+ %h5.th5 Measurement:
100
+ - @prediction[:measurements].each do |m|
101
+ = m
102
+ - if !@prediction[:value] && !@prediction[:measurements]
103
+ %h5.th5 not available
104
+ / physchem
105
+ - if @type =~ /physchem|proteomics/
106
+ - @input.each do |v|
107
+ %td.physchem
108
+ %div{:style=>"display:inline-block;padding-right:20px;"}
109
+ - if v[1].nil?
110
+ %p x
111
+ - else
112
+ %p= v[1][0].round(3)
113
+
114
+ / neighbors
115
+ - if @prediction[:neighbors]
116
+ - @prediction[:neighbors].each_with_index do |neighbor,idx|
117
+ - nano = Nanoparticle.find(neighbor[:id])
118
+ - core = Substance.find nano.core_id
119
+ - coating = []
120
+ - nano.coating_ids.each{|id| coating << Substance.find(id)}
121
+ %tr
122
+ / ID
123
+ %td
124
+ %a{:href=> $ambit_search+nano.name, :rel=>"external"}
125
+ %h5.th5= nano.name
126
+ / Similarity
127
+ %td
128
+ %h5.th5= neighbor[:similarity].round(3)
129
+ / Composition
130
+ %td
131
+ %h5.th5 Core:
132
+ %a{:href=>core.source, :rel=> "external"}= "["+core.name+"]"
133
+ %br
134
+ %h5.th5 Coating:
135
+ - coating.each do |co|
136
+ %a{:href=>co.source, :rel=>"external"}= co.name
137
+ %br
138
+ / Tox
139
+ %td.tox
140
+ %h5.th5 Measurement:
141
+ = neighbor[:measurement]
142
+ / Physchem
143
+ - case @type
144
+ - when "physchem"
145
+ - nano.properties.delete_if{|id,v| !@physchem_relevant_features.include?(Feature.find(id))}.sort_by{|id,v| @physchem_relevant_features.index Feature.find(id)}.each do |k,v|
146
+ %td.physchem
147
+ = v[0].round(3) unless v.nil?
148
+ - when "proteomics"
149
+ - nano.properties.delete_if{|id,v| !@proteomics_relevant_features.include?(Feature.find(id))}.sort_by{|id,v| @proteomics_relevant_features.index Feature.find(id)}.each do |k,v|
150
+ %td.physchem
151
+ = v[0].round(3) unless v.nil?
152
+
metadata ADDED
@@ -0,0 +1,235 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nano-lazar
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Christoph Helma
8
+ - Micha Rautenberg
9
+ - Denis Gebele
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2017-01-18 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: lazar
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: sinatra
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rdiscount
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: haml
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: unicorn
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: gem-path
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ description: Graphical user interface for nano-lazar toxicology predictions
100
+ email:
101
+ - helma@in-silico.ch
102
+ - rautenberg@in-silico.ch
103
+ - gebele@in-silico.ch
104
+ executables:
105
+ - nano-lazar-start
106
+ - nano-lazar-stop
107
+ extensions: []
108
+ extra_rdoc_files: []
109
+ files:
110
+ - ".gitignore"
111
+ - Gemfile
112
+ - LICENSE.md
113
+ - README.md
114
+ - VERSION
115
+ - application.rb
116
+ - bin/nano-lazar-start
117
+ - bin/nano-lazar-start.sh
118
+ - bin/nano-lazar-stop
119
+ - bin/nano-lazar-stop.sh
120
+ - config.ru
121
+ - feature-filter.rb
122
+ - helper.rb
123
+ - nano-lazar.gemspec
124
+ - npo.rb
125
+ - public/css/bootstrap.min.css
126
+ - public/css/images/black-asc.gif
127
+ - public/css/images/black-desc.gif
128
+ - public/css/images/black-unsorted.gif
129
+ - public/css/images/bootstrap-black-unsorted.png
130
+ - public/css/images/bootstrap-white-unsorted.png
131
+ - public/css/images/dragtable-handle.png
132
+ - public/css/images/dragtable-handle.svg
133
+ - public/css/images/dropbox-asc-hovered.png
134
+ - public/css/images/dropbox-asc.png
135
+ - public/css/images/dropbox-desc-hovered.png
136
+ - public/css/images/dropbox-desc.png
137
+ - public/css/images/first.png
138
+ - public/css/images/green-asc.gif
139
+ - public/css/images/green-desc.gif
140
+ - public/css/images/green-header.gif
141
+ - public/css/images/green-unsorted.gif
142
+ - public/css/images/ice-asc.gif
143
+ - public/css/images/ice-desc.gif
144
+ - public/css/images/ice-unsorted.gif
145
+ - public/css/images/last.png
146
+ - public/css/images/loading.gif
147
+ - public/css/images/metro-black-asc.png
148
+ - public/css/images/metro-black-desc.png
149
+ - public/css/images/metro-loading.gif
150
+ - public/css/images/metro-unsorted.png
151
+ - public/css/images/metro-white-asc.png
152
+ - public/css/images/metro-white-desc.png
153
+ - public/css/images/next.png
154
+ - public/css/images/prev.png
155
+ - public/css/images/white-asc.gif
156
+ - public/css/images/white-desc.gif
157
+ - public/css/images/white-unsorted.gif
158
+ - public/css/jquery-ui.css
159
+ - public/css/jquery-ui.theme.min.css
160
+ - public/css/style.css
161
+ - public/css/theme.bootstrap.min.css
162
+ - public/css/theme.default.min.css
163
+ - public/enm-workshop.html
164
+ - public/enm-workshop.rst
165
+ - public/fonts/glyphicons-halflings-regular.eot
166
+ - public/fonts/glyphicons-halflings-regular.svg
167
+ - public/fonts/glyphicons-halflings-regular.ttf
168
+ - public/fonts/glyphicons-halflings-regular.woff
169
+ - public/fonts/glyphicons-halflings-regular.woff2
170
+ - public/images/Email.png
171
+ - public/images/Facebook.png
172
+ - public/images/Google+.png
173
+ - public/images/IST_logo_s.png
174
+ - public/images/LinkedIn.png
175
+ - public/images/Twitter.png
176
+ - public/images/enm-sm.jpg
177
+ - public/images/enm_logo.png
178
+ - public/images/favicon.ico
179
+ - public/images/ist_logo.png
180
+ - public/images/wait30trans.gif
181
+ - public/javascripts/bootstrap.min.js
182
+ - public/javascripts/google_analytics.js
183
+ - public/javascripts/jquery-1.11.2.min.js
184
+ - public/javascripts/jquery-ui-1.10.3.custom.min.js
185
+ - public/javascripts/jquery.bpopup.min.js
186
+ - public/javascripts/jquery.doubleScroll.js
187
+ - public/javascripts/jquery.tablesorter.min.js
188
+ - public/javascripts/jquery.tablesorter.staticrow.min.js
189
+ - public/javascripts/jquery.tablesorter.widgets.js
190
+ - public/javascripts/jquery.tools.min.js
191
+ - public/javascripts/lazar-gui.js
192
+ - public/javascripts/nanolazar.js
193
+ - public/javascripts/widget-scroller.js
194
+ - public/ui/small-white/blank.gif
195
+ - public/ui/small-white/framing.css
196
+ - public/ui/small-white/iepngfix.htc
197
+ - public/ui/small-white/opera.css
198
+ - public/ui/small-white/outline.css
199
+ - public/ui/small-white/pretty.css
200
+ - public/ui/small-white/print.css
201
+ - public/ui/small-white/s5-core.css
202
+ - public/ui/small-white/slides.css
203
+ - public/ui/small-white/slides.js
204
+ - unicorn.rb
205
+ - views/layout.haml
206
+ - views/license.haml
207
+ - views/predict.haml
208
+ - views/prediction.haml
209
+ homepage: http://github.com/enanomapper/nano-lazar
210
+ licenses:
211
+ - GPL-3.0
212
+ metadata: {}
213
+ post_install_message: "\n How to build nano-lazar prediction models described over
214
+ here: https://github.com/opentox/lazar-public-data . \n Service commands:\n
215
+ \ nano-lazar-start\n nano-lazar-stop\n "
216
+ rdoc_options: []
217
+ require_paths:
218
+ - lib
219
+ required_ruby_version: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: 2.0.0
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ requirements: []
230
+ rubyforge_project: nano-lazar
231
+ rubygems_version: 2.5.2
232
+ signing_key:
233
+ specification_version: 4
234
+ summary: nano-lazar
235
+ test_files: []