]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed bug in orf finder
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 13 Jul 2012 14:32:53 +0000 (14:32 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 13 Jul 2012 14:32:53 +0000 (14:32 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1871 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/seq.rb

index b5f07f610d17a9ac1d3704bd8f545ac07890702f..62170b6ec4104b9165afc2037c0d736ebe17ac17 100644 (file)
@@ -520,10 +520,12 @@ class Seq
         if pos_end = self.seq.index(regex_stop, pos_beg)
           length = (pos_end - pos_beg) + 3
 
-          if size_min <= length and length <= size_max
-            subseq = self.subseq(pos_beg, length)
+          if (length % 3) == 0
+            if size_min <= length and length <= size_max
+              subseq = self.subseq(pos_beg, length)
 
-            orfs << [subseq, pos_beg, pos_end + 3]
+              orfs << [subseq, pos_beg, pos_end + 3]
+            end
           end
         end