X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fuclust_seq;h=5b162c414c2cdb249b4c2a518d1ca61062205e41;hb=5de6112b70b59420b245ce636a8b2e3c90acbe00;hp=f155bdf53f06328bfe5d0c62232a667d3ee45d2c;hpb=2949257922cc90a28af23386a72dbad8157e4fa8;p=biopieces.git diff --git a/bp_bin/uclust_seq b/bp_bin/uclust_seq index f155bdf..5b162c4 100755 --- a/bp_bin/uclust_seq +++ b/bp_bin/uclust_seq @@ -33,9 +33,10 @@ require 'maasha/fasta' require 'maasha/usearch' casts = [] -casts << {:long=>'no_sort', :short=>'n', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'comp', :short=>'c', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'identity', :short=>'i', :type=>'float', :mandatory=>true, :default=>0.9, :allowed=>nil, :disallowed=>nil} +casts << {long: 'no_sort', short: 'n', type: 'flag', mandatory: false, default: nil, allowed: nil, disallowed: nil} +casts << {long: 'comp', short: 'c', type: 'flag', mandatory: false, default: nil, allowed: nil, disallowed: nil} +casts << {long: 'identity', short: 'i', type: 'float', mandatory: true, default: 0.9, allowed: nil, disallowed: nil} +casts << {long: 'cpus', short: 'C', type: 'uint', mandatory: false, default: 1, allowed: nil, disallowed: "0"} options = Biopieces.options_parse(ARGV, casts) @@ -70,8 +71,8 @@ end Biopieces.open(file_records, options[:stream_out]) do |input, output| input.each_record do |record| if record[:SEQ_NAME] and record[:SEQ] - if hash[record[:SEQ_NAME].to_sym] - us = hash[record[:SEQ_NAME].to_sym] + seq_name = record[:SEQ_NAME].split(/\s+/).first.to_sym + if us = hash[seq_name] record[:CLUSTER] = us[:CLUSTER].to_i record[:IDENT] = us[:IDENT].to_i record[:IDENT] = '*' if us[:TYPE] == 'S'