From ef7dcd12e5cffc5d0a38d61e4825cc2d8db959c4 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Thu, 13 Mar 2014 17:05:48 -0400 Subject: refactor binding layout, add comments --- src/score_mers.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/score_mers.py') diff --git a/src/score_mers.py b/src/score_mers.py index bf7aa16..8cbf064 100755 --- a/src/score_mers.py +++ b/src/score_mers.py @@ -43,9 +43,20 @@ max_mer_distance = int(os.environ.get("max_mer_distance", 5000)); max_consecutive_binding = int(os.environ.get("max_consecutive_binding", 4)); -binding = { 'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C', '_': False } - def get_max_consecutive_binding(mer1, mer2): + ''' + Return the maximum number of consecutively binding mers + when comparing two different mers, using the reverse compliment. + ''' + + binding = { 'A': 'T', + 'T': 'A', + 'C': 'G', + 'G': 'C', + '_': False + } + + # Swap variables if the second is longer than the first if len(mer2) > len(mer1): mer1, mer2 = mer2, mer1 -- cgit v1.2.3