diff options
author | Christoph Helma <helma@in-silico.ch> | 2021-03-20 00:14:10 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2021-03-20 00:14:10 +0100 |
commit | 7bbe4c444523f281d07f79aa8d0a4719668c3c80 (patch) | |
tree | a79efa1decd4284d9454200fd987015826685b6d /scripts/cv-pa-classifications.rb | |
parent | eca6889b784583bc0e9fb338d7b53d4c9b530dc4 (diff) |
manuscript update
Diffstat (limited to 'scripts/cv-pa-classifications.rb')
-rwxr-xr-x | scripts/cv-pa-classifications.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/cv-pa-classifications.rb b/scripts/cv-pa-classifications.rb new file mode 100755 index 0000000..fe64078 --- /dev/null +++ b/scripts/cv-pa-classifications.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +classifications = {} +File.readlines(ARGV[1]).each do |l| + smi,c = l.chomp.split(",") + classifications[smi] = c +end +lines = File.readlines(ARGV[2]) +lines.shift +lines.each do |l| + smi,c = l.chomp.split(",") + if c == "1" + classifications[smi] = "PA-mutagenic" + elsif c == "0" + classifications[smi] = "PA-nonmutagenic" + else + classifications[smi] = "PA-NA" + end +end +lines=File.readlines(ARGV[0]) +lines.shift +lines.each do |l| + smi,x,y = l.split(",") + smi.gsub!('"','') + classifications[smi] ? puts(classifications[smi]) : puts("NA") +end |