<s> import sys <EOL> from itertools import imap <EOL> from seqio import iteratorFromExtension <EOL> from nucio import fileIterator <EOL> if not len ( sys . argv ) == <NUM_LIT:3> : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> fn = sys . argv [ <NUM_LIT:2> ] <EOL> ksize = int ( sys . argv [ <NUM_LIT:1> ] ) <EOL> for record in fileIterator ( fn , iteratorFromExtension ( fn ) ) : <EOL> seq = record . seq <EOL> starts = range ( len ( seq ) - ksize + <NUM_LIT:1> ) <EOL> kmers = imap ( lambda start : seq [ start : start + ksize ] , starts ) <EOL> for kmer in kmers : <EOL> print kmer </s>
