summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2019-06-17 10:21:24 +0000
committergebele <gebele@in-silico.ch>2019-06-17 10:21:24 +0000
commitbe9d7e0dd360328d3ef7db77128527c40819cc1c (patch)
treecf84693f2fb27650f1ad9182edb644d40395942d
parent2f2a4c5e3f319d523424f365d034017152eb1504 (diff)
add PubChem links for compound cid
-rw-r--r--application.rb1
-rw-r--r--views/neighbors.haml12
-rw-r--r--views/prediction.haml4
3 files changed, 11 insertions, 6 deletions
diff --git a/application.rb b/application.rb
index 73ec11a..a2ec091 100644
--- a/application.rb
+++ b/application.rb
@@ -3,6 +3,7 @@ require_relative 'qmrf_report.rb'
require_relative 'task.rb'
require_relative 'helper.rb'
include OpenTox
+PUBCHEM_CID_URI = PUBCHEM_URI.split("/")[0..-3].join("/")+"/compound/"
[
"api.rb",
diff --git a/views/neighbors.haml b/views/neighbors.haml
index c4f3b94..91b5f57 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -21,8 +21,6 @@
%th{:scope=>"col"}
Compound
%th{:scope=>"col"}
- SMILES
- %th{:scope=>"col"}
Measured Activity
%a.btn.fa.fa-info-circle{:href=>"javascript:void(0)", :title=>"Measured Activity", :tabindex=>"0", data: {trigger:"focus", container:"body", toggle:"popover", placement:"auto", html:"true", content:"Experimental result(s) from the training dataset."}, :style=>"z-index:auto+10;"}
%th{:scope=>"col"}
@@ -38,8 +36,6 @@
%td
%a.btn.btn-link{:href => "#details#{j+1}", data: { toggle: "modal", remote: to("/prediction/#{CGI.escape(c.id.to_s)}/details"), :id=>"link#{j+1}#{count}"}}
= embedded_svg(c.svg, :title=>"click for details")
- %td
- %p= c.smiles
/ Measured Activity
%td
@@ -48,6 +44,10 @@
- else
- if !neighbor[:measurement].nil?
= (type == "Regression") ? "#{neighbor[:measurement].delog10.signif(3)} (#{unit})</br>#{c.mmol_to_mg(neighbor[:measurement].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : neighbor[:measurement]
+ %p
+ %a{:href=>PUBCHEM_CID_URI+c.cid, :rel => "external"}
+ PubChem
+ %span.fa.fa-xs.fa-external-link
/ Similarity = tanimoto
%td
= neighbor[:similarity].round(3)
@@ -80,8 +80,8 @@
shouldSwitch = false;
/* Get the two elements you want to compare,
one from current row and one from the next: */
- x = rows[i].getElementsByTagName("TD")[3];
- y = rows[i + 1].getElementsByTagName("TD")[3];
+ x = rows[i].getElementsByTagName("TD")[2];
+ y = rows[i + 1].getElementsByTagName("TD")[2];
// Check if the two rows should switch place:
if (parseFloat(x.innerHTML) < parseFloat(y.innerHTML)) {
// If so, mark as a switch and break the loop:
diff --git a/views/prediction.haml b/views/prediction.haml
index 2a315f9..23d27ba 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -25,6 +25,10 @@
%a.btn.btn-link{:href => "#details0", data: { toggle: "modal", remote: to("/prediction/#{@compound.id}/details"), :id=>"link01"}}
= embedded_svg(@compound.svg, :title=>"click for details")
%p= @compound.smiles
+ %p
+ %a{:href=>PUBCHEM_CID_URI+@compound.cid, :rel => "external"}
+ PubChem
+ %span.fa.fa-xs.fa-external-link
- @model_types = {}
- @dbhit = {}
- @predictions.each_with_index do |prediction,i|