diff options
author | gebele <gebele@in-silico.ch> | 2018-04-20 10:45:11 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2018-04-20 10:45:11 +0000 |
commit | 19eb655f4af1a4631692989a30a59b7b78e6669b (patch) | |
tree | 9bcfe5f51f40fa02d0e805b7a61648f9937406c0 /helper.rb | |
parent | f78d888a249303379c7934c83d5da11349a44b48 (diff) |
batch download with original identifiers
Diffstat (limited to 'helper.rb')
-rw-r--r-- | helper.rb | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -16,17 +16,14 @@ helpers do end def prediction_to_csv(m,c,p) - #model = Model::Validation.find(m.to_s) model = m model_name = "#{model.endpoint.gsub('_', ' ')} (#{model.species})" model_unit = model.regression? ? "(#{model.unit})" : "" converted_model_unit = model.regression? ? "#{model.unit =~ /\b(mmol\/L)\b/ ? "(mg/L)" : "(mg/kg_bw/day)"}" : "" - #predictions = predictions_ids.collect{|prediction_id| Prediction.find prediction_id} csv = "" - compound = c#Compound.find prediction_object.compound - prediction = p#prediction_object.prediction - #prediction.delete_if{|k,v| k =~ /neighbors|prediction_feature_id/} + compound = c + prediction = p output = {} line = "" output["model_name"] = model_name @@ -123,7 +120,7 @@ helpers do end def dataset_storage - all = Dataset.where(:source => /^tmp/) + all = Batch.where(:source => /^tmp/) out = Hash.new all.reverse.each{|d| out[d.id] = [d.name, d.created_at]} out |