summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2013-03-26 11:26:35 +0100
committerChristoph Helma <helma@in-silico.ch>2013-03-26 11:26:35 +0100
commitbcd017268c5b3303c4f5540ef0a1b41cebf97522 (patch)
treebb00665c9a74a02c5349999f1f0899dc17d58833
parent1d70fd3f71f8df9d01a9833f2fb8383b3ef3b6f3 (diff)
warnings for empty csv compounds fixed
-rw-r--r--helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/helper.rb b/helper.rb
index c405963..ff47636 100644
--- a/helper.rb
+++ b/helper.rb
@@ -103,6 +103,7 @@ module OpenTox
compound_uris = []
table.each_with_index do |values,j|
compound = values.shift
+ puts "'#{compound}'"
begin
case compound_format
when /URI|URL/i
@@ -111,6 +112,9 @@ module OpenTox
compound_uri = OpenTox::Compound.from_smiles(compound).uri
when /InChI/i
compound_uri = OpenTox::Compound.from_inchi(compound).uri
+ when ""
+ @warnings << "Cannot parse compound '#{compound}' at position #{j+2}, all entries are ignored." # be careful with double quotes in literals! \C in smiles is an illegal Turtle string
+ next
end
rescue
@warnings << "Cannot parse compound '#{compound}' at position #{j+2}, all entries are ignored." # be careful with double quotes in literals! \C in smiles is an illegal Turtle string