From 304c4c484a062077bad08ca9fe3ed44d138c9416 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 4 Aug 2011 13:55:58 +0000 Subject: feature highlighting and significant features fixed for generic classes and regression --- views/feature_table.haml | 12 ++++++++++-- views/lazar.haml | 2 +- views/lazar_algorithm.haml | 20 ++++++++++++++------ views/neighbors.haml | 2 +- views/prediction.haml | 4 ++-- views/significant_fragments.haml | 2 +- 6 files changed, 29 insertions(+), 13 deletions(-) (limited to 'views') diff --git a/views/feature_table.haml b/views/feature_table.haml index a8a153f..e75c818 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[2]}\"" ( %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[1]}\"" ( %a{:href => "http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html", :rel => "external"} SMARTS ) diff --git a/views/lazar.haml b/views/lazar.haml index 2912567..870fcab 100644 --- a/views/lazar.haml +++ b/views/lazar.haml @@ -19,7 +19,7 @@ %tr %td.image= compound_image(@compound,@prediction.descriptors(@compound),@value_map) - %td= activity_markup(@prediction.value(@compound)) + %td= activity_markup(@prediction.value(@compound), @value_map) %td= sprintf('%.03g', @prediction.confidence(@compound)) %td %ul diff --git a/views/lazar_algorithm.haml b/views/lazar_algorithm.haml index 85823b5..e5b70f6 100644 --- a/views/lazar_algorithm.haml +++ b/views/lazar_algorithm.haml @@ -33,12 +33,20 @@ = 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 + - if @value_map.empty? + %li + .active activating fragments + %li + .inactive deactivating fragments + %li + .inconclusive regions, where activating and deactivating fragments overlap + - else + %li + .active= "features that occur predominately in compounds with activity: \"#{@value_map[2]}\"" + %li + .inactive= "features that occur predominately in compounds with activity: \"#{@value_map[1]}\"" + %li + .inconclusive regions, where fragments from different classes overlap %li .other inert parts diff --git a/views/neighbors.haml b/views/neighbors.haml index 3f1dccd..e2d65fa 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -14,7 +14,7 @@ - compound = OpenTox::Compound.new(neighbor[OT.compound]) %tr %td.image= compound_image(compound,@prediction.descriptors(compound),@value_map) - %td= activity_markup(@value_map[neighbor[OT.measuredActivity].to_i]) + %td= activity_markup(neighbor[OT.measuredActivity], @value_map) %td= sprintf('%.03g', neighbor[OT.similarity]) %td %ul 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. -- cgit v1.2.3