diff options
author | gebele <gebele@in-silico.ch> | 2016-11-24 07:16:54 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2016-11-24 07:16:54 +0000 |
commit | e111369ce5564f159b3f5f85c92afdd22352eaa1 (patch) | |
tree | a483d6787ed9be3b541a2ef0e6f3e49f0179308c /scripts/mmol2-log10.rb | |
parent | 0ddd04c32280e6fd166a52fa6da653df24aabf99 (diff) |
always convert to SMILESv9-nestec
Diffstat (limited to 'scripts/mmol2-log10.rb')
-rwxr-xr-x | scripts/mmol2-log10.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/mmol2-log10.rb b/scripts/mmol2-log10.rb index 188d8cb..ff4af2a 100755 --- a/scripts/mmol2-log10.rb +++ b/scripts/mmol2-log10.rb @@ -9,16 +9,17 @@ CSV.open(newfile, "wb") do |csv| CSV.read(ARGV[0]).each do |line| type,mmol = line if i == 1 - csv << [type, "-log10(#{mmol})"] @type = type + csv << ["SMILES", "-log10(#{mmol})"] else if mmol.numeric? if @type =~ /smiles/i c = Compound.from_smiles type elsif @type =~ /inchi/i c = Compound.from_inchi type + type = c.smiles else - p "Unknown type '#{@type}' at line #{i}." + p "Unknown type '#{type}' at line 1." end mmol = -Math.log10(mmol.to_f) csv << [type, mmol] |