summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2016-05-08 12:22:58 +0200
committerChristoph Helma <helma@in-silico.ch>2016-05-08 12:22:58 +0200
commit06fc914653face2c58fd4e6c47161cb03e217582 (patch)
treef001a28b3970f67bf648f6d00e95791a063e7fd5 /scripts
parent110b470a69f785f195cce21df7c07efa5c9ce61b (diff)
default validations fixed
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mmol2-log10.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/mmol2-log10.rb b/scripts/mmol2-log10.rb
index 0c99a0b..f28ff8f 100755
--- a/scripts/mmol2-log10.rb
+++ b/scripts/mmol2-log10.rb
@@ -3,6 +3,7 @@ require_relative '../lib/lazar'
include OpenTox
newfile = ARGV[0].sub(/.csv/,"_log10.csv")
p newfile
+i = 1
CSV.open(newfile, "wb") do |csv|
CSV.read(ARGV[0]).each do |line|
smi,mmol = line
@@ -11,7 +12,10 @@ CSV.open(newfile, "wb") do |csv|
mmol = -Math.log10(mmol.to_f)
csv << [smi, mmol]
else
- csv << [smi, "-log10(#{mmol})"]
+ #csv << [smi, "-log10(#{mmol})"]
+ p "Line #{i}: '#{mmol}' is not a numeric value."
+ csv << [smi, ""]
end
+ i += 1
end
end