diff options
author | Christoph Helma <helma@in-silico.de> | 2009-07-26 14:48:55 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2009-07-26 14:48:55 +0200 |
commit | 14516c7c3f98c0bef022a0148706ece7e5f33bb7 (patch) | |
tree | b267aa7ad0aa9a908121e3e843cb91dcb0bae0fa | |
parent | d2a8143b0ace1f992bb5da9ec9ea53641c56c647 (diff) |
display of neighbors added
-rw-r--r-- | lazar.rb | 6 | ||||
-rw-r--r-- | views/neighbors.haml | 34 | ||||
-rw-r--r-- | views/prediction.haml | 16 |
3 files changed, 15 insertions, 41 deletions
@@ -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 @@ -→ -%a{ :href => "/#{params[:id]}" } Enter structure -→ 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 |