From 158e9a7ecbc467c3db77c354f203b1176b0fc3f2 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 28 Dec 2020 18:08:58 +0100 Subject: batch processing scripts added --- bin/batch_padel_classification.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/batch_padel_classification.rb (limited to 'bin/batch_padel_classification.rb') 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 -- cgit v1.2.3