From e111369ce5564f159b3f5f85c92afdd22352eaa1 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 24 Nov 2016 07:16:54 +0000 Subject: always convert to SMILES --- scripts/mmol2-log10.rb | 5 +++-- 1 file 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] -- cgit v1.2.3