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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
:javascript
function showcircle() {
$("img.circle").show();
};
%div.well
%h3.help-block
Select an endpoint:
#tabs
%ul.nav.nav-tabs{:id=>"modelTab", :role=>"tablist"}
- @prediction_models.each_with_index do |m, idx|
%li{:class => ("active" if idx == 0)}
%a{:href => "#model_#{idx}", :id => "linkTab#{idx}", data: {toggle:"tab"}}
= "#{idx+1}. #{m.model.feature_selection_algorithm_parameters[:category].nil? ? "Physchem & Proteomics" : "Physchem" }"
%div.tab-content
- @prediction_models.each_with_index do |m, idx|
- m[:pc_model] ? (example = @example_pc; type = "pc") : (example = @example_pcp; type = "pcp")
#model.tab-pane{:id=>"#{idx}", :class => ("active" if idx == 0)}
%b Model:
%br
Name:
= m.model.name
%br
Type: regression
%br
Source:
%a{:href=>"#{m.source}", :alt=>"source", :rel=>"external"}
= m.source
%br
Species:
= m.species
%br
Training nanoparticles:
= m.model.training_dataset.nanoparticles.size
%br
Endpoint:
= m.endpoint
%br
Unit:
= m.unit
%p
- cv = OpenTox::CrossValidation.find(m.repeated_crossvalidation_id)
%b Independent crossvalidations (log2 transformed):
- crossvalidations =[]
- m.repeated_crossvalidation.crossvalidation_ids.each{|cv| c = OpenTox::Validation::CrossValidation.find(cv); crossvalidations << c}
%div.row{:id=>"validations#{m.id}", :style=>"background-color:#f5f5f5;"}
- crossvalidations.each do |cv|
%span.col-xs-4.col-sm-4.col-md-4.col-lg-4
= "Num folds:\t"
= cv.folds
%br
= "Num instances:\t"
= cv.nr_instances
%br
= "Num unpredicted"
= cv.nr_unpredicted
%br
= "Root mean squared error:\t"
= cv.rmse.round(3) if cv.rmse
%br
= "Mean absolute error:\t"
= cv.mae.round(3) if cv.mae
%br
= "R square:\t"
= cv.r_squared.round(3) if cv.r_squared
%br
%b QSAR report
%br
%a{:href=>to('/qsar-report/'+m.id)} download
%hr
%form{:id=>idx, :role=>"form", :action=> to("/predict"), :method=>"post"}
%h3.help-block
Please characterise a nanoparticle:
#input
%div.form-group
// type pcp || pc
%input{:id=>"type",:type=>"hidden",:name=>"type",:value=>"#{type}"}
// example data to compare
%input{:id=>"example_core",:type=>"hidden",:name=>"example_core",:value=>"#{example.core}"}
%input{:id=>"example_coating",:type=>"hidden",:name=>"example_coating",:value=>"#{example.coating}"}
%input{:id=>"example_pc",:type=>"hidden",:name=>"example_pc",:value=>"#{example.physchem_descriptors}"}
- size = example.physchem_descriptors.size
%input{:id=>"size",:type=>"hidden",:name=>"size",:value=>size}
%input{:id=>"id",:type=>"hidden",:name=>"example_id",:value=>example.id}
// input form parameters to transfer
%h5 Core
%input.input-sm.form-control{:id=>"core",:type=>"text",:name=>"input_core",:value=>example.core["name"]}
%input{:id=>"input_core",:type=>"hidden",:name=>"in_core",:value=>"#{example.core}"}
%h5 Coating
%input.input-sm.form-control{:id=>"coating",:type=>"text",:name=>"input_coating",:value=>example.coating[0]["name"]}
%input{:id=>"input_coating",:type=>"hidden",:name=>"in_coating",:value=>example.coating}
// prediction model id
%input{:id=>"prediction_model",:type=>"hidden",:name=>"prediction_model",:value=>m.id}
- example.physchem_descriptors.each_with_index do |v,id|
- feature = OpenTox::Feature.find_by(:id => v[0])
- name = feature.name
- if feature[:conditions] && !feature[:conditions]["MEDIUM"].blank?
- name = feature.name + " / " + feature[:conditions]["MEDIUM"]
- else
- name = feature.name
- val = v[1]
- id = id + 1
%h5= name
// input physchem parameters
%input.input-sm.form-control{:id=>id,:type=>"text",:name=>"input_value_#{id}",:value=>val[0]}
%input{:id=>id,:type=>"hidden",:name=>"input_key_#{id}",:value=>v[0]}
%hr
#predict
%button.btn.btn-success{:id=>"submitbutton", :type=>"submit", :onclick=>"showcircle();"}
Find similar nano particles
%span.glyphicon.glyphicon-chevron-right{:id=>"span"}
%img{:src=>"/images/wait30trans.gif", :id=>"circle", :class=>"circle", :alt=>"wait", :style=>"display:none;"}
|