summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--aop.gemspec1
-rw-r--r--public/rect.pngbin0 -> 218 bytes
-rw-r--r--views/assays.haml12
-rw-r--r--views/layout.haml66
-rw-r--r--views/neighbors.haml65
-rw-r--r--views/predicted_assays.haml12
-rw-r--r--views/predicted_targets.haml6
-rw-r--r--views/style.scss11
-rw-r--r--views/targets.haml6
10 files changed, 135 insertions, 46 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..49b161f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+Gemfile.lock
+.sass-cache/
diff --git a/aop.gemspec b/aop.gemspec
index 51f4641..03e7a08 100644
--- a/aop.gemspec
+++ b/aop.gemspec
@@ -34,5 +34,6 @@ Gem::Specification.new do |s|
# external requirements
s.requirements << "memcached"
s.post_install_message = "Please make sure you have memcached installed."
+
end
diff --git a/public/rect.png b/public/rect.png
new file mode 100644
index 0000000..e19845f
--- /dev/null
+++ b/public/rect.png
Binary files differ
diff --git a/views/assays.haml b/views/assays.haml
index 510234d..5e7361f 100644
--- a/views/assays.haml
+++ b/views/assays.haml
@@ -1,7 +1,15 @@
%dl
- @assays.sort{|a,b| a["Assay Name"] <=> b["Assay Name"]}.each do |assay|
%dt
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay['Assay Name']}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay['Assay Name']}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
%dd
Assay ID:
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay['AID']}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay['AID']}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
diff --git a/views/layout.haml b/views/layout.haml
index 5160c31..b6b4c0e 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -6,7 +6,6 @@
%link{:rel=>'stylesheet', :href=>"#{'/style.css'}", :type => "text/css"}
%script{:type => "text/javascript", :src => "/jquery-1.8.2.js"}
:javascript
- $(document).ready(function() { $.ajax({ url: "/cid/#{@cid}/experiments", cache: true }); });
function show(title,element,uri) {
$(element).html("<h4>"+title+"</h4>"+"Retrieving data from PubChem. This may take some time, please be patient."+"<img src=\"/spinning-wait-icons/wait30trans.gif\" alt=\"Searching PubChem\">");
$.ajax({
@@ -45,14 +44,77 @@
}
%body
+ %noscript
+ %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"}
+ Your web browser must have JavaScript enabled in order for this application to display correctly.
+
%h1 PubChem read across
+ %button{:id=>"about", :style => "margin-left:80%;z-index:4;position:absolute; top:10px; right:0px;"}
+ About this service
+ :javascript
+ $("#about").click(function() {
+ $("info").toggle();
+ });
+ %info{:id=>"info", :style => "display:none;z-index:5;position:fixed; top:10px; left:25%; width: 50%; background-color:#F5F5F5;border:solid 1px black;"}
+ %button{:id => "x", :style => "position:absolute;right:0px;"} x
+ %div{:style => "align:justify;padding:1em;"}
+ %dt
+ (experimental)
+ %dd
+ Filtered experimental data from pubchem database.
+ %br
+ %dt
+ (read across)
+ %dd
+ Prediction results of processed pubchem data.
+ %br
+ %dt
+ Prediction relationship
+ %dd
+ Similar compounds, predicted assays and predicted targets are related considering relevant data.
+ :javascript
+ $("#x").click(function() {
+ $("info").toggle();
+ });
%form{:name => "form", :action => '/search', :method => "GET"}
%fieldset
%label{:for => 'name'} Compound name:
%input{:type => 'text', :name => 'name', :id => 'name'}
%input{ :type => "submit", :value => "Search" }
%em This is an experimental version. Loading data from PubChem can be slow. Please use the "Back" button and retry the offending operation if you have timeout problems.
+
+
+
= yield
.footer
- %a{:href => 'http://www.in-silico.ch', :rel => "external"} <i style="font-family: serife">in silico</i> toxicology gmbh 2013 \ No newline at end of file
+ &copy;
+ %a{:href => 'http://www.in-silico.ch', :rel => "_blank"} <i style="font-family: serife">in silico</i> toxicology gmbh 2013 - 2014
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
+ #back-top{:style => "z-index:100;position:fixed;bottom:0%;width:97%;"}
+ %hr{:style => "margin-bottom:0;"}
+ %a{:href => "", :style=>"text:decoration:none;color:#ccc;"}
+ %img{:src => "/rect.png", :alt => "top", :width => "100%", :height => "50px"}
+ %div{:style => "margin-top:-50px;font-size:x-small;text-align:center;z-index:101;"}
+ TOP
+ :javascript
+ $("#back-top").hide();
+ $(function () {
+ $(window).scroll(function () {
+ if ($(this).scrollTop() > 600) {
+ $('#back-top').fadeIn();
+ } else {
+ $('#back-top').fadeOut();
+ }
+ });
+ // scroll body to 0px on click
+ $('#back-top a').click(function () {
+ $('body,html').animate({
+ scrollTop: 0
+ }, 500);
+ return false;
+ });
+ });
diff --git a/views/neighbors.haml b/views/neighbors.haml
index 5563392..8435ac1 100644
--- a/views/neighbors.haml
+++ b/views/neighbors.haml
@@ -1,34 +1,41 @@
+- @neighbors = []
+- neighbors(@cid).each do |n|
+ - unless assays(n,"active").empty? and assays(n,"inactive").empty?
+ - @neighbors << n
+
%table
%colgroup
%col{:style => "width: 300px"}
%col{:style => "width: 47%"}
%col{:style => "width: 47%"}
- - idx = 0
- - while idx < 10
- - neighbors(@cid).each do |n|
- - unless assays(n,"active").empty? and assays(n,"inactive").empty?
- %tr
- %th{:style => "vertical-align:top;", :colspan => "3"}
- = name n
- (
- = similarity(@cid,n).round(3)
- )
- %tr
- %td{:style => "vertical-align:top;"}
- %img{:src => image_uri(n), :alt => "#{name n}", :class => "compound"}
- %td{:style => "vertical-align:top;"}
- %p{:id => "targets#{n}", :class => "neighbors"}
- :javascript
- hide("Measured gene/protein targets","#targets#{n}", "/cid/#{n}/targets/active");
- %p{:id => "nontargets#{n}", :class => "neighbors"}
- :javascript
- hide("Measured gene/protein non-targets","#nontargets#{n}", "/cid/#{n}/targets/inactive");
- %td{:style => "vertical-align:top;"}
- %p{:id => "assays#{n}", :class => "neighbors"}
- :javascript
- hide("Other active assays","#assays#{n}", "/cid/#{n}/assays/active");
- %p{:id => "inactive_assays#{n}", :class => "neighbors"}
- :javascript
- hide("Other inactive assays","#inactive_assays#{n}", "/cid/#{n}/assays/inactive");
-
- - idx += 1
+
+ - unless @neighbors.empty? or @neighbors.nil?
+ - @neighbors.each do |n|
+ %tr
+ %th{:style => "vertical-align:top;", :colspan => "3"}
+ = name n
+ (
+ = similarity(@cid,n).round(3)
+ )
+ %tr
+ %td{:style => "vertical-align:top;"}
+ %img{:src => image_uri(n), :alt => "#{name n}", :class => "compound"}
+ %td{:style => "vertical-align:top;"}
+ %p{:id => "targets#{n}", :class => "neighbors"}
+ :javascript
+ hide("Measured gene/protein targets","#targets#{n}", "/cid/#{n}/targets/active");
+ %p{:id => "nontargets#{n}", :class => "neighbors"}
+ :javascript
+ hide("Measured gene/protein non-targets","#nontargets#{n}", "/cid/#{n}/targets/inactive");
+ %td{:style => "vertical-align:top;"}
+ %p{:id => "assays#{n}", :class => "neighbors"}
+ :javascript
+ hide("Other active assays","#assays#{n}", "/cid/#{n}/assays/active");
+ %p{:id => "inactive_assays#{n}", :class => "neighbors"}
+ :javascript
+ hide("Other inactive assays","#inactive_assays#{n}", "/cid/#{n}/assays/inactive");
+ - else
+ %tr
+ %td{ :colspan => "3"}
+ %em
+ Similar compounds depend on predicted assays and predicted targets.
diff --git a/views/predicted_assays.haml b/views/predicted_assays.haml
index 299abf4..6fca92b 100644
--- a/views/predicted_assays.haml
+++ b/views/predicted_assays.haml
@@ -1,10 +1,18 @@
%dl
- @assays.sort{|a,b| [b["p_active"],b["p_inactive"]].max <=> [a["p_active"],a["p_inactive"]].max}.each do |assay|
%dt
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay['Assay Name']}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay['Assay Name']}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
%dd
Assay ID:
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay['AID']}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay['AID']}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
%dd
p_active:
= assay["p_active"].to_f.round(3)
diff --git a/views/predicted_targets.haml b/views/predicted_targets.haml
index 97c68c4..6abd4c1 100644
--- a/views/predicted_targets.haml
+++ b/views/predicted_targets.haml
@@ -6,7 +6,11 @@
= assay["Target GI"]
%dd
Assay ID:
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay["AID"]}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay["AID"]}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });
%dd
p_active:
= assay["p_active"].to_f.round(3)
diff --git a/views/style.scss b/views/style.scss
index 225bee8..25833e7 100644
--- a/views/style.scss
+++ b/views/style.scss
@@ -103,21 +103,14 @@ img.compound {
radius: 4px;
}
}
+
.footer {
margin: 200px 0px 20px 4px;
- width: 99%;
text-align: right;
}
+
.footer a {
text-decoration: none;
color: #000;
&:hover { color: #900; }
}
-.tooltip {
- background-color: #fff;
- border: 2px solid #ccc;
- font-size: 0.5em;
- padding: 1em;
- display: none;
- z-index: 50;
-} \ No newline at end of file
diff --git a/views/targets.haml b/views/targets.haml
index 9622abd..09e6009 100644
--- a/views/targets.haml
+++ b/views/targets.haml
@@ -7,5 +7,9 @@
%dd
Assay IDs:
- @assays.select{|a| a["Target GI"] == target.last}.each do |assay|
- %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}"} #{assay['AID']}
+ %a{:href => "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=#{assay["AID"]}", :rel => "_blank"} #{assay['AID']}
+ :javascript
+ $('A[rel="_blank"]').each(function(){
+ $(this).attr('target', '_blank');
+ });