diff options
author | Christoph Helma <helma@in-silico.ch> | 2020-10-13 11:25:51 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2020-10-13 11:25:51 +0200 |
commit | 59509099257225b068a13626d3a42eac2f4244ab (patch) | |
tree | fd1ad3fbbaa96d5926e1bc2ef8a15146f7660b56 /bin/export-sdf.rb | |
parent | 791398c12af4f8290095425dac87e3c852905ab6 (diff) |
mutagenicity downloads moved, PaDEL metadata
Diffstat (limited to 'bin/export-sdf.rb')
-rwxr-xr-x | bin/export-sdf.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/export-sdf.rb b/bin/export-sdf.rb new file mode 100755 index 0000000..4f4a9ff --- /dev/null +++ b/bin/export-sdf.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +require_relative "../lib/lazar.rb" + +dir = ARGV[0] +endpoint_name = File.read(File.join dir,"dependent_variable_name").chomp +endpoints = File.open(File.join dir,"dependent_variables").readlines.collect{|v| v.to_i} +endpoint_values = File.open(File.join dir,"dependent_variable_values").readlines.collect{|v| v.chomp} +compounds = [] + +File.open(File.join dir,"independent_variables").each_line do |l| + compounds << Compound.new(l.chomp.split(",").shift) +end +compounds.each_with_index do |compound,i| + sdf_lines = compound.sdf.sub(/\$\$\$\$\n/,"").split("\n") + sdf_lines[0] = compound.smiles + sdf = sdf_lines.join("\n") + sdf += "\n> <#{endpoint_name}>\n" + sdf += endpoint_values[endpoints[i]] + sdf += "\n" + sdf += "\n$$$$\n" + print sdf +end |