From a3abc30f96727d50fe510b494c6b715f2307c765 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 4 Feb 2014 13:22:51 -0500 Subject: max_consecutive speed up --- src/filter_max_consecutive_binding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/filter_max_consecutive_binding.py') diff --git a/src/filter_max_consecutive_binding.py b/src/filter_max_consecutive_binding.py index 9054dac..ad798e2 100755 --- a/src/filter_max_consecutive_binding.py +++ b/src/filter_max_consecutive_binding.py @@ -20,12 +20,12 @@ def max_consecutive_binding(mer1, mer2): consecutive = 0 for x in range(len(mer2)): if binding[mer1[offset+x]] == mer2[x]: - consecutive = consecutive + 1 + consecutive += 1 + if consecutive > max_bind: + max_bind = consecutive else: consecutive = 0 - max_bind = max(consecutive,max_bind) - return max_bind def test(): -- cgit v1.2.3