예제 #1
0
 def count(self, kmer):
     kh = smhash(kmer)
     counts = self.counts
     for i, p in enumerate(self.primes):
         try:
             counts[i][kh % p] += 1
         except (ValueError, OverflowError):
             pass
예제 #2
0
    def get(self, kmer):
        if len(kmer) != self.ksize:
            raise KMerException('Tried to get count \
                                with invalid k-mer size')

        kh = smhash(kmer)
        counts = self.counts
        return min(table[kh % len(table)] for table in counts)
예제 #3
0
def smhash_forward(kmer):

    return smhash(kmer), 0