summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-11-10 11:06:27 +0000
committergebele <gebele@in-silico.ch>2016-11-10 11:06:27 +0000
commit295dcfc74e1375e495ec3d9c1e74a402eb4decd4 (patch)
treed819b96db3cade6958f0569d161d39906fcd61c4 /lib
parent461a77d91054bd5456f6a1e2b5c7ed30aac56d43 (diff)
added nanomodel create
Diffstat (limited to 'lib')
-rw-r--r--lib/model.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 7503215..adcbcc6 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -418,6 +418,28 @@ module OpenTox
prediction_model
end
+ def self.create dir: dir, algorithms: algorithms
+ training_dataset = Dataset.where(:name => "Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles").first
+ unless training_dataset
+ Import::Enanomapper.import dir
+ training_dataset = Dataset.where(name: "Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles").first
+ end
+ prediction_model = self.new(
+ :endpoint => "log2(Net cell association)",
+ :source => "https://data.enanomapper.net/",
+ :species => "A549 human lung epithelial carcinoma cells",
+ :unit => "log2(ug/Mg)"
+ )
+ prediction_feature = Feature.where(name: "log2(Net cell association)", category: "TOX").first
+ model = Model::LazarRegression.create(prediction_feature: prediction_feature, training_dataset: training_dataset, algorithms: algorithms)
+ prediction_model[:model_id] = model.id
+ repeated_cv = Validation::RepeatedCrossValidation.create model
+ prediction_model[:repeated_crossvalidation_id] = Validation::RepeatedCrossValidation.create(model).id
+ #prediction_model[:leave_one_out_validation_id] = Validation::LeaveOneOut.create(model).id
+ prediction_model.save
+ prediction_model
+ end
+
end
end