diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-05-11 12:13:37 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-05-11 12:13:37 +0200 |
commit | 524a68d8429b8adc16bd8073774f9305cb7138a0 (patch) | |
tree | 4cb42752d0c79adc1189a11ad3a5c0b9c1a094ad /lib | |
parent | 305f3caa692dd977df07cbc5ec195521e2a135fa (diff) |
Added balance patch
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parser.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/parser.rb b/lib/parser.rb index db746c1..dc5f675 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -348,16 +348,27 @@ module OpenTox when OT.NominalFeature case value.to_s when TRUE_REGEXP - @dataset.add(compound.uri, feature, true ) + #@dataset.add(compound.uri, feature, true ) + val=true when FALSE_REGEXP - @dataset.add(compound.uri, feature, false ) + #@dataset.add(compound.uri, feature, false ) + val=false end when OT.NumericFeature - @dataset.add compound.uri, feature, value.to_f + #@dataset.add compound.uri, feature, value.to_f + val = value.to_f when OT.StringFeature - @dataset.add compound.uri, feature, value.to_s + #@dataset.add compound.uri, feature, value.to_s + val = value.to_s @activity_errors << smiles+", "+row.join(", ") end + if val!=nil + @dataset.add(compound.uri, feature, val) + if type!=OT.NumericFeature + @dataset.features[feature][OT.acceptValue] = [] unless @dataset.features[feature][OT.acceptValue] + @dataset.features[feature][OT.acceptValue] << val.to_s unless @dataset.features[feature][OT.acceptValue].include?(val.to_s) + end + end end end |