From 44d9ceb30f6f8649f2d6fc179a925302f14d8a05 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 16 Jul 2018 14:20:03 +0000 Subject: add mazzatorta --- views/batch.haml | 10 +++++++--- views/predict.haml | 12 +++++++++--- views/prediction.haml | 22 +++++++++++++++++++++- 3 files changed, 37 insertions(+), 7 deletions(-) (limited to 'views') diff --git a/views/batch.haml b/views/batch.haml index 1aa6779..165b64b 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -76,7 +76,7 @@ callback: function(data, pagination) { var html = simpleTemplating(data); $('#data-container_'+id).html(html); - $('#data-container_'+id).css("min-height", $(window).height() + "px" ); + //$('#data-container_'+id).css("min-height", $(window).height() + "px" ); } }); } else if (span.className = "glyphicon glyphicon-menu-down"){ @@ -105,8 +105,12 @@ #result.panel{:id=>idx} %div.row %div.col-md-6 - %h5= (model == "Cramer") ? "Oral toxicity (Cramer rules)" : (m.endpoint =~ /Mutagenicity/i ? "Consensus mutagenicity" : "#{m.endpoint} (#{m.species})") - #pager{:id=>idx} + - if model =~ /Mazzatorta/ + %h5= "Lowest observed adverse effect level (LOAEL) (Mazzatorta) Rats" + #pager{:id=>idx} + - else + %h5= (model == "Cramer") ? "Oral toxicity (Cramer rules)" : (m.endpoint =~ /Mutagenicity/i ? "Consensus mutagenicity" : "#{m.endpoint} (#{m.species})") + #pager{:id=>idx} %div.col-md-6.h5 %a.btn.btn-default.btn-xs.disabled{:id => "detailsbutton_#{idx}", :data=>{:toggle=>"collapse"}, :href=>"javascript:void(0)", :onclick=>"pagePredictions('#{task}','#{model}','#{idx}')", :style=>"font-size:small;"} %span.glyphicon.glyphicon-menu-right diff --git a/views/predict.haml b/views/predict.haml index d638451..0afcc99 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -186,8 +186,8 @@ - @endpoints.each do |endpoint| %div{:id=>endpoint.gsub(/\s+/, "_")} %h4.head-back=endpoint - - unless endpoint =~ /^Oral/ - - @models.select{|m| m.endpoint == endpoint}.each do |model| + - if endpoint !~ /^Oral|Mazzatorta/ + - @models.select{|m| endpoint = endpoint.gsub("(lazar)","").strip if endpoint =~ /lazar/; m.endpoint == endpoint}.each do |model| %div.row{:id => model.id,:style=>"margin-bottom:1em;"} %span.col-lg-4.col-md-4.col-sm-4.col-xs-4 %input.check{:type => "checkbox", :name => "selection[#{model.id}]", :id => "selection[#{model.species.gsub(/\s+/, "_")}]", :value => true, :disabled => false} @@ -223,12 +223,18 @@ }); } } - - else + - elsif endpoint =~ /^Oral/ %div.row{:id => "Cramer",:style=>"margin-bottom:1em;"} %span.col-lg-4.col-md-4.col-sm-4.col-xs-4 %input.check{:type => "checkbox", :name => "selection[Cramer]", :id => "selection[Cramer]", :value => true, :disabled => false} %label{:for => "selection[Cramer]"} Cramer rules + - elsif endpoint =~ /Mazzatorta/ + %div.row{:id => "Mazzatorta",:style=>"margin-bottom:1em;"} + %span.col-lg-4.col-md-4.col-sm-4.col-xs-4 + %input.check{:type => "checkbox", :name => "selection[Mazzatorta]", :id => "selection[Mazzatorta]", :value => true, :disabled => false} + %label{:for => "selection[Mazzatorta]"} + Rats %fieldset#bottom.well %div.row %div.col-md-2 diff --git a/views/prediction.haml b/views/prediction.haml index b4b51ca..152efc9 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -23,6 +23,8 @@ - @model_types = {} - @dbhit = {} - toxtree = @predictions.pop if @toxtree == true + - mazzatorta = @predictions.find{|p| p["mazzatorta"]} + - @predictions.delete(mazzatorta) if mazzatorta - unless @predictions.blank? - @predictions.each_with_index do |prediction,i| - if prediction["Consensus prediction"] @@ -138,7 +140,7 @@ %br =prediction[:warnings].join("
") - / show Cramer rules if checked + / Cramer - if @toxtree == true %td{:style=>"vertical-align:top;white-space:nowrap;"} %b.title Oral toxicity (Cramer rules) @@ -151,6 +153,24 @@ %br =toxtree.last["Cramer rules, with extensions"] + / Mazzatorta + - if mazzatorta + %td{:style=>"vertical-align:top;white-space:nowrap;"} + %b.title Lowest observed adverse effect level (LOAEL) (Rats) (Mazzatorta) + %p + - hash = mazzatorta["mazzatorta"] + - unless hash.keys.include?("warnings") + %b Prediction: + %br + = "#{hash[:mmol_prediction]} (mmol/kg_bw/day)" + %br + = "#{hash[:prediction]} (mg/kg_bw/day)" + - else + %b Warnings: + %br + = "#{hash[:warnings]}" + + / always show the neighbors table, message is given there. Except only Cramer is selected. - unless @predictions.blank? = haml :neighbors, :layout => false -- cgit v1.2.3