summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-04-04 18:44:44 +0200
committerChristoph Helma <helma@in-silico.ch>2011-04-04 18:44:44 +0200
commit3430ce8d28846a405d403b2c4a03bcab5a11f9e6 (patch)
tree1ec12749584cdafee768264acaadb2de1e4c5ff7 /views
parent29516a370a458915050eca3dca586b3ec3b6f877 (diff)
Selection of AMBIT datasets added
Diffstat (limited to 'views')
-rw-r--r--views/ambit.haml15
-rw-r--r--views/compound_image.haml1
-rw-r--r--views/create.haml10
-rw-r--r--views/echa.haml13
-rw-r--r--views/feature.haml26
-rw-r--r--views/layout.haml4
-rw-r--r--views/lazar.haml116
-rw-r--r--views/model.haml15
8 files changed, 131 insertions, 69 deletions
diff --git a/views/ambit.haml b/views/ambit.haml
new file mode 100644
index 0000000..685c0dc
--- /dev/null
+++ b/views/ambit.haml
@@ -0,0 +1,15 @@
+%b Select:
+= session[:echa].split('#').last
+= "-&gt;"
+%b Dataset
+%em= "-&gt; Prediction Feature"
+
+%form{ :action => url_for('/feature'), :method => "post" }
+ %input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
+
+ - @datasets.each do |dataset|
+ %br
+ %input{:type=>'radio', :name => "dataset", :value => dataset} #{OpenTox::Dataset.new(dataset).load_metadata[DC.title]}
+
+ %p
+ %input{:type => 'submit', :value => 'Next'}
diff --git a/views/compound_image.haml b/views/compound_image.haml
index 18944dc..25e0dbf 100644
--- a/views/compound_image.haml
+++ b/views/compound_image.haml
@@ -1,2 +1 @@
%img{:src => compound.matching_smarts_image_uri(features[:activating].collect{|f| f[:smarts]},features[:deactivating].collect{|f| f[:smarts]}), :alt => compound.to_smiles}
-
diff --git a/views/create.haml b/views/create.haml
index 2149f3d..48669f4 100644
--- a/views/create.haml
+++ b/views/create.haml
@@ -17,18 +17,24 @@
= link_to "instructions for creating training datasets", '/help'
before submitting.
+
%form{ :action => url_for('/models'), :method => "post", :enctype => "multipart/form-data" }
%input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
%fieldset
%label{:for => 'file'}
- Select training data in
+ Upload training data in
= link_to "Excel", '/help'
or
= link_to "CSV", '/help'
format:
%input{:type => 'file', :name => 'file', :id => 'file', :size => '41'}
%input{ :type => "submit", :value => "Create model"}
- = link_to "Cancel", '/create'
+ =# link_to "Cancel", '/create'
+
+ %p
+ or
+ %a{:href => "echa"} Select a AMBIT dataset
+ (experimental)
-# explanations
= haml :lazar_description, :layout => false
diff --git a/views/echa.haml b/views/echa.haml
new file mode 100644
index 0000000..1cabfa0
--- /dev/null
+++ b/views/echa.haml
@@ -0,0 +1,13 @@
+%b Select:
+%b ECHA Endpoint
+%em= "-&gt; Dataset -&gt; Prediction Feature"
+
+%form{ :action => url_for('/ambit'), :method => "post" }
+ %input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
+
+ - @endpoints.each do |endpoint|
+ %br
+ %input{:type=>'radio', :name => "endpoint", :value => endpoint} #{endpoint.split('#').last}
+
+ %p
+ %input{:type => 'submit', :value => "Next"}
diff --git a/views/feature.haml b/views/feature.haml
new file mode 100644
index 0000000..c5b8293
--- /dev/null
+++ b/views/feature.haml
@@ -0,0 +1,26 @@
+%b Select:
+= session[:echa].split('#').last
+= "-&gt;"
+= OpenTox::Dataset.new(session[:dataset]).load_metadata[DC.title]
+= "-&gt;"
+%b Prediction feature
+
+%form{ :action => url_for('/models'), :method => "post" }
+
+ %input{:type => 'hidden', :name => 'subjectid', :id => 'subjectid', :value => session[:subjectid]}
+ %input{:type => 'hidden', :name => 'dataset', :id => 'dataset', :value => session[:dataset]}
+
+ - @features.each do |feature|
+ -# type = "unknown"
+ -# if feature.metadata[RDF.type].include?(OT.NominalFeature)
+ - type = "classification"
+ -# elsif feature.metadata[RDF.type].include?(OT.NumericFeature)
+ - type = "regression"
+
+ %br
+ %input{:type=>'radio', :name => "prediction_feature", :value => feature.uri} #{feature.metadata[DC.title]} (#{feature.feature_type})
+ %br
+ =# feature.inspect
+
+ %p
+ %input{:type => 'submit', :value => "Create model"}
diff --git a/views/layout.haml b/views/layout.haml
index c849dec..174db9f 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -17,7 +17,7 @@
Create and evaluate models to predict toxicity
.index
%ul
- %li{:class => ("selected" if /\/create/ =~ request.path )}
+ %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"
@@ -49,5 +49,5 @@
.footer
&copy;
%a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology
- 2009-2010, powered by
+ 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>
diff --git a/views/lazar.haml b/views/lazar.haml
index deb0c18..6ae6b20 100644
--- a/views/lazar.haml
+++ b/views/lazar.haml
@@ -1,59 +1,59 @@
-%p= link_to "New prediction", "/predict"
-.lazar-predictions
-
- -# explanations
- = haml :lazar_algorithm, :layout => false
- = haml :confidence, :layout => false
- = haml :similarity, :layout => false
- = haml :significant_fragments, :layout => false
- = haml :training_data, :layout => false
-
- %a{:name => "prediction"}
- %table
- %thead
- %tr
- %th= @prediction.title
- %th= toggle_link("#lazar_algorithm","Prediction")
- %th= toggle_link("#confidence","Confidence")
- %th Supporting information
-
- %tr
- -# %td
- %img{:src => @compound.to_image_uri, :alt => @compound.to_smiles}
- %td.image= compound_image(@compound,@prediction.descriptors(@compound))
- %td= activity_markup(@prediction.value(@compound))
- %td= sprintf('%.03g', @prediction.confidence(@compound))
- -#%td= @prediction.confidence(@compound)
- %td
- %ul
- %li
- %a{:href => "#prediction", :id => "show_names"} Names and synonyms
- :javascript
- $("a#show_names").click(function () {
- $("#compound_names").load("#{File.join("/compound",@compound.inchi)}");
- $("tr#names").toggle();
- });
- %li= toggle_link("#fragments","Significant fragments")
- -# This does not work, ask nina/vedrin
- -# %li
- %a{:href => "http://ambit.uni-plovdiv.bg:8080/ambit2/query/structure/?search=#{@compound.smiles}", :rel => "external"} Ambit data
- -# %li
- %a{:href => "http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=PureSearch&db=pccompound&term=#{URI.encode('"'+@compound.inchi+'"[InChI]')}", :rel => "external"} PubChem data
+%p= link_to "New prediction", "/predict"
+.lazar-predictions
+
+ -# explanations
+ = haml :lazar_algorithm, :layout => false
+ = haml :confidence, :layout => false
+ = haml :similarity, :layout => false
+ = haml :significant_fragments, :layout => false
+ = haml :training_data, :layout => false
+
+ %a{:name => "prediction"}
+ %table
+ %thead
+ %tr
+ %th= @prediction.title
+ %th= toggle_link("#lazar_algorithm","Prediction")
+ %th= toggle_link("#confidence","Confidence")
+ %th Supporting information
+
+ %tr
+ -# %td
+ %img{:src => @compound.to_image_uri, :alt => @compound.to_smiles}
+ %td.image= compound_image(@compound,@prediction.descriptors(@compound))
+ %td= activity_markup(@prediction.value(@compound))
+ %td= sprintf('%.03g', @prediction.confidence(@compound))
+ -#%td= @prediction.confidence(@compound)
+ %td
+ %ul
+ %li
+ %a{:href => "#prediction", :id => "show_names"} Names and synonyms
+ :javascript
+ $("a#show_names").click(function () {
+ $("#compound_names").load("#{File.join("/compound",@compound.inchi)}");
+ $("tr#names").toggle();
+ });
+ %li= toggle_link("#fragments","Significant fragments")
+ -# This does not work, ask nina/vedrin
+ -# %li
+ %a{:href => "http://ambit.uni-plovdiv.bg:8080/ambit2/query/structure/?search=#{@compound.smiles}", :rel => "external"} Ambit data
+ -# %li
+ %a{:href => "http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=PureSearch&db=pccompound&term=#{URI.encode('"'+@compound.inchi+'"[InChI]')}", :rel => "external"} PubChem data
(external)
- -# %li
- %a{:href => "http://chem.sis.nlm.nih.gov/chemidplus/direct.jsp?result=advanced&inchi=#{URI.encode @compound.inchi}", :rel => "external"} ToxNet data
- -#http://chem.sis.nlm.nih.gov/chemidplus/direct.jsp?result=advanced&regno=000143157
-
- %tr#names{ :style => "display: none;" }
- %td{:colspan => '4'}
- %a{:name => 'names'}
- = hide_link('#names')
- #compound_names
- %tr#fragments{ :style => "display: none;" }
- %td{:colspan => '4'}
- = hide_link('#fragments')
- = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound))}, :layout => false
-
- %tbody#neighbors
- = haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page}, :layout => false
-
+ -# %li
+ %a{:href => "http://chem.sis.nlm.nih.gov/chemidplus/direct.jsp?result=advanced&inchi=#{URI.encode @compound.inchi}", :rel => "external"} ToxNet data
+ -#http://chem.sis.nlm.nih.gov/chemidplus/direct.jsp?result=advanced&regno=000143157
+
+ %tr#names{ :style => "display: none;" }
+ %td{:colspan => '4'}
+ %a{:name => 'names'}
+ = hide_link('#names')
+ #compound_names
+ %tr#fragments{ :style => "display: none;" }
+ %td{:colspan => '4'}
+ = hide_link('#fragments')
+ = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound))}, :layout => false
+
+ %tbody#neighbors
+ = haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page}, :layout => false
+
diff --git a/views/model.haml b/views/model.haml
index 4933cdb..b4b3c59 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -58,12 +58,15 @@
- if model.training_dataset
%dt Training dataset:
%dd
- %a{:href => "#{model.training_dataset}.xls#{subjectstring}"} Excel sheet
- ,
- -#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
- -#%em (experts) ,
- %a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
- %em (experts)
+ - if model.training_dataset.match(/ambit/i)
+ %a{:href => "#{model.training_dataset}#{subjectstring}", :rel => "external"} Ambit database
+ - else
+ %a{:href => "#{model.training_dataset}.xls#{subjectstring}"} Excel sheet
+ ,
+ -#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
+ -#%em (experts) ,
+ %a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
+ %em (experts)
- if model.feature_dataset
%dt Feature dataset:
%dd