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
+ 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"