From 05386e748270c337c66f6f379317ea4b25905236 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 4 May 2016 19:24:42 +0200 Subject: first reasonable results for nanoparticle crossvalidation --- scripts/mmol2-log10.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/mmol2-log10.rb (limited to 'scripts/mmol2-log10.rb') 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 -- cgit v1.2.3