From a29eb3e38414cd252850c9c4fb356f8b2bef6fb4 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 12 Feb 2021 19:54:07 +0100 Subject: model.rb refactored, mp2d models updated --- .../mutagenicity/download/efsa_classification.rb | 29 ---------------------- 1 file changed, 29 deletions(-) delete mode 100755 models/mutagenicity/download/efsa_classification.rb (limited to 'models/mutagenicity/download/efsa_classification.rb') diff --git a/models/mutagenicity/download/efsa_classification.rb b/models/mutagenicity/download/efsa_classification.rb deleted file mode 100755 index 1e4dace..0000000 --- a/models/mutagenicity/download/efsa_classification.rb +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env ruby -require 'csv' -require_relative "../../../lib/compound.rb" - -# convert EFSA data to mutagenicity classifications -i = 0 -db = {} -CSV.foreach(ARGV[0], :encoding => "UTF-8", :col_sep => "\t", :liberal_parsing => true) do |row| - if i > 0 and row[11] and !row[11].empty? and row[24].match(/Salmonella/i) and ( row[25].match("TA 98") or row[25].match("TA 100") ) and row[33] - begin - c = Compound.from_smiles(row[11].gsub('"','')).smiles - rescue - c = Compound.from_inchi(row[12]).smiles # some smiles (row[11]) contain non-parseable characters - end - db[c] ||= {} - db[c][:id] ||= row[2] - if row[33].match(/Positiv/i) - db[c][:value] = "mutagenic" # at least one positive result in TA 98 or TA 100 - elsif row[33].match(/Negativ/i) - db[c][:value] ||= "non-mutagenic" - end - end - i += 1 -end - -puts "ID,SMILES,Mutagenicity" -db.each do |s,v| - puts [v[:id],s,v[:value]].join "," -end -- cgit v1.2.3