X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fassemble_pairs;h=df1fd0320a94d218e187067e4af03f5ba9436849;hb=5526cf56fc20602b9be197db8b1a9a44502791ab;hp=a101f3e16d0b0f09aa2f9dd9380c44bb1ef46231;hpb=48bea5c28b89dc5586d0bddb338ccd6ba23aa1f9;p=biopieces.git diff --git a/bp_bin/assemble_pairs b/bp_bin/assemble_pairs index a101f3e..df1fd03 100755 --- a/bp_bin/assemble_pairs +++ b/bp_bin/assemble_pairs @@ -54,9 +54,9 @@ def names_match(entry1, entry2) end casts = [] -casts << {:long=>'mismatches', :short=>'m', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'overlap_min', :short=>'o', :type=>'uint', :mandatory=>false, :default=>1, :allowed=>nil, :disallowed=>"0"} -casts << {:long=>'overlap_max', :short=>'p', :type=>'uint', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>"0"} +casts << {long: 'mismatches', short: 'm', type: 'uint', mandatory: false, default: 5, allowed: nil, disallowed: nil} +casts << {long: 'overlap_min', short: 'o', type: 'uint', mandatory: false, default: 1, allowed: nil, disallowed: "0"} +casts << {long: 'overlap_max', short: 'p', type: 'uint', mandatory: false, default: nil, allowed: nil, disallowed: "0"} options = Biopieces.options_parse(ARGV, casts) @@ -84,16 +84,17 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| merged = Assemble.pair( entry1, entry2, - mismatches_max:options[:mismatches], - overlap_min:options[:overlap_min], - overlap_max:options[:overlap_max] + mismatches_max: options[:mismatches], + overlap_min: options[:overlap_min], + overlap_max: options[:overlap_max] ) if merged new_record = merged.to_bp - if merged.seq_name =~ /overlap=(\d+)$/ - new_record[:OVERLAP_LEN] = $1 + if merged.seq_name =~ /overlap=(\d+):hamming=(\d+)$/ + new_record[:OVERLAP_LEN] = $1 + new_record[:HAMMING_DIST] = $2 end output.puts new_record