summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-08-04 18:38:58 +0200
committermr <mr@mrautenberg.de>2011-08-04 18:38:58 +0200
commit6fe3a5648ad862087421081e33d5540d71856b68 (patch)
treecc1774b33379574279fe4e12a080a26175620357 /views
parent13313d9fa8f5e4b29bbbc0ddeb0e455765b0774d (diff)
parentaa588fc87f1a892f3de903f5d60df68d4eaa6b52 (diff)
Merge branch 'release/v2.1.0'
Diffstat (limited to 'views')
-rw-r--r--views/classification_validation.haml59
-rw-r--r--views/create.haml43
-rw-r--r--views/feature_table.haml12
-rw-r--r--views/help.haml81
-rw-r--r--views/layout.haml18
-rw-r--r--views/lazar.haml6
-rw-r--r--views/lazar_algorithm.haml32
-rw-r--r--views/model.haml18
-rw-r--r--views/models.haml2
-rw-r--r--views/neighbors.haml6
-rw-r--r--views/prediction.haml4
-rw-r--r--views/significant_fragments.haml2
-rw-r--r--views/style.sass1
13 files changed, 204 insertions, 80 deletions
diff --git a/views/classification_validation.haml b/views/classification_validation.haml
index 41362ba..f25a321 100644
--- a/views/classification_validation.haml
+++ b/views/classification_validation.haml
@@ -1,33 +1,44 @@
%dt Correct predictions:
%dd
- = sprintf("%.2f", model.correct_predictions.to_f) if model.correct_predictions
- = '%'
+ = sprintf("%.2f", model.correct_predictions.to_f) if model.correct_predictions
+ = '%'
%dt
- %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :target => "_blank"} Weighted area under ROC:
+ %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Weighted area under ROC:
%dd
- = sprintf("%.3f", model.weighted_area_under_roc.to_f) if model.weighted_area_under_roc
+ = sprintf("%.3f", model.weighted_area_under_roc.to_f) if model.weighted_area_under_roc
%dt
- %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Specificity:
+ %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Specificity:
%dd= sprintf("%.3f", model.specificity.to_f) if model.specificity
%dt
- %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Sensitivity:
+ %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Sensitivity:
%dd= sprintf("%.3f", model.sensitivity.to_f) if model.sensitivity
%dt
- %a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :target => "_blank"} Confusion Matrix:
-%dd
- %table
- %tr
- %td{:colspan => 2, :rowspan => 2}
- %th{:colspan => 2} Measured
- %tr
- %th{:bgcolor => "#CCD2DC"} active
- %th{:bgcolor => "#CCD2DC"} inactive
- %tr
- %th{:rowspan => 2} Predicted
- %th{:bgcolor => "#CCD2DC"} active
- %td= model.true_positives if model.true_positives
- %td= model.false_positives if model.false_positives
- %tr
- %th{:bgcolor => "#CCD2DC"} inactive
- %td= model.false_negatives if model.false_negatives
- %td= model.true_negatives if model.true_negatives
+ %a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :rel => "external"} Confusion Matrix:
+- if model.confusion_matrix
+ - cm = YAML.load(model.confusion_matrix)
+ %dd
+ %table
+ %tr
+ %td{:colspan => 2, :rowspan => 2}
+ %th{:colspan => (cm.size - 1)} Measured
+ %tr
+ - (1..cm[0].size-1).each do |i|
+ %th{:bgcolor => "#CCD2DC"}
+ = cm[0][i]
+ %tr
+ %th{:rowspan => (cm.size - 1)} Predicted
+ - (0..cm[1].size-1).each do |i|
+ - if i == 0
+ %th{:bgcolor => "#CCD2DC"}
+ = cm[1][i]
+ - else
+ %td= cm[1][i]
+ - if cm.size > 2
+ - (2..cm.size-1).each do |i|
+ %tr
+ - (0..cm[i].size-1).each do |j|
+ - if j == 0
+ %th{:bgcolor => "#CCD2DC"}
+ = cm[i][j]
+ - else
+ %td= cm[i][j]
diff --git a/views/create.haml b/views/create.haml
index 757adc2..b706484 100644
--- a/views/create.haml
+++ b/views/create.haml
@@ -1,19 +1,13 @@
.input
- This service creates
- %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)
- from your uploaded datasets. Further modelling algorithms will be added in future versions.
-
%p
- Please read the
+ You will need to upload training data that includes chemical structures and their measured toxicity values, in
+ = link_to "Excel", '/help'
+ ,
+ = link_to "CSV", '/help'
+ or
+ = link_to "SDF", '/help'
+ file formats to create a prediction model. Please read the
= link_to "instructions for creating training datasets", '/help'
before submitting.
@@ -24,8 +18,10 @@
%label{:for => 'file'}
Upload training data in
= link_to "Excel", '/help'
- or
+ ,
= link_to "CSV", '/help'
+ or
+ = link_to "SDF", '/help'
format:
%input{:type => 'file', :name => 'file', :id => 'file', :size => '41'}
%input{ :type => "submit", :value => "Create model"}
@@ -43,6 +39,25 @@
= haml :endpoint, :layout => false
= haml :unit, :layout => false
+ %p
+ This service creates and validates new
+ %em= toggle_link("#classification","classification")
+ and
+ %em= toggle_link("#regression","regression")
+ 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)
+ Further modelling algorithms may be added in future versions.
+
.login_notice
- if session[:username] == "guest"
diff --git a/views/feature_table.haml b/views/feature_table.haml
index a8a153f..7c57331 100644
--- a/views/feature_table.haml
+++ b/views/feature_table.haml
@@ -2,7 +2,11 @@
- unless features[:activating].empty?
%tr
%th
- activating
+ - if @value_map.empty?
+ activating
+ - else
+ predominatly in compounds with activity
+ = "\"#{@value_map[@value_map.keys.sort.last]}\""
(
%a{:href => "http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html", :rel => "external"} SMARTS
)
@@ -15,7 +19,11 @@
- unless features[:deactivating].empty?
%tr
%th
- deactivating
+ - if @value_map.empty?
+ deactivating
+ - else
+ predominatly in compounds with activity
+ = "\"#{@value_map[@value_map.keys.sort.first]}\""
(
%a{:href => "http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html", :rel => "external"} SMARTS
)
diff --git a/views/help.haml b/views/help.haml
index 3d39641..f602dff 100644
--- a/views/help.haml
+++ b/views/help.haml
@@ -1,4 +1,5 @@
= link_to "Back to model creation", '/create'
+%h2 Spreadsheets (Excel, CSV)
%p
Input files have two columns. Enter in the first column the chemical structure in
%a{:href => "http://en.wikipedia.org/wiki/Simplified_molecular_input_line_entry_specification", :rel => "external"} SMILES
@@ -85,26 +86,76 @@
%td 0
%p
- Excel example file for download:
- = link_to "hamster_carcinogenicity.xls", "/hamster_carcinogenicity.xls"
+ Excel examples for download:
+%ul
+ %li
+ = link_to "hamster_carcinogenicity.xls", "/hamster_carcinogenicity.xls"
+ (classification)
+ %li
+ = link_to "EPAFHM.xls", "/EPAFHM.xls"
+ (regression)
%h3 CSV example
.code
- %code
- %br SMILES, Hamster Carcinogenicity
- %br CC(=O)Nc1ccc(O)cc1, 1
- %br O=c1[nH]cnc2[nH]ncc12, 1
- %br CCCCNc1cc(cc(c1Oc2ccccc2)S(=O)(=O)N)C(=O)O, 1
- %br CC(C)(C)NCC(O)COc1cccc2NC(=O)CCc12, 1
- %br CN(C)CCCC1(OCc2cc(C#N)ccc21)c3ccc(F)cc3, 1
- %br CCC(CC)CCN1C(=O)CN=C(C2CCCCC2F)c3cc(Cl)ccc13, 0
- %br CCN(CC)CC(=O)Nc1c(C)cccc1C, 0
- %br CC(C)(C)NCC(O)COc1cccc2CC(O)C(O)Cc12, 0
- %br CN1CCCC1c2cccnc2, 0
+ %pre
+ :preserve
+ SMILES, Hamster Carcinogenicity
+ CC(=O)Nc1ccc(O)cc1, 1
+ O=c1[nH]cnc2[nH]ncc12, 1
+ CCCCNc1cc(cc(c1Oc2ccccc2)S(=O)(=O)N)C(=O)O, 1
+ CC(C)(C)NCC(O)COc1cccc2NC(=O)CCc12, 1
+ CN(C)CCCC1(OCc2cc(C#N)ccc21)c3ccc(F)cc3, 1
+ CCC(CC)CCN1C(=O)CN=C(C2CCCCC2F)c3cc(Cl)ccc13, 0
+ CCN(CC)CC(=O)Nc1c(C)cccc1C, 0
+ CC(C)(C)NCC(O)COc1cccc2CC(O)C(O)Cc12, 0
+ CN1CCCC1c2cccnc2, 0
%p
- CSV example for download:
- = link_to "hamster_carcinogenicity.csv", "/hamster_carcinogenicity.csv"
+ CSV examples for download:
+%ul
+ %li
+ = link_to "hamster_carcinogenicity.csv", "/hamster_carcinogenicity.csv"
+ (classification)
+ %li
+ = link_to "EPAFHM.csv", "/EPAFHM.csv"
+ (regression)
%p You can create CSV files in Excel: Create a sheet with two columns and export them as CSV file with the "Save As" option from the menu, selecting the CSV (comma delimited) format.
+
+%h2 SDF
+
+%p
+ Currently ToxCreate supports
+ %a{:href => "http://en.wikipedia.org/wiki/Chemical_table_file#SDF", :rel => "external"} SDF
+ files with a single data item as shown below (multiple data items will raise an error). You can also download an example SDF file:
+ = link_to "hamster_carcinogenicity.sdf", "/hamster_carcinogenicity.sdf"
+
+.code
+ %pre
+ -# keep empty lines -they are required by SDF
+ :preserve
+
+
+
+
+ 6 6 0 0 0 0 0 0 0 0 1 V2000
+ 1.3304 -1.0738 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.1104 0.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.3767 -0.4086 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.3767 -1.7390 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.1104 -2.1509 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.0000 -1.0738 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 1 5 2 0 0 0 0
+ 1 6 1 0 0 0 0
+ 2 3 2 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 1 0 0 0 0
+ M END
+ &gt; &lt;ActivityOutcome_CPDBAS_Hamster&gt;
+ inactive
+
+ $$$$
+
+
diff --git a/views/layout.haml b/views/layout.haml
index 174db9f..c76396d 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -14,7 +14,7 @@
.logo
%img{:src => "ToxCreate_rgb_72.png", :alt => 'ToxCreate', :align => 'right'}/
%br
- Create and evaluate models to predict toxicity
+ Creates computational models to predict toxicity
.index
%ul
%li{:class => ("selected" if /\/create|echa|ambit|feature/ =~ request.path )}
@@ -31,8 +31,9 @@
.content
.login_info
- User:
- %b= session[:username]
+ - if session[:username].size > 0
+ User:
+ %b= session[:username]
- if `hostname`.match(/ot-test/)
.notice
@@ -47,7 +48,18 @@
= yield
.footer
+ Disclaimer: ToxCreate uses state-of-the-art published and tested algorithms and methodologies with full validation information. However, just as with experimental measurements, computational predictions are subject to varying degrees of accuracy and uncertainty, so please read the full report carefully, particularly the validation information. No liability is accepted for any inaccuracy in predictions.
+ %p
+ - tag = `git tag`.split("\n").last
+ - tagdate = `git show #{tag}|grep Date`.chomp
+ Version:
+ = tag
+ ,
+ = tagdate
&copy;
%a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology
2009-2011, powered by
%a{:href => 'http://www.opentox.org', :rel => "external"} <span style="color:#5D308A;font-family:arial,sans-serif,helvetica;letter-spacing:-1px;">Open</span><span style="color:#000;font-family:arial,sans-serif,helvetica;font-weight:bold;letter-spacing:-1px;">Tox</span>
+ (a project funded by the
+ %a{:href => "http://cordis.europa.eu/fp7/", :rel => "external"} 7th Framework Programme
+ of the European Commission)
diff --git a/views/lazar.haml b/views/lazar.haml
index 3f1d030..870fcab 100644
--- a/views/lazar.haml
+++ b/views/lazar.haml
@@ -18,8 +18,8 @@
%th Supporting information
%tr
- %td.image= compound_image(@compound,@prediction.descriptors(@compound))
- %td= activity_markup(@prediction.value(@compound))
+ %td.image= compound_image(@compound,@prediction.descriptors(@compound),@value_map)
+ %td= activity_markup(@prediction.value(@compound), @value_map)
%td= sprintf('%.03g', @prediction.confidence(@compound))
%td
%ul
@@ -40,7 +40,7 @@
%tr#fragments{ :style => "display: none;" }
%td{:colspan => '4'}
= hide_link('#fragments')
- = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound))}, :layout => false
+ = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound),@value_map)}, :layout => false
%tbody#neighbors
= haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page}, :layout => false
diff --git a/views/lazar_algorithm.haml b/views/lazar_algorithm.haml
index 85823b5..76a993b 100644
--- a/views/lazar_algorithm.haml
+++ b/views/lazar_algorithm.haml
@@ -32,15 +32,29 @@
%p
= toggle_link "#significant_fragments", "Significant fragments"
are highlighted in the structure display as follows:
- %ul
- %li
- .active activating fragments
- %li
- .inactive deactivating fragments
- %li
- .inconclusive regions, where activating and deactivating fragments overlap
- %li
- .other inert parts
+ - if @value_map.empty?
+ %ul
+ %li
+ .active activating fragments
+ %li
+ .inactive deactivating fragments
+ %li
+ .inconclusive regions, where activating and deactivating fragments overlap
+ %li
+ .other inert parts
+ - else
+ %ul
+ %li
+ .active= "features that occur predominately in compounds with activity: \"#{@value_map[@value_map.keys.sort.last]}\""
+ %li
+ .inactive= "features that occur predominately in compounds with activity: \"#{@value_map[@value_map.keys.sort.first]}\""
+ %li
+ .inconclusive regions, where fragments from different classes overlap
+ %li
+ .other inert parts
+ - if @value_map.size > 2
+ .notice Incomplete implementation of feature highlighting and display of significant fragments. Only features for 2 classes are shown!
+
%p
Please keep in mind that predictions are based on the measured activities of neighbors.
diff --git a/views/model.haml b/views/model.haml
index b4b3c59..e688ae9 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -24,7 +24,7 @@
#{js}
});
- %div{:id => "model_#{model.id}_progress", :class => "model_progress", :title => "#{percentage_completed}%", :alt => "#{percentage_completed}%"}
+ %div{:id => "model_#{model.id}_progress", :class => "model_progress", :title => "#{percentage_completed}%"}
//= haml :model_progress, :locals=>{:percentage_completed=>percentage_completed}, :layout => false
- if is_authorized(model.web_uri, "DELETE")
%a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'}
@@ -36,17 +36,23 @@
%br
%dt Started:
- %dd= Time.parse(model.created_at.to_s).strftime("%m/%d/%Y - %I:%M:%S%p") if model.created_at
+ %dd= Time.parse(model.created_at.to_s).strftime("%m/%d/%Y - %I:%M:%S%p %Z") if model.created_at
- if model.nr_compounds
%dt Training compounds:
%dd= model.nr_compounds
- if model.error_messages
%dt Errors:
%dd= model.error_messages
+ - if CONFIG[:logger]=="debug"
+ %dt Task:
+ %dd
+ %a{:href => "#{model.task_uri}", :id => "model_#{model.id}_task_link", :rel => "external"}
+ = model.task_uri
- if model.warnings
%dt Warnings:
- %a{:href => "#", :id => "show_model_#{model.id}_warnings"} show
- %dd{:id => "model_#{model.id}_warnings", :style => "display: none;"}= model.warnings
+ %dd
+ %a{:href => "#", :id => "show_model_#{model.id}_warnings"} show
+ %div{:id => "model_#{model.id}_warnings", :style => "display: none;"}= model.warnings
%dt Algorithm:
%dd= toggle_link("#lazar_description","lazar")
- if model.type
@@ -65,6 +71,8 @@
,
-#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
-#%em (experts) ,
+ %a{:href => "#{model.training_dataset}.sdf#{subjectstring}" } SDF
+ ,
%a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
%em (experts)
- if model.feature_dataset
@@ -74,6 +82,8 @@
-#,
%a{:href => "#{model.feature_dataset}.xls#{subjectstring}"} Excel sheet
,
+ %a{:href => "#{model.feature_dataset}.sdf#{subjectstring}"} SDF
+ ,
%a{:href => "#{model.feature_dataset}.yaml#{subjectstring}"} YAML
%em (experts)
- if model.uri
diff --git a/views/models.haml b/views/models.haml
index 6724807..9ab2858 100644
--- a/views/models.haml
+++ b/views/models.haml
@@ -21,3 +21,5 @@
- if @models
- @models.each do |model|
= haml :model, :locals=>{:model=>model,:subjectstring=>subjectstring}, :layout => false
+-if @models.size == 0
+ .notice There are currently no models. You have to create a model first.
diff --git a/views/neighbors.haml b/views/neighbors.haml
index 2df9230..e2d65fa 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -13,8 +13,8 @@
- neighbor_id += 1
- compound = OpenTox::Compound.new(neighbor[OT.compound])
%tr
- %td.image= compound_image(compound,@prediction.descriptors(compound))
- %td= activity_markup(neighbor[OT.measuredActivity])
+ %td.image= compound_image(compound,@prediction.descriptors(compound),@value_map)
+ %td= activity_markup(neighbor[OT.measuredActivity], @value_map)
%td= sprintf('%.03g', neighbor[OT.similarity])
%td
%ul
@@ -39,5 +39,5 @@
%tr{:id => "fragments#{neighbor_id}", :style => "display: none;" }
%td{:colspan => '4'}
= hide_link("#fragments#{neighbor_id}")
- = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(compound))}, :layout => false
+ = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(compound),@value_map)}, :layout => false
diff --git a/views/prediction.haml b/views/prediction.haml
index 9bb3f76..682b979 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -16,7 +16,7 @@
- if p[:measured_activities]
%br
- p[:measured_activities].each do |a|
- = activity_markup(a)
+ = activity_markup(a, @value_map)
%br
(
%a{:href => "#", :id => "linkTrainingData#{p.object_id}"} Measured activity
@@ -29,7 +29,7 @@
- elsif p[:error]
%br= p[:error]
- else
- = activity_markup(p[:prediction])
+ = activity_markup(p[:prediction], @value_map)
- if p[:confidence]
%br
(
diff --git a/views/significant_fragments.haml b/views/significant_fragments.haml
index bd39826..8cddf43 100644
--- a/views/significant_fragments.haml
+++ b/views/significant_fragments.haml
@@ -5,6 +5,6 @@
= hide_link "#significant_fragments"
)
%dd
- Substructures that occur (statistically significant) more frequently in active or inactive compounds. Substuctures can take any shape (without cycles) and are determined with the
+ Substructures that occur (statistically significant) more frequently in one of the toxicity classes or correlate with quantitative toxicity values. Substuctures can take any shape (without cycles) and are determined with the
%a{:href => "http://www.maunz.de/libfminer2-bbrc-doc/", :rel => "external"} fminer
algorithm.
diff --git a/views/style.sass b/views/style.sass
index ffae6a5..15ae256 100644
--- a/views/style.sass
+++ b/views/style.sass
@@ -220,6 +220,7 @@ body
.footer
margin: 0.5em
padding: 0.5em
+ font-size: small
.active
color: red