%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 %thead %tr %th ID %th Similarity %th Composition %th.tox Toxicity %br Net cell association [mL/ug(Mg)] - @input.each do |key| %th.physchem = key[0].gsub(/\sMean/, '') %tbody / query and match combined %tr.static / id %td - if @prediction[:match] %a{:href=> $ambit_search+@prediction[:match].keys[0], :rel=>"external"} %h5= @prediction[:match].keys[0] - else %h5 Query / similarity %td - if @prediction[:match] %h5 1 - else %h5 x / composition %td - if @prediction[:match] - surfaceModifier = {} - surfaceModifier["Surface modifier"] = [@prediction[:match].values[0]["composition"]["Surface modifier1"], @prediction[:match].values[0]["composition"]["Surface modifier2"]] - @prediction[:match].values[0]["composition"].delete("Surface modifier1") - @prediction[:match].values[0]["composition"].delete("Surface modifier2") - @prediction[:match].values[0]["composition"].merge!(surfaceModifier) - @prediction[:match].values[0]["composition"].each do |k,v| %h5= k - if v.class == Array - v.compact.each do |value| %p= value - else %p= v - else %h5 x / tox %td.tox - if @prediction[:prediction] - @prediction[:prediction].each do |k,v| %h5 Prediction -#%p= k.split.drop(1).join(" ")[1..-2] - if v == nil %p not available - else %h5= v.round(5) - if @prediction[:match] - @prediction[:match].values[0]["tox"].each do |k,v| %hr %h5 Measurement -#%p= k.split.drop(1).join(" ")[1..-2] %p= v.round(3) - if !@prediction[:prediction] && !@prediction[:match] %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;"} /= k.gsub(/\sMean/, '') %p= v.round(3) - else - @input.each do |v| %td.physchem %div{:style=>"display:inline-block;padding-right:20px;"} //= v[0].gsub(/\sMean/, '') - if v[1].nil? %p x - else %p= v[1].round(3) / neighbors - if @prediction[:neighbors] - @prediction[:neighbors].each_with_index do |neighbor,idx| %tr / ID %td %a{:href=> $ambit_search+neighbor["id"], :rel=>"external"} %h5= neighbor["id"] / Similarity %td %h5= neighbor["similarity"].round(3) / Composition %td - surfaceModifier = {} - surfaceModifier["Surface modifier"] = [neighbor["composition"]["Surface modifier1"], neighbor["composition"]["Surface modifier2"]] - neighbor["composition"].delete("Surface modifier1") - neighbor["composition"].delete("Surface modifier2") - neighbor["composition"].merge!(surfaceModifier) - neighbor["composition"].each do |k,v| %h5= k - if v.class == Array - v.compact.each do |value| %p= value - else %p= v / Tox %td.tox - neighbor["tox"].each do |k,v| %h5 Measurement -#%p= k.split.drop(1).join(" ")[1..-2] %p= v.round(3) / Physchem - sorted = {} - @input.each{|i| sorted[i[0]]=neighbor["physchem"][i[0]]} - sorted.each do |k,v| %td.physchem %div %div{:style=>"display:inline-block;padding-right:20px;"} /= k.gsub(/\sMean/, '') %p= v.round(3)