]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/cat_seq
added pair-end power to read_fastq
[biopieces.git] / bp_bin / cat_seq
index 060b7d567d0b81eaa881ec52032592a968c7e02e..67cf39753c6dde527a40f1cb86621d374c824b97 100755 (executable)
 
 require 'maasha/biopieces'
 
-options = Biopieces.options_parse(ARGV)
+casts = []
+casts << {:long=>'seq_name',  :short=>'s', :type=>'string', :mandatory=>true,  :default=>"cat_seq", :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'no_stream', :short=>'x', :type=>'flag',   :mandatory=>false, :default=>nil,       :allowed=>nil, :disallowed=>nil}
+
+options = Biopieces.options_parse(ARGV, casts)
 
 seq = ""
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
-    seq << record[:SEQ] if record.has_key? :SEQ
-    output.puts record
+    seq << record[:SEQ] if record[:SEQ]
+    output.puts record unless options[:no_stream]
   end
 
   new_record            = {}
+  new_record[:SEQ_NAME] = options[:seq_name]
   new_record[:SEQ]      = seq
   new_record[:SEQ_LEN]  = seq.length
   new_record[:REC_TYPE] = "CAT"