<p>Hi :)<br />
<br />
A few weeks ago I was looking for a tool that would help me get &quot;DNA composition&quot; statistics for my sequencing. Something that would give me a dataset which which I could ask questions about GC bias, or over-represented sequences, motifs, etc. There are tools to answer each question specifically, but I was looking for something more general from which many analyses could be built on. This led me to k-mer counting, and all the down-stream tools which leverage k-mer result files.<br />
<br />
k-mer counting tools are pretty cool, but all the ones I tried had some draw backs; like high RAM requirements, very long run-times (although the latests bloom-filter based tools seem to mitigate this somewhat), but most importantly requiring a specific k-mer size to be chosen. I really wanted all mers in the dataset so I could look at &#39;&#39;GC&#39; and &#39;GCG&#39; and &#39;GCCGACGGACGAC&#39; without having to re-run any analyses. I couldn&#39;t find a tool like this after a brief search, so gave up and wrote my own in NumPy based off suffix-arrays.<br />
<br />
Two weeks later I have a functional program in the sense that I get results, but before I invest any time making it usable for others, I thought I should investigate further if there are tools which already do this. Making a suffix array was a nice learning experience for me so I haven&#39;t lost anything if such tools already exist - and if they do i&#39;d love to compare performance characteristics - but if not I might consider tidying up the code and making proper documentation. Does anyone know of such tools?<br />
<br />
Thank you so much, and happy Diwali :)</p>

<p>This is an interesting question because even though there are dozens of k-mer tools available they do all seem to have the same limitations: very short k-mer length requirements (usually &lt;32bp) and fixed length search. It seems like there are some new tools reporting performance improvements but they still seem to have those features. Tallymer (part of <a href="http://genometools.org">GenomeTools</a>) is the only tool, to my knowledge, that can compute statistics for an arbitrary length (or range) of k-mers. It sounds like you want the &#39;occratio&#39; subcommand, which runs for a range of k-mers (as opposed to the &#39;mkindex&#39; command which runs for a fixed length). Here is an example to get a range of unique/nonunique k-mers and get the relative amounts.</p>

<pre>
gt tallymer occratio -output unique nonunique -minmersize 10 -maxmersize 180 -esa db
gt tallymer occratio -output unique relative -minmersize 10 -maxmersize 180 -esa db</pre>

<p>Note, you have to create &#39;db&#39; first, but this was just an example. I can&#39;t go into the details, but I know that Tallymer uses a data structure called an enhanced suffix array. This is by the same author of Vmatch, and MUMmer (and many other tools). I should mention that Vmatch is also amazingly flexible for doing k-mer arithmetic and we could probably come up with an equivalent command using that tool. I agree with you about learning by doing, but this is a problem I would personally not try to solve since there are great tools available that allow you to answer virtually any question you may have about genomes and k-mers.</p>
