lazar-rest 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ worker_processes 4
2
+ timeout 6000
@@ -0,0 +1,121 @@
1
+ %html
2
+ %head
3
+ %body
4
+ %b Model:
5
+ %br
6
+ Source:
7
+ %a{:href => model.source}
8
+ = model.source
9
+ %br
10
+ - model.classification? ? type = "Classification" : type = "Regression"
11
+ = "Type:\t"
12
+ = type
13
+ %br
14
+ - training_dataset = OpenTox::Dataset.find model.training_dataset.id
15
+ = "Training compounds:\t"
16
+ = training_dataset.compounds.size
17
+ %br
18
+ %p
19
+ - if type == "Classification"
20
+ %b Independent crossvalidations:
21
+ - else
22
+ %b Independent crossvalidations (-log10 transformed):
23
+ - model.crossvalidations.each do |crossvalidation|
24
+ %br
25
+ = "Num folds:\t"
26
+ = crossvalidation.folds
27
+ %br
28
+ = "Num instances:\t"
29
+ = crossvalidation.nr_instances
30
+ %br
31
+ = "Num unpredicted"
32
+ = crossvalidation.nr_unpredicted
33
+ - if model.classification?
34
+ %br
35
+ = "Accuracy:\t"
36
+ = crossvalidation.accuracy.round(3) if crossvalidation.accuracy
37
+ %br
38
+ - if crossvalidation.true_rate
39
+ = "True positive rate:\t"
40
+ = crossvalidation.true_rate["active"].round(3) if crossvalidation.true_rate["active"]
41
+ %br
42
+ = "True negative rate:\t"
43
+ = crossvalidation.true_rate["inactive"].round(3) if crossvalidation.true_rate["inactive"]
44
+ %br
45
+ - if crossvalidation.predictivity
46
+ = "Positive predictive value:\t"
47
+ = crossvalidation.predictivity["active"].round(3) if crossvalidation.predictivity["active"]
48
+ %br
49
+ = "Negative predictive value:\t"
50
+ = crossvalidation.predictivity["inactive"].round(3) if crossvalidation.predictivity["inactive"]
51
+ %br
52
+
53
+ %br
54
+ %b Confusion Matrix:
55
+ %table{:class => "table table-condensed table-borderless", :style=>"width:20%;"}
56
+ %tbody
57
+ %tr
58
+ %td
59
+ %td
60
+ %td
61
+ %b actual
62
+ %td
63
+ %td
64
+ %tr
65
+ %td
66
+ %td
67
+ %td active
68
+ %td inactive
69
+ -#%td total
70
+ %tr
71
+ %td
72
+ %b predicted
73
+ %td active
74
+ %td
75
+ =crossvalidation.confusion_matrix[0][0]
76
+ %td
77
+ =crossvalidation.confusion_matrix[0][1]
78
+ -#%td
79
+ =crossvalidation.confusion_matrix[0][0]+crossvalidation.confusion_matrix[0][1]
80
+ %tr
81
+ %td
82
+ %td inactive
83
+ %td
84
+ =crossvalidation.confusion_matrix[1][0]
85
+ %td
86
+ =crossvalidation.confusion_matrix[1][1]
87
+ -#%td
88
+ =crossvalidation.confusion_matrix[1][0]+crossvalidation.confusion_matrix[1][1]
89
+ -#%tr
90
+ %td
91
+ %td total
92
+ %td
93
+ =crossvalidation.confusion_matrix[0][0]+crossvalidation.confusion_matrix[1][0]
94
+ %td
95
+ =crossvalidation.confusion_matrix[0][1]+crossvalidation.confusion_matrix[1][1]
96
+ %td
97
+ -#= "Confusion Matrix:\t"
98
+ -#= crossvalidation.confusion_matrix
99
+
100
+ /= "Confidence plot:"
101
+ /%p.plot
102
+ / %img{:src=>"confp#{crossvalidation.id}.svg"}
103
+ - if model.regression?
104
+ %br
105
+ = "Root mean squared error:\t"
106
+ = crossvalidation.rmse.round(3) if crossvalidation.rmse
107
+ %br
108
+ = "Mean absolute error:\t"
109
+ = crossvalidation.mae.round(3) if crossvalidation.mae
110
+ %br
111
+ = "R square:\t"
112
+ = crossvalidation.r_squared.round(3) if crossvalidation.r_squared
113
+ %br
114
+ /= "Confidence plot:"
115
+ /%p.plot
116
+ / %img{:src=>"/confp#{crossvalidation.id}.svg"}
117
+ /%br
118
+ /= "Correlation plot"
119
+ /%p.plot
120
+ / %img{:src=>"/corrp#{crossvalidation.id}.svg"}
121
+
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lazar-rest
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.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: 2016-11-03 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: qsar-report
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: sinatra
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: sass
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: unicorn
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
+ - !ruby/object:Gem::Dependency
100
+ name: rack-cors
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ description: REST Interface for Lazar Toxicology Predictions
114
+ email:
115
+ - supprot@in-silico.ch
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - ".gitignore"
121
+ - ".yardopts"
122
+ - ChangeLog
123
+ - Gemfile
124
+ - LICENSE
125
+ - README.md
126
+ - VERSION
127
+ - api/api.json
128
+ - config.ru
129
+ - lazar-rest.gemspec
130
+ - lib/aa.rb
131
+ - lib/api.rb
132
+ - lib/compound.rb
133
+ - lib/dataset.rb
134
+ - lib/feature.rb
135
+ - lib/lazar-rest.rb
136
+ - lib/model.rb
137
+ - lib/nanoparticle.rb
138
+ - lib/report.rb
139
+ - lib/substance.rb
140
+ - lib/validation.rb
141
+ - test/aa.rb
142
+ - test/all.rb
143
+ - test/api.rb
144
+ - test/compound.rb
145
+ - test/data/test_03_post_descriptor_file.result
146
+ - test/descriptor.rb
147
+ - test/model.rb
148
+ - test/setup.rb
149
+ - test/validation.rb
150
+ - unicorn.rb
151
+ - views/model_details.haml
152
+ homepage: http://github.com/opentox/lazar-rest
153
+ licenses:
154
+ - GPL-3
155
+ metadata: {}
156
+ post_install_message:
157
+ rdoc_options: []
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: 2.0.0
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements: []
171
+ rubyforge_project: lazar-rest
172
+ rubygems_version: 2.5.1
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: lazar-rest
176
+ test_files: []