summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-09-26 20:07:32 +0200
committergebele <gebele@in-silico.ch>2013-09-26 20:07:32 +0200
commit1ab8ed01b72ba501f175b0b1ef87ed62bbec8844 (patch)
tree0704aa45cbca8bd139e6360150626e5faac5c6d1 /views
parent13ffab048630cc30a4af9e9113c1843ae5af0a09 (diff)
small edits for new model names
Diffstat (limited to 'views')
-rw-r--r--views/details.haml2
-rw-r--r--views/neighbors.haml6
-rw-r--r--views/predict.haml65
-rw-r--r--views/prediction.haml21
-rw-r--r--views/significant_fragments.haml12
5 files changed, 67 insertions, 39 deletions
diff --git a/views/details.haml b/views/details.haml
index 5663c1f..b69f1af 100644
--- a/views/details.haml
+++ b/views/details.haml
@@ -17,7 +17,7 @@
%br
%b="Names:"
%p{:style=>"padding-left:0.5em;"}
- = @names
+ = @names.join("; ")
%p{:style=>"padding-left:0.5em;"}
/ pubchem link
%a{:href=>"http://aop.in-silico.ch/", :title=>"link opens in new tab", :alt=>"pubchem link", :target=>"_blank"} PubChem read across
diff --git a/views/neighbors.haml b/views/neighbors.haml
index 39f6272..df03b85 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -12,7 +12,7 @@
/ each endpoint becomes a tab head ;
- @prediction_models.each do |m|
- count_m += 1
- - m_title = m.title.split(" ").first
+ - m_title = m.title.split("_").last(2)[0]
%li
%a{:href => "#results_#{count_m}", :id => "link#{m_title}"}
= m_title
@@ -90,9 +90,9 @@
/ prevent conversion of nil
- c = p.data_entries[count][2] != nil ? p.data_entries[count][2] : ''
- case c
- - when /(0|false)/
+ - when /(0|false|inactive)/
- c = "non-carcinogen"
- - when /(1|true)/
+ - when /(1|true|active)/
- c = "carcinogen"
- else
- c = Array.new
diff --git a/views/predict.haml b/views/predict.haml
index 5641f6a..6340def 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -68,26 +68,28 @@
});
#models
+ - @detail_count = 0
// TODO order models by echa endpoint
#endpoint
- %b Acute toxicity to fish (lethality):
+ %b Acute toxicity to fish (lethality):
- @models.each do |model|
- - model_title = model.title.split(" ").first
- - if model_title =~ /LC50/
+ - model_title = model.title.split("_").last(2)[0]
+ - if model_title =~ /LC50/i
+ - @detail_count +=1
%div{:id => model_title}
%input{:type => "checkbox", :name => "selection[#{model_title}]", :id => "selection[#{model_title}]", :value => true, :disabled => false}
%label{:for => "selection[#{model_title}]"}
- = " EPA v4b Fathead Minnow Acute Toxicity "+model_title
- %a{:href=>"#details", :id => "linkDetails#{model_title}", :title=>"#{model_title} details"}
+ = model.title
+ %a{:href=>"#details", :id => "linkDetails#{model_title}", :title=>"#{model_title} details", :style=>"font-size:small;"}
[Details]
:javascript
- $("a#linkDetails#{model_title}").click(function () {
- $("#details_#{model_title}").toggle();
+ $("a#linkDetails#{@detail_count}").click(function () {
+ $("#details_#{@detail_count}").toggle();
//document.location = document.location + "#" + "details";
});
- #details{:id => "#{model_title}", :style=> "display:none;"}
+ #details{:id => "#{@detail_count}", :style=> "display:none;"}
%h3 Model Details:
//%p= "Training Dataset:\t#{model[RDF::OT.trainingDataset]}"
%p Algorithm: Lazar
@@ -104,22 +106,23 @@
%br
%b Carcinogenicity:
- @models.each do |model|
- - model_title = model.title.split(" ").first
+ - model_title = model.title.split("_").last(2)[0]
- if model_title =~ /hamster|rodent/i
+ - @detail_count +=1
%div{:id => model_title}
%input{:type => "checkbox", :name => "selection[#{model_title}]", :id => "selection[#{model_title}]", :value => true, :disabled => false}
%label{:for => "selection[#{model_title}]"}
- = " DSSTox Carcinogenic Potency DBS "+model_title
- %a{:href=>"#details", :id => "linkDetails#{model_title}", :title=>"#{model_title} details"}
+ = model.title
+ %a{:href=>"#details", :id => "linkDetails#{@detail_count}", :title=>"#{model_title} details", :style=>"font-size:small;"}
[Details]
:javascript
- $("a#linkDetails#{model_title}").click(function () {
- $("#details_#{model_title}").toggle();
+ $("a#linkDetails#{@detail_count}").click(function () {
+ $("#details_#{@detail_count}").toggle();
//document.location = document.location + "#" + "details";
});
- #details{:id=>"#{model_title}", :style=> "display:none;"}
+ #details{:id=>"#{@detail_count}", :style=> "display:none;"}
%h3 Model Details:
//%p= "Training Dataset:\t#{model[RDF::OT.trainingDataset]}"
%p Algorithm: Lazar
@@ -134,6 +137,40 @@
%p Number of predictions: integer
%p Correct predictions: %
%br
+ %br
+ %b Mutagenicity:
+ - @models.each do |model|
+ - model_title = model.title.split("_").last(2)[0]
+ - if model_title =~ /Mutagenicity/i
+ - @detail_count +=1
+ %div{:id => model_title}
+ %input{:type => "checkbox", :name => "selection[#{model_title}]", :id => "selection[#{model_title}]", :value => true, :disabled => false}
+ %label{:for => "selection[#{model_title}]"}
+ = model.title
+ %a{:href=>"#details", :id => "linkDetails#{model_title}", :title=>"#{model_title} details", :style=>"font-size:small;"}
+ [Details]
+
+ :javascript
+ $("a#linkDetails#{@detail_count}").click(function () {
+ $("#details_#{@detail_count}").toggle();
+ //document.location = document.location + "#" + "details";
+ });
+
+ #details{:id => "#{@detail_count}", :style=> "display:none;"}
+ %h3 Model Details:
+ //%p= "Training Dataset:\t#{model[RDF::OT.trainingDataset]}"
+ %p Algorithm: Lazar
+ %p Type: classification
+ %p Training compounds: integer
+ %p Descriptors: Fminer
+ //%p= "Training Dataset:\t#{model[RDF::OT.trainingDataset]}"
+ //%p= "Feature Dataset:\t#{model[RDF::OT.featureDataset]}"
+ %h3 Validation:
+ %a{:href => "#"}
+ Detailed report link
+ %p Number of predictions: integer
+ %p Correct predictions: %
+
%br
diff --git a/views/prediction.haml b/views/prediction.haml
index 4002cbd..5de0564 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -14,7 +14,7 @@
%tbody
%tr
- %td{:id=>"compound"}
+ %td{:id=>"compound", :style=>"align:center;"}
%a{:href => to("/prediction/#{CGI.escape(@compound.uri)}/details"), :id=>"linkCompound", :target=>"details_overview"}
%img{:src=>"#{@compound.uri}/image", :alt=>"Compound image not available", :width=>"150", :height=>"150"}
%p
@@ -40,16 +40,16 @@
- database_hit = 1
- c = p.data_entries[0][0] != nil ? p.data_entries[0][0] : ''
- case c
- - when /(0|false)/
+ - when /(0|false|inactive)/
- c = "non-carcinogen"
- - when /(1|true)/
+ - when /(1|true|active)/
- c = "carcinogen"
- else
- c = Array.new
- c[0] = (p.data_entries[0][0].class == Float) ? p.data_entries[0][0].round(3) : (p.data_entries[0][0] != nil ? p.data_entries[0][0] : "no prediction")
- %td
+ %td{:style=>"valign:top;"}
%b{:class => "title"}
- = @prediction_models[count].title.split(" ").first
+ = @prediction_models[count].title.gsub("_", " ")
- @model_uri = @prediction_models[count].uri
%p
/ model type (classification|regression)
@@ -101,7 +101,7 @@
Predictions with a high confidence can be expected to be more reliable than predictions
with low confidence.
Confidence values may take any value between 0 and 1.
- For most models confidence > 0.025 is a sensible (hard) cutoff to distiguish between
+ For most models confidence > 0.025 is a sensible (hard) cutoff to distinguish between
reliable and unreliable predictions.
%p
/TODO add tooltip for significant ftagments and descriptors
@@ -150,15 +150,6 @@
%b Measured activity:
= p.data_entries[0][2]
%p
- %b Neighbors:
- %a{:href=> "#tabs", :id=>"link#{count}"}
- %img{:src=>"/images/arrow_down_float.png", :alt=>"v"}
- :javascript
- $("a#link#{count}").click(function () {
- $(".results").show();
- document.getElementById('tabs').focus();
- $("#tabs").tabs({ active: "#{count}" });
- });
- count+=1
diff --git a/views/significant_fragments.haml b/views/significant_fragments.haml
index 7d342d0..46cca5f 100644
--- a/views/significant_fragments.haml
+++ b/views/significant_fragments.haml
@@ -12,9 +12,9 @@
- if !@significant_fragments.empty?
%table{:id => "sf1"}
%tr
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
Predominantly in compounds with activity "non-carcinogen"
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
p value
- @significant_fragments.each do |fragments|
/ fragments == [1||2, smarts, pValue]
@@ -28,9 +28,9 @@
%td
%br
%tr
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
Predominantly in compounds with activity "carcinogen"
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
p value
- @significant_fragments.each do |fragments|
/ fragments == [1||2, smarts, pValue]
@@ -50,9 +50,9 @@
- if !@significant_fragments.empty?
%table{:id => "sf2"}
%tr
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
Descriptor
- %th{:style=>"border:1px solid;"}
+ %th{:style=>"border:2px solid #C0C0C0;"}
value
- @significant_fragments.each do |fragments|
%tr