diff options
author | gebele <gebele@in-silico.ch> | 2015-03-10 16:58:49 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2015-03-10 16:58:49 +0100 |
commit | 12002a6390b10c3c12462936484ba967da2478e4 (patch) | |
tree | f8d7ef0f8253a11a5232a5d0a3823e548e3ccbe7 /application.rb | |
parent | 941ef6c04f98195a571920f2daf66b41a763ff22 (diff) |
marked links >;resize body if large table;setup sdf
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/application.rb b/application.rb index 981ee0b..360db1d 100644 --- a/application.rb +++ b/application.rb @@ -49,7 +49,30 @@ get '/prediction/:neighbor/details/?' do haml :details, :layout => false end - +=begin +# sdf representation for datasets +#TODO fix 502 errors from compound service +get '/predict/:dataset_uri/sdf/?' do + uri = CGI.unescape(params[:dataset_uri]) + $logger.debug uri + bad_request_error "Not a dataset uri." unless URI.dataset? uri + dataset = OpenTox::Dataset.find uri + @compounds = dataset.compounds + @data_entries = dataset.data_entries + sum="" + @compounds.each_with_index{ |c, idx| + sum << c.inchi + sum << c.sdf.sub(/\n\$\$\$\$/,'') + @data_entries[idx].each{ |f,v| + sum << "> <\"#{f}\">\n" + sum << v.join(", ") + sum << "\n\n" + } + sum << "$$$$\n" + } + send_file sum, :filename => "#{dataset.title}.sdf" +end +=end # fingerprints for compound in predictions get '/prediction/:model_uri/:type/:compound_uri/fingerprints/?' do @type = params[:type] |