Skip to content

Instantly share code, notes, and snippets.

@wckdouglas
Last active May 4, 2017 20:54
Show Gist options
  • Save wckdouglas/262d29a1204e2a83731abc528be7c077 to your computer and use it in GitHub Desktop.
Save wckdouglas/262d29a1204e2a83731abc528be7c077 to your computer and use it in GitHub Desktop.
Generator function for segmenting chromosome regions
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