summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorot5 <ot5@toxcreate3.in-silico.ch>2012-04-13 14:56:37 +0200
committerot5 <ot5@toxcreate3.in-silico.ch>2012-04-13 14:56:37 +0200
commit35448f7bd136b7f3ce82a784e2c433bdea2b9880 (patch)
tree407f0fba3d448b3689c614100bdd9e61d21b9042
parent9ceed9a7598fbc45946f50690aaa6b3ca7993516 (diff)
Fix: verbose prediction ds for Substructure.lookupjl
-rw-r--r--lib/model.rb35
1 files changed, 28 insertions, 7 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 8d7e4f6..88023eb 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -319,6 +319,16 @@ module OpenTox
@prediction_dataset.add @compound.uri, feature_uri, true
f+=1
end
+ elsif @feature_calculation_algorithm == "Substructure.lookup"
+ f = 0
+ @compound_features.each do |feature, value|
+ features[feature] = feature
+ @prediction_dataset.add_feature(feature, {
+ RDF.type => [OT.NumericFeature]
+ })
+ @prediction_dataset.add @compound.uri, feature, value
+ f+=1
+ end
else
@compound_features.each do |feature|
features[feature] = feature
@@ -342,15 +352,26 @@ module OpenTox
else
feature_uri = feature
end
- @prediction_dataset.add neighbor[:compound], feature_uri, true
+ if @feature_calculation_algorithm == "Substructure.lookup"
+ @prediction_dataset.add neighbor[:compound], feature_uri, @fingerprints[neighbor[:compound]][feature_uri]
+ else
+ @prediction_dataset.add neighbor[:compound], feature_uri, true
+ end
+
unless features.has_key? feature
features[feature] = feature_uri
- @prediction_dataset.add_feature(feature_uri, {
- RDF.type => [OT.Substructure],
- OT.smarts => feature,
- OT.pValue => @p_values[feature],
- OT.effect => @effects[feature]
- })
+ if @feature_calculation_algorithm == "Substructure.lookup"
+ @prediction_dataset.add_feature(feature_uri, {
+ RDF.type => [OT.NumericFeature]
+ })
+ else
+ @prediction_dataset.add_feature(feature_uri, {
+ RDF.type => [OT.Substructure],
+ OT.smarts => feature,
+ OT.pValue => @p_values[feature],
+ OT.effect => @effects[feature]
+ })
+ end
f+=1
end
end