I'm having trouble using SPAdes. I'm using SPAdes to do paired end data assembly and I'm getting an unusual stop.
error code: finished abnormally, OS return value: 21
Do you know how to resolve this issue?
Environment: conda, SPAdes genome assembler v3.15.5 WSL, ubuntu RAM: 16GB
below is the error code
** 10:12:50.465 1M / 12G INFO General (kmer_index_builder.hpp : 260) K-mer counting done. There are 2075359224 kmers in total. 10:12:50.503 1M / 12G INFO K-mer Index Building (kmer_index_builder.hpp : 395) Building perfect hash indices 10:51:33.992 1481M / 12G INFO K-mer Index Building (kmer_index_builder.hpp : 431) Index built. Total 2075359224 kmers, 1498969344 bytes occupied (5.77816 bits per kmer). 10:51:34.013 1481M / 12G ERROR K-mer Counting (kmer_data.cpp : 349) The reads contain too many k-mers to fit into available memory. You need approx. 77.3132GB of free RAM to assemble your dataset
== Error == system call for: "['/home/default1/miniconda3/envs/spades/bin/spades-hammer', '/mnt/d/raw/2023nudi/01.RawData/De-SPAdes/spades_output/corrected/configs/config.info']" finished abnormally, OS return value: 21 None**
Can you explain the preprocessing to reduce spurious kmers in more detail?
Well, yes, I can. But I'd prefer that you read bbmap/pipelines/assemblyPipeline.sh since it explains all of that. Hopefully.
Anyway, when you do genome assembly via De Bruijn graphs, there are two kinds of kmers: Those from the genome, and those from sequencing errors. Technically it's also possible to get cancer kmers but those tend to be in low volume so you can ignore them unless you are a liquid-biopsy company.
When you do genome assembly, you want to assemble the abundant kmers, because those are most likely to be correct (rather than caused by an error in the sequencing platform). So, preprocessing to remove artifact kmers is useful to get a good assembly. And it also drastically reduces memory requirements.
You have not mentioned any of your preprocessing steps so I assume you are just using raw reads, which is a no-go. Just follow the guidance and you might get a good assembly.