Last active
May 4, 2017 20:54
-
-
Save wckdouglas/262d29a1204e2a83731abc528be7c077 to your computer and use it in GitHub Desktop.
Generator function for segmenting chromosome regions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_regions(chromosome_length, how_many_bases_to_look_at): | |
start = 0 | |
end = start + leap | |
while end < chromosome_length: | |
yield (start, end) | |
start = end | |
end = end + how_man_bases_to_look_at | |
yield (start, chromosome_length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment