From: martinahansen Date: Wed, 30 Oct 2013 21:37:08 +0000 (+0000) Subject: fixed bug in pair assembler X-Git-Url: https://git.donarmstrong.com/?p=biopieces.git;a=commitdiff_plain;h=f2b18307294690cf1376b51357469910b509e695 fixed bug in pair assembler git-svn-id: http://biopieces.googlecode.com/svn/trunk@2253 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/seq/assemble.rb b/code_ruby/lib/maasha/seq/assemble.rb index de14b64..c6f528b 100644 --- a/code_ruby/lib/maasha/seq/assemble.rb +++ b/code_ruby/lib/maasha/seq/assemble.rb @@ -42,18 +42,23 @@ class Assemble @options = options @options[:mismatches_max] ||= 0 @options[:overlap_min] ||= 1 - @options[:overlap_max] ||= entry1.length - @options[:overlap_max] = [@options[:overlap_max], entry1.length, entry2.length].min end # Method to locate overlapping matches between two sequences. def match - overlap = @options[:overlap_max] + if @options[:overlap_max] + overlap = [@options[:overlap_max], @entry1.length, @entry2.length].min + else + overlap = [@entry1.length, @entry2.length].min + end while overlap >= @options[:overlap_min] mismatches_max = (overlap * @options[:mismatches_max] * 0.01).round + + offset1 = @entry2.length - overlap + offset2 = 0 - if match_C(@entry1.seq, @entry2.seq, @entry1.length - overlap, 0, overlap, mismatches_max) + if match_C(@entry1.seq, @entry2.seq, offset1, offset2, overlap, mismatches_max) entry_left = @entry1[0 ... @entry1.length - overlap] entry_right = @entry2[overlap .. -1]