summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/batch_fingerprints.rb10
-rwxr-xr-xbin/classification-summary.rb (renamed from bin/classification_summary.rb)0
-rwxr-xr-xbin/classification_crossvalidation.rb4
-rwxr-xr-xbin/crossvalidation.rb15
-rwxr-xr-xbin/fingerprints.rb6
5 files changed, 21 insertions, 14 deletions
diff --git a/bin/batch_fingerprints.rb b/bin/batch_fingerprints.rb
deleted file mode 100755
index cd46ee2..0000000
--- a/bin/batch_fingerprints.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-require_relative "../lib/lazar"
-File.read(ARGV[0]).each_line do |line|
- unless line.match(/SMILES/i)
- id,smi = line.chomp.split(",")
- puts smi
- c = Compound.from_smiles(smi)
- puts ([c.smiles] + c.fingerprint).join(",")
- end
-end
diff --git a/bin/classification_summary.rb b/bin/classification-summary.rb
index a3e4172..a3e4172 100755
--- a/bin/classification_summary.rb
+++ b/bin/classification-summary.rb
diff --git a/bin/classification_crossvalidation.rb b/bin/classification_crossvalidation.rb
deleted file mode 100755
index 4bd6bc6..0000000
--- a/bin/classification_crossvalidation.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-require_relative "../lib/lazar"
-model = ClassificationModel.new ARGV[0]
-model.crossvalidation
diff --git a/bin/crossvalidation.rb b/bin/crossvalidation.rb
new file mode 100755
index 0000000..b7cfdd7
--- /dev/null
+++ b/bin/crossvalidation.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+require_relative "../lib/lazar"
+dir = ARGV[0]
+dependent_variable_type = File.read(File.join(dir, "dependent-variable-type")).chomp
+independent_variable_type = File.read(File.join(dir, "independent-variable-type")).chomp
+if dependent_variable_type == "binary" and independent_variable_type == "binary"
+ model = TanimotoClassificationModel.new dir
+elsif dependent_variable_type == "binary" and independent_variable_type == "numeric"
+ model = CosineClassificationModel.new dir
+elsif dependent_variable_type == "numeric" and independent_variable_type == "binary"
+ model = TanimotoRegressionModel.new dir
+elsif dependent_variable_type == "numeric" and independent_variable_type == "numeric"
+ model = CosineRegressionModel.new dir
+end
+model.crossvalidation
diff --git a/bin/fingerprints.rb b/bin/fingerprints.rb
new file mode 100755
index 0000000..923be8d
--- /dev/null
+++ b/bin/fingerprints.rb
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+require_relative "../lib/lazar"
+File.read(ARGV[0]).each_line do |smi|
+ c = Compound.from_smiles(smi.chomp)
+ puts c.fingerprint.join(",")
+end