summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2016-04-07 17:39:14 +0200
committerChristoph Helma <helma@in-silico.ch>2016-04-07 17:39:14 +0200
commit063acd4dc63e9287287cc1ff78fff2064ff74e4f (patch)
tree4c3c1a90bed69eead86ccae614105c67b5e6f507 /lib
parent83072cc3c5251a3eb4496fa68b413540ea9409fd (diff)
initial ambit import
Diffstat (limited to 'lib')
-rw-r--r--lib/dataset.rb1
-rw-r--r--lib/feature.rb1
-rw-r--r--lib/lazar.rb3
-rw-r--r--lib/nanoparticle.rb17
-rw-r--r--lib/opentox.rb1
5 files changed, 21 insertions, 2 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 5d8aeaf..2e48626 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -9,7 +9,6 @@ module OpenTox
field :feature_ids, type: Array, default: []
field :compound_ids, type: Array, default: []
field :data_entries, type: Array, default: []
- field :source, type: String
# Readers
diff --git a/lib/feature.rb b/lib/feature.rb
index b58946b..f13a3fb 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -6,6 +6,7 @@ module OpenTox
field :numeric, type: Boolean
field :measured, type: Boolean
field :calculated, type: Boolean
+ field :unit, type: String
end
# Feature for categorical variables
diff --git a/lib/lazar.rb b/lib/lazar.rb
index a28ba3a..39dd8fa 100644
--- a/lib/lazar.rb
+++ b/lib/lazar.rb
@@ -61,7 +61,7 @@ suppressPackageStartupMessages({
"
# OpenTox classes and includes
-CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveOneOutValidation","RepeatedCrossValidation","Experiment"]# Algorithm and Models are modules
+CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveOneOutValidation","RepeatedCrossValidation","Experiment","Nanoparticle"]# Algorithm and Models are modules
[ # be aware of the require sequence as it affects class/method overwrites
"overwrite.rb",
@@ -71,6 +71,7 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveO
"feature.rb",
"physchem.rb",
"compound.rb",
+ "nanoparticle.rb",
"dataset.rb",
"algorithm.rb",
"model.rb",
diff --git a/lib/nanoparticle.rb b/lib/nanoparticle.rb
new file mode 100644
index 0000000..3783ece
--- /dev/null
+++ b/lib/nanoparticle.rb
@@ -0,0 +1,17 @@
+module OpenTox
+
+ class Nanoparticle
+ include OpenTox
+
+ field :particle_id, type: String
+ field :core, type: String
+ field :coatings, type: Array
+
+ #field :physchem_descriptors, type: Hash, default: {}
+ #field :toxicities, type: Hash, default: {}
+ field :features, type: Hash, default: {}
+
+ end
+end
+
+
diff --git a/lib/opentox.rb b/lib/opentox.rb
index 186c87a..cc18cc6 100644
--- a/lib/opentox.rb
+++ b/lib/opentox.rb
@@ -13,6 +13,7 @@ module OpenTox
include Mongoid::Timestamps
store_in collection: klass.downcase.pluralize
field :name, type: String
+ field :source, type: String
field :warnings, type: Array, default: []
end
OpenTox.const_set klass,c