diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/caret.rb | 4 | ||||
-rw-r--r-- | lib/compound.rb | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/caret.rb b/lib/caret.rb index 886e2f9..df86093 100644 --- a/lib/caret.rb +++ b/lib/caret.rb @@ -30,8 +30,8 @@ module OpenTox R.eval "model <- train(activities ~ ., data = data, method = '#{method}', na.action = na.pass, allowParallel=TRUE)" rescue => e $logger.debug "R caret model creation error for:" - $logger.debug JSON.pretty_generate(dependent_variables) - $logger.debug JSON.pretty_generate(independent_variables) + $logger.debug dependent_variables + $logger.debug independent_variables return {:value => nil, :warning => "R caret model cration error."} end begin diff --git a/lib/compound.rb b/lib/compound.rb index b47364c..6c53cde 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -300,9 +300,8 @@ module OpenTox # Calculate molecular weight of Compound with OB and store it in object # @return [Float] molecular weight def molecular_weight - mw_feature = PhysChem.find_or_create_by(:name => "Openbabel.MW").id.to_s - calculate_properties unless properties[mw_feature] - properties[mw_feature] + mw_feature = PhysChem.find_or_create_by(:name => "Openbabel.MW") + calculate_properties([mw_feature]).first end private |