X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fwrite_fasta_files;h=36011ed411fad74d891f2f12f7108bfc02eb91a2;hb=32cc7b1e1358cade767a865dd0db99470b4df2ba;hp=da4a1c6d347cb22210c1d504327429a7813791fb;hpb=3aca8fa2ec198eaed6f21f9d85b11a3ddf9c0c14;p=biopieces.git diff --git a/bp_bin/write_fasta_files b/bp_bin/write_fasta_files index da4a1c6..36011ed 100755 --- a/bp_bin/write_fasta_files +++ b/bp_bin/write_fasta_files @@ -46,7 +46,9 @@ fh_hash = {} Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| input.each_record do |record| if record[:SEQ_NAME] and record[:SEQ] and record[key] - if fh_hash.has_key? record[key].to_sym + seq = Seq.new_bp(record) + + if fh_hash[record[key].to_sym] fasta_io = fh_hash[record[key].to_sym] else fasta_file = File.join(options[:dir], record[key] + ".fasta") @@ -54,7 +56,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| fh_hash[record[key].to_sym] = fasta_io end - fasta_io.puts record + fasta_io.puts seq.to_fasta end output.puts record unless options[:no_stream]