Method: BioDSL::MergeTable#lmb

Defined in:
lib/BioDSL/commands/merge_table.rb

#lmbProc

Return command lambda for merge_table.

Returns:

  • (Proc)

    Command lambda.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/BioDSL/commands/merge_table.rb', line 131

def lmb
  lambda do |input, output, status|
    status_init(status, STATS)

    parse_input_tables

    input.each do |record|
      @status[:records_in] += 1

      if record[@key] && @table[record[@key]]
        @status[:merged] += 1
        record = record.merge(@table[record[@key]])
      else
        @status[:non_merged] += 1
      end

      output << record
      @status[:records_out] += 1
    end

    @status[:rows_total] = @status[:rows_matched] + @status[:rows_unmatched]
  end
end