diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-04-14 19:43:24 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-04-14 19:43:24 +0200 |
commit | 753fcc204d93d86c76860bee6e2f7d0468c3c940 (patch) | |
tree | 30fc9980de8b298ee57199c9b540408019a8976c /test/nanoparticles.rb | |
parent | 64f1f32ced77afb278bdb7c27397c5299a73675c (diff) |
features/toxicities fixed
Diffstat (limited to 'test/nanoparticles.rb')
-rw-r--r-- | test/nanoparticles.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/test/nanoparticles.rb b/test/nanoparticles.rb index 6f241ec..46073a9 100644 --- a/test/nanoparticles.rb +++ b/test/nanoparticles.rb @@ -6,16 +6,29 @@ class NanoparticleTest < MiniTest::Test dataset_ids = Import::Enanomapper.import assert_operator Nanoparticle.count , :>, 570, "Only #{Nanoparticle.count} nanoparticles imported" assert_operator dataset_ids.size, :>, 8, "Only #{dataset_ids.size} bundles imported" - p dataset_ids.collect{|d| Dataset.find(d).name} assert dataset_ids.collect{|d| Dataset.find(d).name}.include? ("NanoWiki") assert dataset_ids.collect{|d| Dataset.find(d).name}.include? ("Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles") + p dataset_ids.collect{|d| {d => Dataset.find(d).name}} + dataset_ids.collect do |d| + d = Dataset.find(d) + p d.name + puts d.to_csv + end end - def test_create_model - Model::NanoLazar.create_all.each do |model| - np = Nanoparticle.find(model.training_particle_ids.sample) - model.predict np + def test_export + Dataset.all.each do |d| + puts d.to_csv end end + def test_create_model + training_dataset = Dataset.find_or_create_by(:name => "Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles") + model = Model::LazarRegression.create(training_dataset, :prediction_algorithm => "OpenTox::Algorithm::Regression.local_physchem_regression", :neighbor_algorithm => "nanoparticle_neighbors") + nanoparticle = training_dataset.nanoparticles[-34] + prediction = model.predict nanoparticle + p prediction + refute_nil prediction[:value] + end + end |