From 284537ed5866cce38df5c0d2ac95043b7ea475d1 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 13 Oct 2011 12:32:53 +0000 Subject: [PATCH] fixed fastq issue git-svn-id: http://biopieces.googlecode.com/svn/trunk@1565 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/write_fastq_files | 4 +++- code_ruby/lib/maasha/fastq.rb | 10 ---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/bp_bin/write_fastq_files b/bp_bin/write_fastq_files index 91ba26e..eab5a87 100755 --- a/bp_bin/write_fastq_files +++ b/bp_bin/write_fastq_files @@ -46,6 +46,8 @@ 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[:SCORES] and record[key] + seq = Seq.new_bp(record) + if fh_hash.has_key? record[key].to_sym fastq_io = fh_hash[record[key].to_sym] else @@ -54,7 +56,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| fh_hash[record[key].to_sym] = fastq_io end - fastq_io.puts record + fastq_io.puts seq.to_fastq end output.puts record unless options[:no_stream] diff --git a/code_ruby/lib/maasha/fastq.rb b/code_ruby/lib/maasha/fastq.rb index 37d0bbb..a6b3610 100644 --- a/code_ruby/lib/maasha/fastq.rb +++ b/code_ruby/lib/maasha/fastq.rb @@ -49,16 +49,6 @@ class Fastq < Filesys nil end end - - # TODO - this should be some custom to_s method instead. - def puts(record) - if record[:SEQ_NAME] and record[:SEQ] and record[:SCORES] - @io.print "@#{record[:SEQ_NAME]}\n" - @io.print "#{record[:SEQ]}\n" - @io.print "+\n" - @io.print "#{record[:SCORES]}\n" - end - end end -- 2.39.2