summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-07-26 14:48:55 +0200
committerChristoph Helma <helma@in-silico.de>2009-07-26 14:48:55 +0200
commit14516c7c3f98c0bef022a0148706ece7e5f33bb7 (patch)
treeb267aa7ad0aa9a908121e3e843cb91dcb0bae0fa
parentd2a8143b0ace1f992bb5da9ec9ea53641c56c647 (diff)
display of neighbors added
-rw-r--r--lazar.rb6
-rw-r--r--views/neighbors.haml34
-rw-r--r--views/prediction.haml16
3 files changed, 15 insertions, 41 deletions
diff --git a/lazar.rb b/lazar.rb
index 52ce380..9e9fb97 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -21,12 +21,6 @@ get '/create' do
haml :create
end
-get '/neighbors' do
- #@lazar = params[:lazar]
- #haml :neighbors
- "Sorry, display of neighbors is not (yet) implemented."
-end
-
get '/:id' do # input form for predictions
begin
xml = RestClient.get "#{LAZAR_URI}#{params[:id]}"
diff --git a/views/neighbors.haml b/views/neighbors.haml
deleted file mode 100644
index 5bf5aba..0000000
--- a/views/neighbors.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-&rarr;
-%a{ :href => "/#{params[:id]}" } Enter structure
-&rarr; Prediction
-
-%h1= @lazar['endpoint'].gsub(/\"|\'/,'')
-
-%table
- %tr
- %th Structure
- %th Prediction
- %th Measured activity
- %tr
- %td
- %img{:src => "http://cactus.nci.nih.gov/chemical/structure/#{URI.encode(@lazar['smiles'])}/image", :alt => "#{@lazar['smiles']}"}
- %td
- %p= @lazar['prediction']
- %p
- (
- = @lazar['confidence']
- )
- %td= @lazar['database_activity']
- %tr
- %td{:colspan => 4} Neighbors
- %tr
- %th Structure
- %th Similarity
- %th Measured activity
-
- - @lazar['neighbors']['neighbor'].each do |neighbor|
- %tr
- %td
- %img{:src => "http://cactus.nci.nih.gov/chemical/structure/#{URI.encode(neighbor['smiles'])}/image", :alt => "#{neighbor['smiles']}"}
- %td= neighbor['similarity']
- %td= neighbor['activity']
diff --git a/views/prediction.haml b/views/prediction.haml
index 5842dfc..c448624 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -26,4 +26,18 @@
)
%td= @lazar['database_activity']
-%a{:href => "/neighbors", :lazar => @lazar } Show neighbors
+ %tr
+ %th{:colspan => 4} Neighbors
+ %tr
+ %th Structure
+ %th Similarity
+ %th Measured activity
+
+ - @lazar['neighbors']['neighbor'].each do |neighbor|
+ %tr
+ %td
+ %img{:src => "http://cactus.nci.nih.gov/chemical/structure/#{URI.encode(neighbor['smiles'])}/image", :alt => "#{neighbor['smiles']}"}
+ %td= neighbor['similarity']
+ %td= neighbor['activity']
+
+-# %a{:href => "/neighbors", :lazar => @lazar } Show neighbors