X-Git-Url: https://git.donarmstrong.com/?p=biopieces.git;a=blobdiff_plain;f=bp_bin%2Fslice_align;h=f63ac7e203c2e41c40c15d294fd11798e760b5d5;hp=586c2701570dfbd46d546a3cdf0e3bc012f731e5;hb=308da19f6dfbbf50bbce5aa87b32e2f269650c80;hpb=5526cf56fc20602b9be197db8b1a9a44502791ab diff --git a/bp_bin/slice_align b/bp_bin/slice_align index 586c270..f63ac7e 100755 --- a/bp_bin/slice_align +++ b/bp_bin/slice_align @@ -24,7 +24,7 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -# Join sequences in the stream. +# Slice aligned sequences in the stream to obtain subsequences. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @@ -60,13 +60,17 @@ else 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],