# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-# Join sequences in the stream.
+# Slice aligned sequences in the stream to obtain subsequences.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
raise "either --beg/--end or --forward/--reverse|--reverse_rc must be specified"
end
+if options[:template_file]
+ template = Fasta.open(options[:template_file]).get_entry
+end
+
Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
input.each_record do |record|
if record[:SEQ]
entry = Seq.new(seq: record[:SEQ])
unless options[:beg]
- compact = Seq.new(seq: entry.seq.dup)
+ compact = template ? template : Seq.new(seq: entry.seq.dup)
compact.seq.delete! "-.~"
fmatch = compact.patmatch(options[:forward],