diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-02-08 10:05:25 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-02-08 10:05:25 +0100 |
commit | 86e652e6ebbf13e2385c2ce9114d92d3eaf9a87d (patch) | |
tree | f54ac68c26709009487925e4834e8e6b44e7b4de | |
parent | 4edc55affca2a5312f5e9b03c874c02c0fc0dce6 (diff) |
initial crossvalidation
-rw-r--r-- | application.rb | 25 | ||||
-rw-r--r-- | views/lazar.haml | 4 |
2 files changed, 18 insertions, 11 deletions
diff --git a/application.rb b/application.rb index fe5f511..7de342c 100644 --- a/application.rb +++ b/application.rb @@ -154,6 +154,7 @@ post '/models' do # create a new model end @model.training_dataset = @dataset.uri @model.nr_compounds = @dataset.compounds.size + @model.warnings = "" @model.warnings = @dataset.metadata[OT.Warnings] unless @dataset.metadata[OT.Warnings].empty? @model.save @@ -176,11 +177,13 @@ post '/models' do # create a new model end @model.save +=begin +=end unless url_for("",:full).match(/localhost/) @model.update :status => "Validating model" - begin - validation = OpenTox::Validation.create_crossvalidation( - :algorithm_uri => OpenTox::Algorithm::Lazar.uri, + #begin + validation = OpenTox::Crossvalidation.create( + :algorithm_uri => File.join(CONFIG[:services]["opentox-algorithm"],"lazar"), :dataset_uri => lazar.parameter("dataset_uri"), :subjectid => session[:subjectid], :prediction_feature => lazar.parameter("prediction_feature"), @@ -188,18 +191,19 @@ post '/models' do # create a new model ) @model.update(:validation_uri => validation.uri) LOGGER.debug "Validation URI: #{@model.validation_uri}" - rescue => e - LOGGER.debug "Model validation failed with #{e.message}." - @model.warnings += "Model validation failed with #{e.message}." - end + #rescue => e + #LOGGER.debug "Model validation failed with #{e.message}." + #@model.warnings += "Model validation failed with #{e.message}." + #end # create summary - validation.summary(@model.type).each{|k,v| eval "@model.#{k.to_s} = v"} +=begin + validation.summary(@model.type,session[:subjectid]).each{|k,v| eval "@model.#{k.to_s} = v"} @model.save @model.update :status => "Creating validation report" begin - @model.update(:validation_report_uri => validation.create_report) + @model.update(:validation_report_uri => validation.create_report(session[:subjectid])) rescue => e LOGGER.debug "Validation report generation failed with #{e.message}." @model.warnings += "Validation report generation failed with #{e.message}." @@ -207,11 +211,12 @@ post '/models' do # create a new model @model.update :status => "Creating QMRF report" begin - @model.update(:validation_qmrf_report_uri => validation.create_qmrf_report) + @model.update(:validation_qmrf_report_uri => validation.create_qmrf_report(session[:subjectid])) rescue => e LOGGER.debug "Validation QMRF report generation failed with #{e.message}." @model.warnings += "Validation QMRF report generation failed with #{e.message}." end +=end end diff --git a/views/lazar.haml b/views/lazar.haml index a46f82c..64b82bf 100644 --- a/views/lazar.haml +++ b/views/lazar.haml @@ -55,4 +55,6 @@ = haml :feature_table, :locals => {:features => sort(@prediction.descriptors(@compound))}, :layout => false %tbody#neighbors - = haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page}, :layout => :false + -#= @prediction.neighbors(@compound).to_yaml + = haml :neighbors, :locals => {:neighbors => @prediction.neighbors(@compound), :page => @page}#, :layout => :false + -#= haml :neighbors |