This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Choose The K Value Of Kmer In Soapdenovo?

I have read the papers about EULER, velvet and soapdenovo, but I am still confused about how to choose the K values. It is a common practice to test several K values and choose the best one among them according to the results. But I think there may be some clues indicating the proper range of K and the K values should not be tested blindly. For example, obviously the K should be less than the maximal length of the reads. Is there a way to estimate roughtly the proper range of K values according to the genome size, sequenceing depth, reads length or something else? How do you choose the K value? Many thanks.

3 answers

Generally it is between half to 2/3rd of the read length; Too small will lead to many short contigs, whereas longer kmer will result in few long contigs.

And then, may need to perform several trial runs with different K-mer around, and select the best one

After assembly, you will calculate some statistics such as contig N50 N90, scaffold N50 N90, and total scaffold length. Usually, a better Kmer gives larger contig/scaffold N50/90 values. But the total scaffold length should not deviate too much from the estimated genome size (You should estimate the genome size using an experimental method such as flow cytometry).

Quite reasonable. Many thanks.

I thought in a perfect experiment, we'd want a single contig that covers the whole genome. Why "longer kmer will result in few long contigs" is a bad thing?

Imperfect coverage and sequencing errors.. Sufficiently many error-free k-mers need to cover each position in a contig. Take a look at the kmergenie paper for a longer discussion.

Is it really true? Shorter kmers will unable overgo repetitions of the same or longer length, but on the other hand it help you to guild more dense graph (basically two reads will be in connected in graph only in the case of overlap of the size of kmer). Therefore I guess it depens a lot on coverage you have, lower coverage you have the smaller kmer you have to choose because otherwise even non complex regions wont be resolved.

I suggest to have a look at VelvetOptimiser :

VelvetOptimiser is a multi-threaded Perl script for automatically optimising the three primary parameter options (K, -expcov, -covcutoff) for the Velvet de novo sequence assembler.

Thanks for you advice, Frederic. SOAPdenovo shares basic rationale with Velvet. Your suggestion should be helpful for K value selection in soapdenovo. I will check it.

You may estimate the best kmer using the kmer frequency table. One of the programs that do this specifically is kmergenie. I''ve used the tool earlier but the results were not too promising but perhaps the updates in the software may have improved things a bit.

Wished it had a k-mer best estimate for error correcting reads as well.

Pros: You get a k-mer that you can focus on for assembly (obviously).

Cons: The running of the program itself takes quite a while.

Hi, kmergenie dev here. Indeed, we're continuously improving the software, and it normally works well for our users. I encourage you to try a latest version and email me (kmergenie@cse.psu.edu) if you get unsatisfactory results. Your feedback can help us identify problems we were not aware of. Thanks.

Does one combine forward and reverse reads into one file to run kmergenie? Is it possible to use separate files?

Log in to answer this question.