diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-05-04 19:24:42 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-05-04 19:24:42 +0200 |
commit | 05386e748270c337c66f6f379317ea4b25905236 (patch) | |
tree | 4b62f1c9449dded9cd7670715a5735f5bc93dd2e /scripts/mmol2-log10.rb | |
parent | 79238bddb59607aa9f759caa9e3c8db176709703 (diff) |
first reasonable results for nanoparticle crossvalidation
Diffstat (limited to 'scripts/mmol2-log10.rb')
-rw-r--r-- | scripts/mmol2-log10.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/mmol2-log10.rb b/scripts/mmol2-log10.rb new file mode 100644 index 0000000..0c99a0b --- /dev/null +++ b/scripts/mmol2-log10.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +require_relative '../lib/lazar' +include OpenTox +newfile = ARGV[0].sub(/.csv/,"_log10.csv") +p newfile +CSV.open(newfile, "wb") do |csv| + CSV.read(ARGV[0]).each do |line| + smi,mmol = line + if mmol.numeric? + c = Compound.from_smiles smi + mmol = -Math.log10(mmol.to_f) + csv << [smi, mmol] + else + csv << [smi, "-log10(#{mmol})"] + end + end +end |