From e63e97086ac05e7a86f1a53bdcbc72eec0cabf16 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 9 Nov 2015 14:58:34 +0100 Subject: leave one out validation implemented --- lib/lazar.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index cc66841..5d9bc19 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -60,7 +60,7 @@ ENV['FMINER_SILENT'] = 'true' ENV['FMINER_NR_HITS'] = 'true' # OpenTox classes and includes -CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","RepeatedCrossValidation","Experiment"]# Algorithm and Models are modules +CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveOneOutValidation","RepeatedCrossValidation","Experiment"]# Algorithm and Models are modules [ # be aware of the require sequence as it affects class/method overwrites "overwrite.rb", @@ -80,6 +80,7 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","Repeat "regression.rb", "validation.rb", "crossvalidation.rb", + "leave-one-out-validation.rb", "experiment.rb", ].each{ |f| require_relative f } -- cgit v1.2.3 From f61b7d3c65d084747dc1bf87214e5ec0c57326be Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 9 Feb 2016 11:04:00 +0100 Subject: pls regression --- lib/lazar.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 5d9bc19..ae42d42 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -45,6 +45,7 @@ R = Rserve::Connection.new R.eval "library(ggplot2)" R.eval "library(grid)" R.eval "library(gridExtra)" +R.eval "library('pls')" # Require sub-Repositories require_relative '../libfminer/libbbrc/bbrc' # include before openbabel -- cgit v1.2.3 From b90720cc26d789a96fa6f7a054fe06fc8b4ef33d Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Sat, 27 Feb 2016 16:47:48 +0100 Subject: local pls regression as default regression algorithm --- lib/lazar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index ae42d42..e5c1609 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -45,7 +45,7 @@ R = Rserve::Connection.new R.eval "library(ggplot2)" R.eval "library(grid)" R.eval "library(gridExtra)" -R.eval "library('pls')" +R.eval "library(pls)" # Require sub-Repositories require_relative '../libfminer/libbbrc/bbrc' # include before openbabel -- cgit v1.2.3 From 8c973e16028cb95c978bb08cf79369a5c3520c31 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Sun, 28 Feb 2016 12:43:38 +0100 Subject: physchem feature class --- lib/lazar.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index e5c1609..c43dae7 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -69,11 +69,12 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveO "error.rb", "opentox.rb", "feature.rb", + "physchem.rb", + "descriptor.rb", "compound.rb", "dataset.rb", "descriptor.rb", "algorithm.rb", - "descriptor.rb", "bbrc.rb", "model.rb", "similarity.rb", -- cgit v1.2.3 From 24b1524f20eccd3bfd59171f1f7151fcc272a427 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 14 Mar 2016 10:06:22 +0100 Subject: folds split on unique compounds instead of data entries --- lib/lazar.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index c43dae7..bcae96f 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -42,10 +42,16 @@ end # R setup R = Rserve::Connection.new -R.eval "library(ggplot2)" -R.eval "library(grid)" -R.eval "library(gridExtra)" -R.eval "library(pls)" +R.eval " +suppressPackageStartupMessages({ + library(ggplot2) + library(grid) + library(gridExtra) + library(caret) + library(doMC) + registerDoMC(4) +}) +" # Require sub-Repositories require_relative '../libfminer/libbbrc/bbrc' # include before openbabel -- cgit v1.2.3 From 989f20ae58c3ecb0ce62bc4468c3dab2599637b3 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 14 Mar 2016 10:38:37 +0100 Subject: getconf for number of cores --- lib/lazar.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index bcae96f..63257ca 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -41,6 +41,9 @@ when "development" end # R setup +# should work on POSIX including os x +# http://stackoverflow.com/questions/19619582/number-of-processors-cores-in-command-line +NR_CORES = `getconf _NPROCESSORS_ONLN`.to_i R = Rserve::Connection.new R.eval " suppressPackageStartupMessages({ @@ -49,14 +52,14 @@ suppressPackageStartupMessages({ library(gridExtra) library(caret) library(doMC) - registerDoMC(4) + registerDoMC(#{NR_CORES}) }) " # Require sub-Repositories -require_relative '../libfminer/libbbrc/bbrc' # include before openbabel -require_relative '../libfminer/liblast/last' # -require_relative '../last-utils/lu.rb' +#require_relative '../libfminer/libbbrc/bbrc' # include before openbabel +#require_relative '../libfminer/liblast/last' # +#require_relative '../last-utils/lu.rb' require_relative '../openbabel/lib/openbabel' # Fminer environment variables @@ -81,7 +84,7 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveO "dataset.rb", "descriptor.rb", "algorithm.rb", - "bbrc.rb", + #"bbrc.rb", "model.rb", "similarity.rb", "classification.rb", -- cgit v1.2.3 From 0c5d2e678908a2d4aea43efbedbedc2c0439be30 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 14 Mar 2016 15:25:50 +0100 Subject: descriptor tests --- lib/lazar.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 63257ca..0125d27 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -24,7 +24,6 @@ Mongoid.load_configuration({ } }) Mongoid.raise_not_found_error = false # return nil if no document is found -#$mongo = Mongoid.default_client $mongo = Mongo::Client.new("mongodb://127.0.0.1:27017/#{ENV['LAZAR_ENV']}") $gridfs = $mongo.database.fs @@ -57,9 +56,6 @@ suppressPackageStartupMessages({ " # Require sub-Repositories -#require_relative '../libfminer/libbbrc/bbrc' # include before openbabel -#require_relative '../libfminer/liblast/last' # -#require_relative '../last-utils/lu.rb' require_relative '../openbabel/lib/openbabel' # Fminer environment variables @@ -79,14 +75,10 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveO "opentox.rb", "feature.rb", "physchem.rb", - "descriptor.rb", "compound.rb", "dataset.rb", - "descriptor.rb", "algorithm.rb", - #"bbrc.rb", "model.rb", - "similarity.rb", "classification.rb", "regression.rb", "validation.rb", -- cgit v1.2.3 From abc3526e318a2bfa24dfe033d8879e7657c2ae5c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 15 Mar 2016 18:46:34 +0100 Subject: single tests pass --- lib/lazar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 0125d27..b4293e9 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -86,4 +86,4 @@ CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveO "leave-one-out-validation.rb", "experiment.rb", ].each{ |f| require_relative f } - +OpenTox::PhysChem.descriptors # load descriptor features -- cgit v1.2.3 From 90fbe8b3ef3fa05aa308e6650e11d690bb89b200 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 24 Mar 2016 13:43:27 +0100 Subject: local R package installation --- lib/lazar.rb | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index b4293e9..22dfd2b 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -40,17 +40,18 @@ when "development" end # R setup +rlib = File.expand_path(File.join(File.dirname(__FILE__),"..","R")) # should work on POSIX including os x # http://stackoverflow.com/questions/19619582/number-of-processors-cores-in-command-line NR_CORES = `getconf _NPROCESSORS_ONLN`.to_i R = Rserve::Connection.new R.eval " suppressPackageStartupMessages({ - library(ggplot2) - library(grid) - library(gridExtra) - library(caret) - library(doMC) + library(ggplot2,lib=\"#{rlib}\") + library(grid,lib=\"#{rlib}\") + library(gridExtra,lib=\"#{rlib}\") + library(caret,lib=\"#{rlib}\") + library(doMC,lib=\"#{rlib}\") registerDoMC(#{NR_CORES}) }) " @@ -58,13 +59,6 @@ suppressPackageStartupMessages({ # Require sub-Repositories require_relative '../openbabel/lib/openbabel' -# Fminer environment variables -ENV['FMINER_SMARTS'] = 'true' -ENV['FMINER_NO_AROMATIC'] = 'true' -ENV['FMINER_PVALUES'] = 'true' -ENV['FMINER_SILENT'] = 'true' -ENV['FMINER_NR_HITS'] = 'true' - # OpenTox classes and includes CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveOneOutValidation","RepeatedCrossValidation","Experiment"]# Algorithm and Models are modules -- cgit v1.2.3 From 6190fb849a6010ab3ab3234ad19baf8e7e165828 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 30 Mar 2016 13:43:15 +0200 Subject: ensure pls package is loaded --- lib/lazar.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 22dfd2b..a0846e9 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -50,6 +50,7 @@ suppressPackageStartupMessages({ library(ggplot2,lib=\"#{rlib}\") library(grid,lib=\"#{rlib}\") library(gridExtra,lib=\"#{rlib}\") + library(pls,lib=\"#{rlib}\") library(caret,lib=\"#{rlib}\") library(doMC,lib=\"#{rlib}\") registerDoMC(#{NR_CORES}) -- cgit v1.2.3 From 76d30230f589026d7019ddbfa8ae0a511e171e27 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 31 Mar 2016 10:04:42 +0200 Subject: lazar gem, version bumped to 0.9 --- lib/lazar.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index a0846e9..4b824dd 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -8,6 +8,7 @@ require 'mongoid' require 'rserve' require "nokogiri" require "base64" +require 'openbabel' # Environment setup ENV["LAZAR_ENV"] ||= "production" @@ -57,9 +58,6 @@ suppressPackageStartupMessages({ }) " -# Require sub-Repositories -require_relative '../openbabel/lib/openbabel' - # OpenTox classes and includes CLASSES = ["Feature","Compound","Dataset","Validation","CrossValidation","LeaveOneOutValidation","RepeatedCrossValidation","Experiment"]# Algorithm and Models are modules -- cgit v1.2.3 From cae9c539e334eeb1cb13f43979b6bb410500791d Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 4 Apr 2016 13:59:33 +0200 Subject: load local r packages --- lib/lazar.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 4b824dd..84c1a6e 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -48,6 +48,9 @@ NR_CORES = `getconf _NPROCESSORS_ONLN`.to_i R = Rserve::Connection.new R.eval " suppressPackageStartupMessages({ + library(Rserve,lib=\"#{rlib}\") + library(iterators,lib=\"#{rlib}\") + library(foreach,lib=\"#{rlib}\") library(ggplot2,lib=\"#{rlib}\") library(grid,lib=\"#{rlib}\") library(gridExtra,lib=\"#{rlib}\") -- cgit v1.2.3 From 83072cc3c5251a3eb4496fa68b413540ea9409fd Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 4 Apr 2016 15:42:30 +0200 Subject: last commit doesnt work this way --- lib/lazar.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/lazar.rb') diff --git a/lib/lazar.rb b/lib/lazar.rb index 84c1a6e..a28ba3a 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -48,7 +48,6 @@ NR_CORES = `getconf _NPROCESSORS_ONLN`.to_i R = Rserve::Connection.new R.eval " suppressPackageStartupMessages({ - library(Rserve,lib=\"#{rlib}\") library(iterators,lib=\"#{rlib}\") library(foreach,lib=\"#{rlib}\") library(ggplot2,lib=\"#{rlib}\") -- cgit v1.2.3