diff options
-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) |