Created
January 22, 2016 09:08
-
-
Save timeu/3ffb904a6e6954244d4d to your computer and use it in GitHub Desktop.
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
h5 = h5py.File('my_file','r') | |
snps = h5['snps'] | |
start = 0 | |
end = END_OF_CHROMOSOME | |
# how many SNPs you want | |
chunk_size = 1000 | |
for i in xrange(start,end,chunk_size): | |
stop_ix = min(i+chunk_size,end) | |
# this will return an array of 1000 snps | |
chunked_snps = snps[i:stop_ix] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment