This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Most frequent substring of a given length

Is there anything in Biopython which could give the most frequently occurring substring of a given length from a sequence read?

biopython

2 answers

If language doesn't matter, you can use this bash (includes a perl script) script. I did not update this from a long time but it works pretty well. You can give the k-mer length of your interest. Output will be as follows or you can modify according to your needs.

TAACCCTAAC   23
AACCCTAACC   21
ACCCTAACCC   20 
CCCTAACCCT   20
CCTAACCCTA   20
CTAACCCTAA   18
TAACCCTAAC   18
-----
------

How about a k-mer counter, like khmer (not Biopython, but C++ with Python wrapper)?

Log in to answer this question.