Question: SPAdes error code -6
gravatar for Lina F
14 months ago by
Lina F180
Boston, MA
Lina F180 wrote:

Hi all,

I recently ran SPAdes on two samples and encountered an error code of -6.

I noticed that one of the samples I used was big and the other one had much fewer reads. I assume the error could come from the smaller dataset not having enough reads.

Number of FASTQ records in the smaller sample:

sample1.cleaned.merged.fq.gz 2166
sample1.cleaned.unmerged1.fq.gz 9355
sample1.cleaned.unmerged2.fq.gz 9355

Number of FASTQ records in the larger sample:

sample2.cleaned.merged.fq.gz 341864
sample2.cleaned.unmerged1.fq.gz 3009684
sample2.cleaned.unmerged2.fq.gz 3009684

Note that these are actually two metagenomics datasets but since the --meta flag isn't implemented for more than one paired-end library, I left out that parameter in the command line call.

I ran SPAdes as follows: \
  -t 36 \
  --only-assembler \
  -o spades_output \
  -k 21,33,55,77,99 \
  -m 200 \
  --pe1-1 sample1.cleaned.unmerged1.fq.gz \
  --pe1-2 sample1.cleaned.unmerged2.fq.gz \
  --pe1-s sample1.cleaned.merged.fq.gz \
  --pe2-1 sample2.cleaned.unmerged1.fq.gz \
  --pe2-2 sample2.cleaned.unmerged2.fq.gz \
  --pe2-s sample2.cleaned.merged.fq.gz

System information:
  SPAdes version: 3.13.0
  Python version: 3.7.2
  OS: Linux-4.14.101-75.76.amzn1.x86_64-x86_64-with-debian-9.6

My questions:

1) Do you have a recommended minimum number of reads in a sample coming from a metagenomics source? I.e. should I only attempt to assemble samples of a certain size?

2) These two samples actually came from the same physical source, which is why I wanted to assemble them together. I assumed that together, the samples would have enough reads to warrant attempting an assembly. Does SPAdes treat the two samples separately? Would it be more appropriate to concatenate the input files and treat the two samples as one sample?

3) If I would concatenate these two sequencing samples, I could also use the --meta flag. Would you expect that this will improve my chances of a good assembly?

If anyone has any been-there-done-that experience, it would be appreciated!

spades metagenomics assembly • 553 views
ADD COMMENTlink written 14 months ago by Lina F180

Did you try to assemble the sample2 with spades --meta and does that give the same error? More info about the error itself can be found on .

It is related to the coverage specific issue in a given sample. You could try to use the --only-assemble instead of the entire SPAdes pipeline and see if that leads a reasonable assembly. Another option would be to use lower the k-mer size parameter.

On a separate note, if you are running SPAdes 3.13 in a conda environment then I'd recommend to downgrade it to 3.11 as there are a couple of bugs with that version of SPAdes within conda.

ADD REPLYlink modified 14 months ago • written 14 months ago by Sej Modha4.7k

Thank you for your suggestions!

  • I tried assembling just sample1 -- that fails and I assume it's because the sample is too complex and/or doesn't have enough reads for the complexity.
  • I tried just assembling sample2 -- that assembles fine
  • I tried first concatenating the files of the two samples to make it look like one paired-end read library and then assembling with the --meta flag. That also assembles fine, which I expected, since assembling just sample2 succeeded as well.

I do actually use the --only-assembler flag routinely (see the command above).

I am not running SPAdes in conda, but that is good to know -- thank you!

ADD REPLYlink modified 14 months ago • written 14 months ago by Lina F180

At this point, I am ok with just tossing the small sample. One could argue that it probably doesn't add much information anyways.

However, what I didn't expect was that SPAdes would just not assemble anything when given these two libraries (even though sample2 on it's own does assemble into contigs). I had expected that it would look at all the data it has and then assemble as much as it can. Maybe this behavior was expected and I just wasn't aware of it :-)

ADD REPLYlink written 14 months ago by Lina F180
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 982 users visited in the last hour