#NEWLINE# def countUniqueKmers( self , seq , k_length ) : #NEWLINE# #INDENT# ' shred sequence and count unique and non-unique k-mers' #NEWLINE# unique_kmers = 0 #NEWLINE# non_unique_kmers = 0 #NEWLINE# kmers = set ( [ seq [ i : ( i + k_length ) ] for i in range ( 0 , ( len ( seq ) - k_length ) ) ] ) #NEWLINE# for kmer in kmers : #NEWLINE# #INDENT# if ( self . kmer2entry [ kmer ] == 1 ) : #NEWLINE# #INDENT# unique_kmers += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# non_unique_kmers += 1 #NEWLINE# #UNINDENT# #UNINDENT# return ( unique_kmers , non_unique_kmers )