# Will using smaller kmers help get larger contigs? If not, then what?

I've been using MEGAHIT to assemble metagenomes, with particular focus on specific genomic areas.

Sometimes all I get is gene fragments or pathway fragments (eg. if I know that genes A, B, C, D and E should be together, I only get A, B, C in one contig, and maybe D and E in another). That is understandable when the sequencing depth is low, and I'm assume that it's the best I can get.

However. In two of my metagenomes, the genes of interest seem to be abundant (depth of 100-300+ listed for MEGAHIT contigs). And I still have the same problem. I assume that these 'breaks' between contigs are due to natural sequence variation which breaks the assembly process. (while sequencing errors are also possible, I've used bbduk to clean my data prior to assembly)

I'd like to have larger contigs because I'm curious about the gene order. Things I've tried (did not work): visualizing assembly graphs with Bandage around Blast hits, starting with a smaller k-min (21 as opposed to 27).

So I guess I'm wondering if using even smaller k-mers might make a difference. Or if someone has another suggestion, I'm happy to listen! Thank you.

Megahit setting used:

megahit -r input_files.fastq --num-cpu-threads 32 --min-contig-len 300 --presets meta-large -o output
megahit -r input_files.fastq --num-cpu-threads 32 --min-contig-len 1500 --presets meta-sensitive -o output


Meta-large starts from minimum kmer size 27; meta-sensitive from 21.

• Typically the tradeoff is smaller kmers getting you a more connected assembly graph, while longer kmers can span repeats more and perhaps connect more contigs. So I think the logical thing might be to try and increase kmer size. Mar 18 '20 at 13:53
• @NatWH Thank you, I can see how that would work. Considering that a MEGAHIT run goes all up to k-mer size 127 (maximum), and the results that I get are as such, shall I assume that nothing can be done just by changing k-mer size? (or even in general) Mar 18 '20 at 15:50
• Does MEGAHIT build the results of the graph from larger kmer sizes on top of those from smaller in some way, akin to SPAdes? If so, then the method should already have accounted for this. If not, then perhaps you can try and manually increase kmer size. Mar 19 '20 at 14:21