summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--application.rb15
-rw-r--r--helper.rb4
-rw-r--r--views/jme_help.html197
-rw-r--r--views/layout.haml49
-rw-r--r--views/model.haml9
-rw-r--r--views/model_name.haml6
-rw-r--r--views/models.haml2
-rw-r--r--views/predict.haml42
-rw-r--r--views/style.sass38
9 files changed, 294 insertions, 68 deletions
diff --git a/application.rb b/application.rb
index 6cdfcfb..e61e155 100644
--- a/application.rb
+++ b/application.rb
@@ -82,7 +82,7 @@ before do
end
get '/?' do
- redirect url_for('/create')
+ redirect url_for('/predict')
end
get '/login' do
@@ -201,15 +201,17 @@ end
get '/predict/?' do
@models = ToxCreateModel.all.sort
+ @models.delete_if{|m| !is_authorized(m.web_uri, "GET")}
@models = @models.collect{|m| m if m.status == 'Completed'}.compact
- @models = @models.sort_by{|x| [x.endpoint ? x.endpoint : "",x.name.downcase]}
+ @models = @models.sort_by{|x| [x.endpoint ? x.endpoint : "Without Endpoint",x.name.downcase]}
haml :predict
end
-
+=begin
+=end
get '/create' do
+ redirect url_for('/predict') unless is_aluist
haml :create
end
-
get '/help' do
haml :help
end
@@ -246,7 +248,10 @@ post '/feature' do
end
post '/models' do # create a new model
-
+ unless is_aluist
+ flash[:notice] = "You do not have the permission to create a new model."
+ redirect url_for('/models')
+ end
unless (params[:dataset] and params[:prediction_feature]) or (params[:endpoint] and params[:file] and params[:file][:tempfile]) #params[:endpoint] and
flash[:notice] = "Please upload a Excel or CSV file and select an endpoint or select an AMBIT dataset."
redirect url_for('/create')
diff --git a/helper.rb b/helper.rb
index 11f99f7..8ea705c 100644
--- a/helper.rb
+++ b/helper.rb
@@ -9,6 +9,10 @@ helpers do
return false
end
+ def is_aluist
+ OpenTox::Authorization.list_user_groups(session[:username], session[:subjectid]).include?("aluist")
+ end
+
def hide_link(destination)
@link_id = 0 unless @link_id
@link_id += 1
diff --git a/views/jme_help.html b/views/jme_help.html
new file mode 100644
index 0000000..adf3e1f
--- /dev/null
+++ b/views/jme_help.html
@@ -0,0 +1,197 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <meta name="generator" content=
+ "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org">
+ <meta http-equiv="content-type" content=
+ "text/html; charset=us-ascii">
+
+ <title>JME Help</title>
+ <meta name="author" content="Peter Ertl, Novartis Pharma AG">
+ <link rel="stylesheet" href="../style.css" type="text/css">
+<style type="text/css">
+ body {
+ background-color: white;
+ }
+ h2.c3 {text-align: center}
+ p.c2 {font-style: italic; text-align: right}
+ p.c1 {text-align: center}
+</style>
+</head>
+
+<body>
+<h1>JME Molecular Editor</h1>
+
+ <p class="c2">Written by Peter Ertl, Novartis Pharma
+ AG</p>
+
+ <h2 class="c3">Basic Instructions</h2>
+
+ <p>This editor is intended to be used without any special
+ documentation or training, but there are some tricks which
+ can help you to work with it more efficiently.</p>
+
+ <h3>Menu Buttons</h3>
+
+ <ul>
+ <li><b>D-R</b> deletes functional groups - choose this
+ option and then click on the bond connecting the group
+ with the main skeleton</li>
+
+ <li><b>UDO</b> undo last editing step</li>
+
+ <li><b>QRY</b> (if enabled in the param tag) allows easy
+ specification of atomic queries for substructure
+ searches</li>
+
+ <li><b>Stereo bonds</b> - the type of stereo bond (up,
+ down) may be changed by clicking on the already created
+ stereo bond; this cycles through two / four possible
+ stereo bond types</li>
+
+ <li><b>Atomic charges</b> may be changed by the
+ <b>+/-</b> button. Editor enables modification of charges
+ only in "reasonable" cases. If you are not satisfied with
+ the editor's inteligence (concerning charges and the
+ explicit number of hydrogens) you can force your will by
+ using the <b>X</b> button</li>
+
+ <li><b>"Non-organic" atoms</b> or atoms with nonstandard
+ valence may be entered with help of <b>X</b> button by
+ specifying atomic SMILES (without [ ] brackets, i.e. Si,
+ Fe++, NH3+).</li>
+ </ul>
+
+ <h3>Keyboard Shortcuts</h3>
+
+ <p>Most of the commands may be accessed also by keyboard
+ shortcuts. It is possible to:</p>
+
+ <ul>
+ <li>change <b>atom type</b> by pressing <b>C</b>,
+ <b>N</b>, <b>O</b>, <b>S</b>, <b>F</b>, <b>L</b> (for Cl)
+ <b>B</b> (for Br) <b>I</b>, <b>P</b>, <b>H</b>, <b>X</b>,
+ <b>R</b> and clicking the respective atom</li>
+
+ <li>choose <b>bond order</b>: <b>-</b> for single bond,
+ <b>=</b> for double bond, <b>#</b> for triple bond</li>
+
+ <li>choose <b>ring type</b> by pressing <b>3</b>,
+ <b>4</b>, <b>5</b>, <b>6</b>, <b>7</b>, <b>8</b>,
+ <b>9</b> or <b>1</b> for phenyl, <b>0</b> for furyl</li>
+
+ <li>start <b>delete mode</b> by pressing <b>D</b> or
+ <b>Del</b> and</li>
+
+ <li>return to the <b>standard state</b> (carbon, single
+ bond) with <b>Esc</b></li>
+ </ul>
+
+ <p><b>common functional groups</b> may also be added by
+ keyboard shortcuts. Use <b>t</b> for t-butyl, <b>ft</b> for
+ trifluoromethyl, <b>lt</b> for trichloromethyl, <b>a</b>
+ for COOH, <b>z</b> for SO2Me and <b>y</b> for nitro, and
+ then click the atom where the group should be
+ connected.</p>
+
+ <h3>Moving and Rotation</h3>
+
+ <p>You can move molecule by "dragging free space" with the
+ left mouse button and rotate it by using the left mouse
+ button and <b>Shift</b> key (or left and right mouse
+ buttons together).</p>
+
+ <h3>Adding rings</h3>
+
+ <p>When a ring template is selected and multivalent atom is
+ clicked, a new ring will be created connected by single
+ bond to this atom. When spiro ring is required, the
+ <b>Shift</b> key must be pressed when clicking on the atom.
+ Spiro ring may be added only to atom with 2 single
+ bonds.</p>
+
+ <h3>Multivalent nitrogen groups</h3>
+
+ <p>Multivalent nitrogen groups, such as nitro, azide,
+ N-oxide, nitrile etc, should be drawn with a pentavalent
+ nitrogen as shown below.</p>
+
+ <p class="c1"><img src="images/nitro.gif" alt=
+ "nitro stuff"></p>
+
+ <p>The program automatically converts polar form of these
+ groups into non-polar one with pentavalent nitrogen. If you
+ prefer polar nitro (and similar) groups, use keyword
+ "polarnitro" in the applet param tag.</p>
+
+ <h3>Stereochemistry</h3>
+
+ <p>Stereochemistry at C4 centers, double bonds and allenes
+ is supported. Use the up/down wedge bonds to indicate
+ stereochemistry at the C4 centers. Remember, that only
+ bonds with a "sharp point" towards the atom are considered.
+ When creating SMILES the editor tries to guess missing
+ stereo features, in unresolvable cases an error message is
+ issued and the SMILES without stereo information is
+ created.</p>
+
+ <p>When the autoez keyword is set, SMILES with E,Z
+ stereochemistry on all non-ring double bonds is generated
+ automatically. Without this keyword (or for ring double
+ bonds) you have to mark a double bond as stereo by clicking
+ on it with the stereo bond button selected. The bond color
+ will change to violet.</p>
+
+ <p>Stereochemistry may be completely disabled by the
+ "nostereo" option in the param tag.</p>
+
+ <h3>Input of Multipart Structures</h3>
+
+ <p>By default only non-disconnected structures are allowed.
+ This may be changed by a "multipart" option in the applet
+ param tag. A button <b>NEW</b> appears in the JME menu.
+ Creation of a new molecule may be started only after
+ clicking the <b>NEW</b> button, selecting a proper template
+ (atom, ring, bond) and clicking free space in the drawing
+ area. Without <b>NEW</b> button the click on the free space
+ has the same effect as in the standard mode (i.e moving or
+ rotation of the last touched molecule). In the multipart
+ mode <b>CLR</b> button deletes the last touched
+ molecule.</p>
+
+ <h3>Atom Numbering</h3>
+
+ <p>Atom numbering (marking) is enabled with the option
+ "number" in the applet param tag (for reaction input this
+ is default). Button <b>123</b> appears in the JME menu. To
+ mark an atom press the <b>123</b> button and then the atom.
+ You can mark more atoms with the same number when pressing
+ <b>Shift</b> while clicking the 2nd and further atoms.
+ Second click on the marked atom deletes the number.</p>
+
+ <h3>Reaction Input</h3>
+
+ <p>Reaction input is enabled with the option "reaction" in
+ the applet param tag. Button with an arrow, <b>NEW</b>
+ button and <b>123</b> button appear in the JME menu and
+ arrow appears also in the drawing area. Now simply draw
+ reactant(s), product(s) and modulator(s) (modulators have
+ to be above the arrow) as explained in the description of
+ input of multipart structures. The arrow button enables
+ simplified input of reactions. After clicking it, the
+ reactant will be copied to the product (including atom
+ numbering, if any). When the <b>Shift</b> is pressed during
+ this action all atoms will be automatically numbered.</p>
+
+ <h3>Query Features</h3>
+
+ <p>Query button (when enabled in the option tag) launches a
+ query window which allows creation of SMARTS atom queries
+ by combining various atom attributes. Create a SMARTS query
+ and then click the respective atom in the
+ molecule.</p>
+</body>
+</html>
+
+
diff --git a/views/layout.haml b/views/layout.haml
index 96f7d35..eb5f9a5 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -3,7 +3,7 @@
%head
%meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=UTF-8'}
- %title ToxCreate
+ %title lazar (Lazy Structure Activity Relationships)
%script{:type => "text/javascript", :src => "javascripts/jquery.js"}
%script{:type => "text/javascript", :src => "javascripts/toxcreate.js"}
%script{:type => "text/javascript", :src => "javascripts/jquery-ui-progressbar.js"}
@@ -12,22 +12,21 @@
%body
.logo
- %img{:src => "ToxCreate_rgb_72.png", :alt => 'ToxCreate', :align => 'right'}/
- %br
- Creates computational models to predict toxicity
+ %h1= "Lazar Toxicity Predictions"
+
.index
%ul
- %li{:class => ("selected" if /\/create|echa|ambit|feature/ =~ request.path )}
- = link_to "Create", "/create"
- %li{:class => ("selected" if /models/ =~ request.path )}
- = link_to "Inspect", "/models"
+ -#%li{:class => ("selected" if /\/create|echa|ambit|feature/ =~ request.path )}
+ -#= link_to "Create", "/create"
%li{:class => ("selected" if /predict|lazar/ =~ request.path )}
- = link_to "Predict", "/predict"
+ = link_to "Prediction", "/predict"
+ %li{:class => ("selected" if /models/ =~ request.path )}
+ = link_to "Validation", "/models"
- if AA_SERVER
- %li{:class => ("selected" if /login/ =~ request.path )}
- = link_to "Login", "/login"
- %li{:class => ("selected" if /help/ =~ request.path )}
- = link_to "Help", "/help"
+ -#%li{:class => ("selected" if /login/ =~ request.path )}
+ -#= link_to "Login", "/login"
+ -#%li{:class => ("selected" if /help/ =~ request.path )}
+ -#= link_to "Documentation", "/help"
.content
.login_info
@@ -35,6 +34,12 @@
User:
%b= session[:username]
+ .notice
+ This is an experimental version based on
+ %a{:href => "http://www.opentox.org", :rel => "external"} OpenTox
+ services. Please report problems and feature requests to our
+ %a{:href => 'http://github.com/opentox/toxcreate/issues', :rel => "external"} issue tracker.
+
- if `hostname`.match(/ot-test/)
.notice
This service is for testing purposes only - once a week all models will be deleted. Please send bug reports and feature requests to our
@@ -48,18 +53,6 @@
= yield
.footer
- Disclaimer: ToxCreate uses state-of-the-art published and tested algorithms and methodologies with full validation information. However, just as with experimental measurements, computational predictions are subject to varying degrees of accuracy and uncertainty, so please read the full report carefully, particularly the validation information. No liability is accepted for any inaccuracy in predictions.
- %p
- - tag = `git tag`.split("\n").last
- - tagdate = `git show #{tag}|grep Date`.split("\n").last
- Version:
- = tag
- ,
- = tagdate
- &copy;
- %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology
- 2009-2011, powered by
- %a{:href => 'http://www.opentox.org', :rel => "external"} <span style="color:#5D308A;font-family:arial,sans-serif,helvetica;letter-spacing:-1px;">Open</span><span style="color:#000;font-family:arial,sans-serif,helvetica;font-weight:bold;letter-spacing:-1px;">Tox</span>
- (a project funded by the
- %a{:href => "http://cordis.europa.eu/fp7/", :rel => "external"} 7th Framework Programme
- of the European Commission)
+ &copy;
+ %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh
+ 2004-2011
diff --git a/views/model.haml b/views/model.haml
index fb264ca..0bb2be0 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -25,9 +25,10 @@
});
%div{:id => "model_#{model.id}_progress", :class => "model_progress", :title => "#{percentage_completed}%"}
- //= haml :model_progress, :locals=>{:percentage_completed=>percentage_completed}, :layout => false
- - if is_authorized(model.web_uri, "DELETE")
- %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'}
+ //= haml :model_progress, :locals=>{:percentage_completed=>percentage_completed}, :layout => false
+
+ - if is_authorized(model.web_uri, "DELETE") && is_aluist
+ %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'}
- if model.status =~ /Completed|Error|Cancelled/
&nbsp;(delete)
- else
@@ -46,7 +47,7 @@
- if model.error_messages
%dt Errors:
%dd= model.error_messages
- - if CONFIG[:logger]=="debug"
+ - if CONFIG[:logger]=="debug" && is_aluist
%dt Task:
%dd
%a{:href => "#{model.task_uri}", :id => "model_#{model.id}_task_link", :rel => "external"}
diff --git a/views/model_name.haml b/views/model_name.haml
index 91516ce..b83868e 100644
--- a/views/model_name.haml
+++ b/views/model_name.haml
@@ -5,8 +5,8 @@
});
%h2
= model.name
- - if is_authorized(model.web_uri, "PUT")
- %span{:class => "edit_button"}
+ - if is_authorized(model.web_uri, "PUT") && is_aluist
+ %span{:class => "edit_button"}
(
%a{:href => url_for("/model/#{model.id}/name?mode=edit"), :id => "edit_#{model.id}"} edit
- ) \ No newline at end of file
+ )
diff --git a/views/models.haml b/views/models.haml
index af11a32..2e60fc6 100644
--- a/views/models.haml
+++ b/views/models.haml
@@ -9,7 +9,7 @@
});
-# %p Get an overview about ToxCreate models. This page is refreshed every 15 seconds to update the model status.
-%p Get an overview about ToxCreate models. Parts of this page are refreshed every 5 seconds to update the model status.
+-#%p Get an overview about ToxCreate models. Parts of this page are refreshed every 5 seconds to update the model status.
-# explanations
= haml :classification, :layout => false
diff --git a/views/predict.haml b/views/predict.haml
index c6097ac..f326bf8 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -6,29 +6,40 @@
}
.input
- %p Use this service to obtain predictions from OpenTox models.
+ %p
+
+
- unless @models.empty?
%form{:name => "form", :action => url_for('/predict'), :method => "post", :enctype => "multipart/form-data" }
%fieldset
- %legend Draw a compound
+ %p
+ 1. Draw a chemical structure
+ %a{:href => "jme_help", :rel => "external"} (help)
%label &nbsp;
.jme
- %applet{:code => "JME.class", :name => "JME", :archive => "JME.jar", :width => "500", :height => "360"}
+ %applet{:code => "JME.class", :name => "JME", :archive => "JME.jar", :width => "500", :height => "360"}
%param{ :name => "options", :value => "polarnitro"}
- Please enable Java and JavaScript in your browser to use the JME editor.
- %span{:style=>"font-size:75%"}
+ Please enable Java and JavaScript in your browser to use the JME editor.
+ %span{:style=>"font-size:75%"}
&copy;
%a{:href => 'http://www.molinspiration.com/jme/index.html', :rel => "external"} JME Editor
- courtesy of Peter Ertl, Novartis
- %br
+ courtesy of Peter Ertl, Novartis
+ %br
-# %label{:for => 'identifier'} or enter a Name, InChI, Smiles, CAS, ...
- %label{:for => 'identifier'} or enter a Smiles string
+ %label{:for => 'identifier'}
+ or enter the
+ %a{:href => "http://en.wikipedia.org/wiki/Simplified_molecular_input_line_entry_specification", :rel => "external"} SMILES
+ string
+
+ %br
+ %br
%input{:type => 'text', :name => 'identifier', :id => 'identifier', :size => '60'}
%br
%fieldset
- %legend
- Choose one or more prediction models
+ %p
+ 2. Select one or more toxic endpoints
+
%br
- endpoint = ''
- @models.each do |model|
@@ -39,10 +50,11 @@
%input{:type => 'checkbox', :name => "selection[#{model.id}]", :value => true, :id => "model#{model.id}", :disabled => false}
%label{:for => "model#{model.id}"}
= model.name
- -#%input{:type => 'checkbox', :name => "selection[#{model.id}]", :value => true, :id => model.id, :disabled => !is_authorized(model.uri, "GET")}
+ -#%input{:type => 'checkbox', :name => "selection[#{model.id}]", :value => true, :id => model.id, :disabled => !is_authorized(model.uri, "GET")}
%br
%br
- %input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
- %input{ :type => "submit", :value => "Predict", :onclick => "getsmiles();"}
- = link_to 'Cancel', '/predict'
-
+ %fieldset
+ 3.
+ %input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
+ %input{ :type => "submit", :value => "Predict", :onclick => "getsmiles();"}
+ -#= link_to 'Cancel', '/predict'
diff --git a/views/style.sass b/views/style.sass
index 230c13c..c146ba3 100644
--- a/views/style.sass
+++ b/views/style.sass
@@ -1,5 +1,6 @@
$bg_color: #b9dcff
$bg_color2: #e5e7eb
+//$li_color: #ff8
$fg_color: #424345
$ot_purple: #5d308a
$body_color: white
@@ -12,7 +13,9 @@ body
font-family: verdana, arial, helvetica, sans-serif
background-color: $body_color
color: $text_color
- padding: 1em
+ height: 93%
+ padding: 2% 0% 2% 1%
+ text-align: left
a
text-decoration: none
font-weight: bold
@@ -23,17 +26,24 @@ body
background: transparent url('../external.gif') center right no-repeat
padding-right: 15px
- .headline
- .logo
- float: right
+ .logo
+ h1
+ display: inline
+ float: right
+ margin-left: 10%
+ padding-right: 2%
+
.index
clear: both
+ //margin: 2%
+
ul
margin: 0 0 2px 0
padding: 0
white-space: nowrap
list-style-type: none
+ //text-align: left
li
margin: 0
padding: 2px
@@ -45,29 +55,32 @@ body
font-weight: bold
a
text-decoration: none
+ //color: lightgrey
color: $bg_color
&:hover
+ //color: $li_color
color: $body_color
li.selected
font-weight: bold
background-color: $bg_color
border-bottom: 1px solid $bg_color
a
+ //color: $li_color
color: $text_color
.content
clear: both
background-color: $bg_color
- height: 100%
padding: 1em
- border-top: 1px solid $body_color
+ //margin: 4% 2% 0%
+ //border: 1px solid #555555
h2
margin: 20px 3px 2px 3px
.notice
//clear: both
//margin-top: 1em
padding: 0.5em 1em
- background-color: $body_color
+ background-color: white
border: 1px solid
border-color: $notice_border
.login_info
@@ -83,10 +96,10 @@ body
//clear: both
text-align: left
form
- padding: 1em
- background-color: $bg_color2
+ //padding: 1em
+ //background-color: $bg_color2
fieldset
- //margin: 0
+ margin-left: 1%
padding: 0
padding-right: 1em
border: 0
@@ -219,8 +232,9 @@ body
clear: right
.footer
- margin: 0.5em
- padding: 0.5em
+ clear: both
+ //margin: 2%
+ padding: 2%
font-size: small
.active