summaryrefslogtreecommitdiff
path: root/bin/batch_padel_classification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bin/batch_padel_classification.rb')
-rwxr-xr-xbin/batch_padel_classification.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/batch_padel_classification.rb b/bin/batch_padel_classification.rb
new file mode 100755
index 0000000..6d05907
--- /dev/null
+++ b/bin/batch_padel_classification.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+require_relative "../lib/lazar"
+model = ClassificationModel.new ARGV[0]
+model.predict_file ARGV[1]
+=begin
+File.read(ARGV[1]).each_line do |line|
+ if line.match(/Name/i)
+ file_descriptors = line.chomp.split(";")
+ model_descriptors = File.read(File.join(ARGV[0],"independent_variable_names")).chomp.split(",").collect{|d| d.gsub('"','')}
+ common_descriptors = model_descriptors & file_descriptors
+ puts "ID,SMILES,experimental,classification,probability(0),probability(1),max_similarity,nr_neighbors"
+ else
+ descriptor_values = []
+ line.chomp.split(",")
+ descriptor_values.shift
+ puts ([id] + model.predict_smiles(smi)).join(",")
+ end
+end
+
+=end