diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-05-31 23:16:41 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-05-31 23:16:41 +0200 |
commit | d69214b494706fb53f74bb17ddde28ad831cd460 (patch) | |
tree | 63c9caec5defbb908ac99fba15dd9ab2183db2f8 | |
parent | 5aaefadb8d5f21195fafe4a39de254f964eaf61f (diff) |
fix get compound from smiles (directly instead of via uri)
-rw-r--r-- | fminer.rb | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -114,6 +114,8 @@ post '/fminer/bbrc/?' do if prediction_feature.feature_type == "regression" @@bbrc.SetRegression(true) # AM: DO NOT MOVE DOWN! Must happen before the other Set... operations! else + raise "no accept values for dataset '"+training_dataset.uri.to_s+"' and feature '"+prediction_feature.uri.to_s+ + "'" unless training_dataset.accept_values(prediction_feature.uri) @training_classes = training_dataset.accept_values(prediction_feature.uri).sort end @@bbrc.SetMinfreq(minfreq) @@ -142,16 +144,17 @@ post '/fminer/bbrc/?' do training_dataset.data_entries.each do |compound,entry| begin - smiles = OpenTox::Compound.new(compound.to_s).to_smiles + # fix: ambit does not support inchi, directly request smiles + smiles = OpenTox::Compound.smiles(compound.to_s) rescue LOGGER.warn "No resource for #{compound.to_s}" next end if smiles == '' or smiles.nil? - LOGGER.warn "Cannot find smiles for #{compound.to_s}." + LOGGER.warn "Cannot find smiles for #{compound.to_s}" next end - + # AM: take log if appropriate take_logs=true entry.each do |feature,values| |