]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed fastq issue
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 13 Oct 2011 12:32:53 +0000 (12:32 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 13 Oct 2011 12:32:53 +0000 (12:32 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1565 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/write_fastq_files
code_ruby/lib/maasha/fastq.rb

index 91ba26ef04626c663758154a7cdefca2a13f67ea..eab5a870aedb7a5622efc4e68b8200e79ddf5cf9 100755 (executable)
@@ -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]
index 37d0bbbeeb1fe08aa46e192764d9f6675c6f7427..a6b3610e88c6d3abd632c47b46aa31519594591d 100644 (file)
@@ -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