diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-13 17:05:48 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-13 17:05:48 -0400 |
commit | ef7dcd12e5cffc5d0a38d61e4825cc2d8db959c4 (patch) | |
tree | 7cc8fcbd2d5e90e4d4abecc2eb58c6e0b62d2a0e /src | |
parent | a74440177cefe2d4d5f65cf1e9e06cb8b6bbc8bf (diff) |
refactor binding layout, add comments
Diffstat (limited to 'src')
-rwxr-xr-x | src/score_mers.py | 15 |
1 files changed, 13 insertions, 2 deletions
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 |