This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to determine the K-mer size?

I have reads with 151bp length. I heard that the convention is to set the k-mer size as 1/2 to 2/3 the read length. In this case, it would mean that the k-mer size should be 75-100bp. However, isn't this range too erroneous? I want to correct my reads using Musket and it recommends default kmer size of 21.

k-mer

You can use something like jellyfish to get a count of possible k-mers: https://github.com/gmarcais/Jellyfish

I heard that the convention is to set the k-mer size as 1/2 to 2/3 the read length

That is probably for assemblies not what you are trying to do.

1 answer

I think you are mixing up k-mer sizes for assembly purposes vs. k-mer sizes for error-correction purposes. K-mer size is not universal regardless of application. The rule of thumb you mention applies to assembly, and even in such cases it is best to let the assemblers figure out on their own what k-mer size to use. For example, SPAdes has an auto function that will test several k-mers and automatically determine the best.

If musket recommends k=21, that should be a safe choice. I have used k=21 with bfc and it works well.

I came here after reading about bfc . I am planning to run bfc on my fastp trimmed reads. I wonder if you could share your input on the -s parameter for metagenomic data from complex environments such as soil and decaying wood?

Also, Is -1 flag necessary here?

bfc -s 1g -t $SLURM_CPUS_PER_TASK -1 $R1 | gzip -1 > bfc_output/${SAMPLE}_R1.bfc.fq.gz
bfc -s 1g -t $SLURM_CPUS_PER_TASK -1 $R2 | gzip -1 > bfc_output/${SAMPLE}_R2.bfc.fq.gz

I don't use -s in bfc but I do use -1.

Log in to answer this question.