diff options
author | Christoph Helma <helma@in-silico.ch> | 2020-12-28 18:08:58 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2020-12-28 18:08:58 +0100 |
commit | 158e9a7ecbc467c3db77c354f203b1176b0fc3f2 (patch) | |
tree | 6bc54012c6327c740e5cc7240d476fc06607f89a /bin/batch_fingerprint_classification.rb | |
parent | 9b0a5f37bdb0a5b80ace7cff559c1817d6916b8a (diff) |
batch processing scripts addedwithout_mongodb
Diffstat (limited to 'bin/batch_fingerprint_classification.rb')
-rwxr-xr-x | bin/batch_fingerprint_classification.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/batch_fingerprint_classification.rb b/bin/batch_fingerprint_classification.rb new file mode 100755 index 0000000..318fae6 --- /dev/null +++ b/bin/batch_fingerprint_classification.rb @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby +require_relative "../lib/lazar" +model = ClassificationModel.new ARGV[0] + +File.read(ARGV[1]).each_line do |line| + if line.match(/SMILES/i) + puts "ID,SMILES,experimental,classification,probability(0),probability(1),max_similarity,nr_neighbors" + else + id,smi = line.chomp.split(",") + puts ([id] + model.predict_smiles(smi)).join(",") + end +end + |