How to efficiently compute the exact percentage of non-unique k-mers in a genome for given k? I'm looking for some software that can "efficiently" (time and memory) compute the exact percentage of non-unique k-mers in a genome for given k. I don't need the k-mers or the abundances itself, I just need the percentage.

Alternatively, the result could be:


the number of different k-mers observed in the genome
the number of unique k-mers, i.e. k-mers that occur only once in the genome, or the number of non-unique k-mers, i.e., k-mers that occur more than once in the genome.


which can be easily used to compute the requested percentage.

Requested features:


don't count k-mers with ambiguous nucleotides
count a k-mer and its reverse complement together
k upto 50 or 100
for large genomes (upto some GB)  
efficiency


For the study in mind, I like to vary k. Hence, I will run the software several times with different k.

Any help is welcome.
You can do all of that with khmer. For example, abundance-dist-single.py produces a file with columns: k-mer abundance, k-mer count, cumulative count, and fraction of total distinct k-mers. So for question 1 you would sum column 2. For question 2 you would just get thek-mer countassociated with ak-mer abundance` of 1.

That package also provides a python API (see the read the docs link above) if you need to customize things more.