summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/classification_validation.haml23
-rw-r--r--views/create.haml21
-rw-r--r--views/endpoint.haml2
-rw-r--r--views/model.haml22
-rw-r--r--views/model_echa.haml2
-rw-r--r--views/models.haml13
-rw-r--r--views/models_navigation.haml70
-rw-r--r--views/predict.haml2
-rw-r--r--views/style.sass30
-rw-r--r--views/validation.haml2
10 files changed, 153 insertions, 34 deletions
diff --git a/views/classification_validation.haml b/views/classification_validation.haml
index f25a321..e06cb65 100644
--- a/views/classification_validation.haml
+++ b/views/classification_validation.haml
@@ -3,15 +3,26 @@
= sprintf("%.2f", model.correct_predictions.to_f) if model.correct_predictions
= '%'
%dt
- %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Weighted area under ROC:
+ %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Average area under ROC:
%dd
- = sprintf("%.3f", model.weighted_area_under_roc.to_f) if model.weighted_area_under_roc
+ - if model.average_area_under_roc
+ = sprintf("%.3f", model.average_area_under_roc.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Specificity:
-%dd= sprintf("%.3f", model.specificity.to_f) if model.specificity
+%dd
+ - if model.specificity
+ = sprintf("%.3f", model.specificity.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Sensitivity:
-%dd= sprintf("%.3f", model.sensitivity.to_f) if model.sensitivity
+%dd
+ - if model.sensitivity
+ = sprintf("%.3f", model.sensitivity.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :rel => "external"} Confusion Matrix:
- if model.confusion_matrix
@@ -32,7 +43,7 @@
%th{:bgcolor => "#CCD2DC"}
= cm[1][i]
- else
- %td= cm[1][i]
+ %td= cm[1][i].to_i
- if cm.size > 2
- (2..cm.size-1).each do |i|
%tr
@@ -41,4 +52,4 @@
%th{:bgcolor => "#CCD2DC"}
= cm[i][j]
- else
- %td= cm[i][j]
+ %td= cm[i][j].to_i
diff --git a/views/create.haml b/views/create.haml
index b706484..da85382 100644
--- a/views/create.haml
+++ b/views/create.haml
@@ -24,6 +24,8 @@
= link_to "SDF", '/help'
format:
%input{:type => 'file', :name => 'file', :id => 'file', :size => '41'}
+ %br
+ -# = haml :model_echa, :layout => false
%input{ :type => "submit", :value => "Create model"}
=# link_to "Cancel", '/create'
@@ -47,15 +49,16 @@
structure-activity models from your experimental data. The models can be used to predict toxicity of new chemicals (e.g. for
%a{:href => "http://ec.europa.eu/environment/chemicals/reach/reach_intro.htm", :rel => "external"} REACH
purposes) and to reduce the need for animal testing. The following methods are currently available:
- %ul
- %li
- = toggle_link("#lazar_description","lazar")
- %em= toggle_link("#classification","classification")
- models and
- %li
- = toggle_link("#lazar_description","lazar")
- %em= toggle_link("#regression","regression")
- models (experimental)
+ %ul
+ %li
+ = toggle_link("#lazar_description","lazar")
+ %em= toggle_link("#classification","classification")
+ models and
+ %li
+ = toggle_link("#lazar_description","lazar")
+ %em= toggle_link("#regression","regression")
+ models (experimental)
+ %p
Further modelling algorithms may be added in future versions.
.login_notice
diff --git a/views/endpoint.haml b/views/endpoint.haml
index af06b80..9c250ca 100644
--- a/views/endpoint.haml
+++ b/views/endpoint.haml
@@ -9,4 +9,4 @@
%em in-vitro,
or
%em in-vivo
- expriment, clinical trial or epidemiological study
+ experiment, clinical trial or epidemiological study
diff --git a/views/model.haml b/views/model.haml
index e688ae9..356ec65 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -29,9 +29,9 @@
- if is_authorized(model.web_uri, "DELETE")
%a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'}
- if model.status =~ /Completed|Error|Cancelled/
- (delete)
+  (delete)
- else
- (stop)
+  (stop)
%span
%br
@@ -65,26 +65,26 @@
%dt Training dataset:
%dd
- if model.training_dataset.match(/ambit/i)
- %a{:href => "#{model.training_dataset}#{subjectstring}", :rel => "external"} Ambit database
+ %a{:href => "#{model.training_dataset}", :rel => "external"} Ambit database
- else
- %a{:href => "#{model.training_dataset}.xls#{subjectstring}"} Excel sheet
+ %a{:href => "#{model.training_dataset}.xls"} Excel sheet
,
-#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
-#%em (experts) ,
- %a{:href => "#{model.training_dataset}.sdf#{subjectstring}" } SDF
+ %a{:href => "#{model.training_dataset}.sdf" } SDF
,
- %a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
+ %a{:href => "#{model.training_dataset}.yaml" } YAML
%em (experts)
- if model.feature_dataset
%dt Feature dataset:
%dd
-#%a{:href => "#{model.feature_dataset}.rdf"} RDF/XML
-#,
- %a{:href => "#{model.feature_dataset}.xls#{subjectstring}"} Excel sheet
+ %a{:href => "#{model.feature_dataset}.xls"} Excel sheet
,
- %a{:href => "#{model.feature_dataset}.sdf#{subjectstring}"} SDF
+ %a{:href => "#{model.feature_dataset}.sdf"} SDF
,
- %a{:href => "#{model.feature_dataset}.yaml#{subjectstring}"} YAML
+ %a{:href => "#{model.feature_dataset}.yaml"} YAML
%em (experts)
- if model.uri
%dt Model:
@@ -94,7 +94,7 @@
-#,
- if model.validation_qmrf_uri
%a{:href => File.join(model.validation_qmrf_uri,"editor")} QMRF Editor,
- %a{:href => "#{model.uri}.yaml#{subjectstring}"} YAML
+ %a{:href => "#{model.uri}.yaml"} YAML
%em (experts, models cannot be represented in Excel)
- = haml :validation, :locals=>{:model=>model,:subjectstring => subjectstring}, :layout => false
+ = haml :validation, :locals=>{:model=>model}, :layout => false
diff --git a/views/model_echa.haml b/views/model_echa.haml
new file mode 100644
index 0000000..257a28a
--- /dev/null
+++ b/views/model_echa.haml
@@ -0,0 +1,2 @@
+Select an endpoint:
+= endpoint_option_list \ No newline at end of file
diff --git a/views/models.haml b/views/models.haml
index 9ab2858..1419e37 100644
--- a/views/models.haml
+++ b/views/models.haml
@@ -3,7 +3,7 @@
:javascript
$(function() {
if(#{stati != 0}) {
- setTimeout('checkStati("#{stati_to_check}", "#{subjectstring}")',5000);
+ setTimeout('checkStati("#{stati_to_check}", "")',5000);
}
var reload_validation = true;
});
@@ -18,8 +18,11 @@
= haml :similarity, :layout => false
= haml :significant_fragments, :layout => false
-- if @models
- - @models.each do |model|
- = haml :model, :locals=>{:model=>model,:subjectstring=>subjectstring}, :layout => false
--if @models.size == 0
+- first = 5*@page
+- last = first+4
+= models_navigation if @models.size > 1
+- if @models[first..last]
+ - @models[first..last].each do |model|
+ = haml :model, :locals=>{:model=>model}, :layout => false
+-if @models.size == 0
.notice There are currently no models. You have to create a model first.
diff --git a/views/models_navigation.haml b/views/models_navigation.haml
new file mode 100644
index 0000000..b491cb5
--- /dev/null
+++ b/views/models_navigation.haml
@@ -0,0 +1,70 @@
+.models_navigation
+
+ %form{:name => "nav", :action => url_for('/models'), :method => "get", :id => "nav"}
+ %input{:type => :hidden, :name => :sort_by, :id => "sort_by", :value => params[:sort_by]}
+ %input{:type => :hidden, :name => :order, :id => "order", :value => params[:order]}
+ %input{:type => :hidden, :name => :page, :id => "page", :value => params[:page]}
+
+ Sort by:
+ - ["created_at","name","type"].each do |s|
+ - idname = s == "created_at" ? "date" : s
+ - if params[:sort_by] == s
+ %div{:id => idname, :class => "active"}
+ %span="#{idname.capitalize}"
+ - if params[:order] == "ASC"
+ #up{:class => "link"}
+ %img{:src => "arrow_down.png", :alt => 'in ascending order', :title => 'in ascending order'}/
+ - else
+ #down{:class => "link"}
+ %img{:src => "arrow_up.png", :alt => 'in descending order', :title => 'in descending order'}/
+ - else
+ %div{:id => idname, :class => "link"}="#{idname.capitalize} "
+ - if @models.size > 5
+ |
+ Models:
+ = "#{@models.size}"
+ - unless @page.to_i == 0
+ #prev
+ %img{:src => "arrow_left.png", :alt => 'previous', :title => 'previous'}/
+ -else
+ %img{:src => "arrow_left_inactive.png", :alt => '', :title => ''}/
+
+ - if @models.size < 5*@page+5
+ - last = @models.size
+ - else
+ - last = 5*@page+5
+
+ = "(#{5*@page+1}-#{last}/#{@models.size})"
+ - unless 5*@page.to_i+5 >= @models.size
+ #next
+ %img{:src => "arrow_right.png", :alt => 'next', :title => 'next'}/
+ -else
+ %img{:src => "arrow_right_inactive.png", :alt => '', :title => ''}/
+
+ - js = ""
+ - ["id","created_at","name","type"].each do |s|
+ - idname = s == "created_at" ? "date" : s
+ - js += "$('##{idname}').click(function() \{ \n "
+ - js += " $('#sort_by').val('#{s}');\n "
+ - js += " $('#nav').submit();\n "
+ - js += "});\n "
+
+ :javascript
+ $("#prev").click(function() {
+ $("#page").val(#{@page-1});
+ $("#nav").submit();
+ });
+ $("#next").click(function() {
+ $("#page").val(#{@page+1});
+ $("#nav").submit();
+ });
+ #{js}
+ $("#down").click(function() {
+ $("#order").val("ASC");
+ $("#nav").submit();
+ });
+ $("#up").click(function() {
+ $("#order").val("DESC");
+ $("#nav").submit();
+ });
+ \ No newline at end of file
diff --git a/views/predict.haml b/views/predict.haml
index 8aae7cf..670ca44 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -20,7 +20,7 @@
%span{:style=>"font-size:75%"}
&copy;
%a{:href => 'http://www.molinspiration.com/jme/index.html', :rel => "external"} JME Editor
- courtesy of Peter Ertl, Novartis</span>
+ courtesy of Peter Ertl, Novartis
%br
-# %label{:for => 'identifier'} or enter a Name, InChI, Smiles, CAS, ...
%label{:for => 'identifier'} or enter a Smiles string
diff --git a/views/style.sass b/views/style.sass
index 15ae256..c2a74cb 100644
--- a/views/style.sass
+++ b/views/style.sass
@@ -267,3 +267,33 @@ dl
margin-left: 16px
margin-right: 16px
float: left
+
+.models_navigation
+ #prev
+ @extend a
+ display: inline
+ cursor: pointer
+ #next
+ @extend a
+ display: inline
+ cursor: pointer
+ .link
+ @extend a
+ display: inline
+ cursor: pointer
+ .active
+ display: inline
+ color: #000
+ font-weight: bold
+ .thin
+ font-weight: 100
+
+.level_1
+ padding-left: 10px
+ font-weight: bold
+.level_2
+ padding-left: 20px
+.level_3
+ padding-left: 30px
+.level_4
+ padding-left: 40px
diff --git a/views/validation.haml b/views/validation.haml
index b8a6eaa..0a094d6 100644
--- a/views/validation.haml
+++ b/views/validation.haml
@@ -7,7 +7,7 @@
- if model.validation_report_uri
%dt Detailed report:
%dd
- %a{:href => model.validation_report_uri + subjectstring, :target => "_blank"} show
+ %a{:href => model.validation_report_uri, :target => "_blank"} show
%dt Number of predictions:
%dd= model.nr_predictions.to_s
- case model.type