diff options
author | mguetlein <martin.guetlein@gmail.com> | 2014-10-10 12:33:25 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2014-10-10 12:33:25 +0200 |
commit | 30e213383d432536c252dd237cdeab96973411e6 (patch) | |
tree | 858214f37562ccd62efb02380fbc1e73ce62dcf3 | |
parent | cbea6288f1fb52fc57aad8119884345a55b6e222 (diff) |
fix inchi csv upload
-rw-r--r-- | helper.rb | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -113,25 +113,24 @@ module OpenTox when /SMILES/i c = OpenTox::Compound.from_smiles(compound) if c.inchi.empty? - @warnings << "Cannot parse compound '#{compound}' at position #{j+2}, all entries are ignored." + @warnings << "Cannot parse #{compound_format} compound '#{compound}' at position #{j+2}, all entries are ignored." next else compound_uri = c.uri end when /InChI/i - compound = OpenTox::Compound.from_inchi(compound) + c = OpenTox::Compound.from_inchi(compound) if c.inchi.empty? - @warnings << "Cannot parse compound '#{compound}' at position #{j+2}, all entries are ignored." + @warnings << "Cannot parse #{compound_format} compound '#{compound}' at position #{j+2}, all entries are ignored." next else compound_uri = c.uri end - 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 + else + raise "wrong compound format" #should be checked above 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 + @warnings << "Cannot parse #{compound_format} 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 |