diff options
author | gebele <gebele@in-silico.ch> | 2017-08-14 11:19:37 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2017-08-14 11:19:37 +0000 |
commit | b2b9cc5d14d10a62025486c5b3abbbeb06bf0ec6 (patch) | |
tree | b7a53a54fab65652a2b67d2cc6946810238ec6fb /scripts/mol2mmol-log10.rb | |
parent | d04c3e870daaf6e42d08c8f8d32ab2f430e23b98 (diff) | |
parent | 6136efbd4066aeeb569424fbba619523ee038f95 (diff) |
bumped version
Diffstat (limited to 'scripts/mol2mmol-log10.rb')
-rwxr-xr-x | scripts/mol2mmol-log10.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/mol2mmol-log10.rb b/scripts/mol2mmol-log10.rb new file mode 100755 index 0000000..04f64ad --- /dev/null +++ b/scripts/mol2mmol-log10.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby +require_relative '../lib/lazar.rb' +include OpenTox +newfile = ARGV[0].sub(/.csv/,"_mmol_log10.csv") +p newfile +CSV.open(newfile, "wb") do |csv| + CSV.read(ARGV[0]).each do |line| + smi,mol = line + if mol.numeric? + c = Compound.from_smiles smi + #delog = 10**(-1*mol.to_f) #if values already -log10 but mol + mmol = mol.to_f*1000 + log = -Math.log10(mmol) + csv << [smi, log] + else + csv << [smi, mol.gsub(/mol/,'mmol')] + end + end +end |