thank you but spades.py is on the path, I do not need the tilde expansion to run it; however, even using the full path, I get the same error. Also, I removed a space from the folder containing the fastq files, but the error persists...
I have paired fastq files that I have trimmed (Trm) and dedeplicated (Ded) with BBMap. I then run an assembly with Spades, but I got an error:
$ spades.py -1 1_TrmDed.fq.gz -2 2_TrmDed.fq.gz -o ./Assemble --metaviral
Command line: ~/SPAdes/bin/spades.py -1 1_TrmDed.fq.gz -2 2_TrmDed.fq.gz -o Assemble --metaviral
System information:
SPAdes version: 4.2.0
Python version: 3.13.12
OS: Linux-6.19.10-100.fc42.x86_64-x86_64-with-glibc2.41
Output dir: Assemble
Mode: read error correction and assembling
Debug mode is turned OFF
Dataset parameters:
Metagenomic mode
Reads:
Library number: 1, library type: paired-end
orientation: fr
left reads: ['1_TrmDed.fq.gz']
right reads: [2_TrmDed.fq.gz']
interlaced reads: not specified
single reads: not specified
merged reads: not specified
Read error correction parameters:
Iterations: 1
PHRED offset will be auto-detected
Corrected reads will be compressed
Assembly parameters:
k: automatic selection based on read length
Extrachromosomal mode is turned ON
Repeat resolution is enabled
Mismatch careful mode is turned OFF
MismatchCorrector will be SKIPPED
Coverage cutoff is turned OFF
Assembly graph output will use GFA v1.2 format
Other parameters:
Dir for temp files: Assemble/tmp
Threads: 16
Memory limit (in Gb): 62
======= SPAdes pipeline started. Log can be found here: Assemble/spades.log
1_TrmDed.fq.gz: max reads length: 150
2_TrmDed.fq.gz: max reads length: 150
Reads length: 150
Default k-mer sizes were set to [21, 33, 55, 77, 99, 127] because estimated read length (150) is equal to or greater than 150
===== Before start started.
===== Read error correction started.
===== Read error correction started.
== Running: Assemble/corrected/configs/config.info
0:00:00.000 1M / 19M INFO General (main.cpp : 76) Starting BayesHammer, built from N/A, git revision 7fee3c1050a732faef8a0d93d70861015a96f44e
0:00:00.003 1M / 19M INFO General (main.cpp : 77) Loading config from "Assemble/corrected/configs/config.info"
Exception caught conversion of data to type "std::filesystem::__cxx11::path" failed
== Error == system call for: "[~/SPAdes/bin/spades-hammer', 'Assemble/corrected/configs/config.info']" finished abnormally, OS return value: 4
None
In case you have troubles running SPAdes, you can report an issue on our GitHub repository github.com/ablab/spades
Please provide us with params.txt and spades.log files from the output directory.
SPAdes log can be found here: Assemble/spades.log
How can I activate a debug mode?
How can I fix the Read error correction started problem?
How can I assess if the fastq files are good to start with? Is there a sanity checker I could use? The fastq files were processed by BBMap, so they should be good to start with; why did the assembly fail then?
Thank you
1 answer
Can you check if your files are named correctly:
left reads: ['1_TrmDed.fq.gz'] right reads: [2_TrmDed.fq.gz'] (missing ' on the left)Tilde (~) in the spades-hammer path (the actual crash): The ~ in ~/SPAdes/bin/spades-hammer is not being expanded to the full home directory path. std::filesystem::path in C++ does not expand ~ — it treats it as a literal character and fails to find the file.
Work around:
Instead of:
~/SPAdes/bin/spades.py
Use the full path:
/home/username/SPAdes/bin/spades.py -1 1_TrmDed.fq.gz -2 2_TrmDed.fq.gz \ -o ./Assemble --metaviral
thank you, spades.py is on the path, I do not need the tilde expansion to run it; it turned out there was a space in the folder's name because the folder is linked to Google drive. I copied the files in another folder and now Spades is running. Thanks
Log in to answer this question.
What was the reason for this? What kind of deduplicaiion did you do and which BBMap tool did you use? Perhaps you should have normalized the data with
bbnormthan deduplicate. Is this pro or eukaryotic data?As for
Add
--debugto your command line.Thank you. Now I got
but I still get the
Exception caught conversion of data to type "std::filesystem::__cxx11::path" failederror just like before.That's not a problem, just output informing you about a step in the workflow being started: Read error correction.
I am not sure what exactly is wrong; however, it must be something unexpected in the input data that is causing this, possibly linked to your preprocessing of the reads. Some things to try:
--metaviralfor--isolateor just leave it outP.S.: For what it's worth, I suspect the preprocessing messed up your read pairing, less likely with read naming or read length, or left empty reads with no sequence (least likely to cause these problems)
I also asked Google AI and it sounds plausible:
Even though nothing in your post points to it make sure your home isn't something like
/home/general failure/Thanks, but Spades is located in a space free folder; in fact, I used the same pipeline before without problems. I could even run it with an online version via the PATRIC platform. But I'd prefer do it on my machine for more control...
Some more ideas:
export LC_ALL=Cthen run again from the same shell (there was a longer post here that has been deleted recommending this)df -h .to ensure your partition isn't fullseqkit stats, that should at least protect against a broken gzipped fileAssemble/corrected/configs/config.info?Ofc, all this is pure guesswork, as well as part of my proven debugging "strategy".