diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-06-27 15:07:12 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-06-27 15:07:12 +0200 |
commit | 68e670a006ec995212b21a22bc7936e43f16f205 (patch) | |
tree | 7e259a0fa07157439a46e6e009737832a6f8e80d | |
parent | 18d44225d0f5258348db3278a87628f74bd36744 (diff) |
Minor fixed
-rw-r--r-- | fminer.rb | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -413,8 +413,8 @@ post '/fminer/last/?' do lu = LU.new # AM LAST: uses last-utils here dom=lu.read(xml) # AM LAST: parse GraphML smarts=lu.smarts_rb(dom,'nls') # AM LAST: converts patterns to LAST-SMARTS using msa variant (see last-pm.maunz.de) - params[:nr_hits].nil? ? nr_hits=true : nr_hits=false - matches,counts=lu.match_rb(smi,smarts,nr_hits) # AM LAST: creates instantiations + params[:nr_hits].nil? ? hit_count=false: hit_count=true + matches, counts = lu.match_rb(smi,smarts,hit_count) # AM LAST: creates instantiations matches.each do |smarts, ids| feat_hash = Hash[*(all_activities.select { |k,v| ids.include?(k) }.flatten)] # AM LAST: get activities of feature occurrences; see http://www.softiesonrails.com/2007/9/18/ruby-201-weird-hash-syntax @@ -441,10 +441,10 @@ post '/fminer/last/?' do } feature_dataset.add_feature feature_uri, metadata end - if params[:nr_hits] + if !hit_count ids.each { |id| feature_dataset.add(compounds[id], feature_uri, true)} else - ids.each_with_index { |id,i| feature_dataset.add(compounds[id], feature_uri, counts[id][i])} + ids.each_with_index { |id,i| feature_dataset.add(compounds[id], feature_uri, counts[smarts][i])} end end feature_dataset.save(@subjectid) |