%div %a.btn.btn-xs.btn-default{:href => to('/predict'), :style=>"margin-bottom:1em;"} %span.glyphicon.glyphicon-chevron-left New Prediction %h3.help-block Similar particles %hr :javascript $(document).ready(function(){ $(".tablesorter").tablesorter({ debug: false, theme: "bootstrap", headerTemplate: '{content} {icon}', widgets: ['uitheme', 'staticRow', 'stickyHeaders'], widgetOptions: { stickyHeaders_xScroll : null }, sortList: [[1,1]], widthFixed: false, }); $('#neighbors').doubleScroll(); }); #neighbors.table-responsive %table.tablesorter{:style => "max-width:100%;white-space:nowrap;"} %thead %tr %th ID %th Similarity %th Composition %th.tox Toxicity %br Net cell association [mL/ug(Mg)] - @input.each do |key| - feature = OpenTox::Feature.find_by(:id=>key[0]) - name = feature.name - if !feature[:conditions]["MEDIUM"].blank? - name = feature.name + " / " + feature[:conditions]["MEDIUM"] - else - name = feature.name %th.physchem = name %tbody / query and match combined %tr.static / id %td - if @match %a{:href=> $ambit_search+@name, :rel=>"external"} %h5= @name - else %h5 Query / similarity %td - if @match %h5 1 - else %h5 x / composition %td - if @match %h5 Core = "["+@nanoparticle[:core]["name"]+"]" %h5 Coating = @nanoparticle[:coating][0]["name"] - else %h5 x / tox %td.tox - if @prediction[:value] %h5 Prediction: = @prediction[:value].round(3) - if @prediction[:rmse] %h5 Rmse: = @prediction[:rmse].round(3) - if @prediction[:r_squared] %h5 R_squared: = @prediction[:r_squared].round(3) - if @prediction[:prediction_interval] %h5 95% Prediction interval: - interval = @prediction[:prediction_interval].nil? ? " - - " : @prediction[:prediction_interval].collect{|i| i.round(2)} = "#{interval[0]} - #{interval[1]}" - if @prediction[:measurements] %hr %h5 Measurement - @prediction[:measurements].each do |m| %p= m - if !@prediction[:value] && !@prediction[:measurements] %h5 not available / physchem - if @prediction[:match] - sorted = {} - @input.each{|i| sorted[i[0]]=@prediction[:match].values[0]["physchem"][i[0]]} - sorted.each do |k,v| %td.physchem %div{:style=>"display:inline-block;padding-right:20px;"} %p= v[0].round(3) - else - @input.each do |v| %td.physchem %div{:style=>"display:inline-block;padding-right:20px;"} - if v[1].nil? %p x - else %p= v[1][0].round(3) / neighbors - if @prediction[:neighbors] - @prediction[:neighbors].each_with_index do |neighbor,idx| - nano = OpenTox::Nanoparticle.find(neighbor["_id"]) - pc_descriptors = nano.physchem_descriptors.delete_if{|k,v| feature = OpenTox::Feature.find_by(:id => k); feature.category != "P-CHEM"} %tr / ID %td %a{:href=> $ambit_search+nano.name, :rel=>"external"} %h5= nano.name / Similarity %td %h5= neighbor["similarity"].round(3) / Composition %td %h5 Core = "["+nano[:core]["name"]+"]" %h5 Coating = nano[:coating][0]["name"] / Tox %td.tox %h5 Measurement %p= neighbor["measurements"][0] / Physchem - @input.each do |k,v| %td.physchem %div %div{:style=>"display:inline-block;padding-right:20px;"} %p= v[0].round(3) unless v.nil?