Created
October 29, 2015 09:40
-
-
Save kdm9/19e3df51c6e4f3af642a to your computer and use it in GitHub Desktop.
This file contains 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
from frisk.kmerhash import * | |
import screed | |
r = screed.open('/home/kevin/ws/seqs/TAIR10_gen/TAIR10.fasta.gz') | |
for x in r: | |
seq = x.sequence[:100000] | |
break | |
winsz = 3000 | |
ivs = [] | |
for start in range(0, len(seq) - winsz + 1, winsz/2): | |
winseq = seq[start:start+winsz] | |
kv = build_kmer_vec(1, 8) | |
hash_seq(str(winseq), kv) | |
kf = kmer_freqs(kv) | |
iv = ivom(kf) | |
ivs.append(iv.sum() / len(iv)) | |
if start % 10 == 0: | |
print start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment