ablab / spades

SPAdes Genome Assembler
http://ablab.github.io/spades/
Other
763 stars 139 forks source link

Error when using conda spades #1360

Closed eggrandio closed 3 months ago

eggrandio commented 3 months ago

Description of bug

When I try to run spades.py --test or any other spades script, I get the following error:

== Warning ==  No assembly mode was specified! If you intend to assemble high-coverage multi-cell/isolate data, use '--isolate' option.

Command line: /home2b/eduardo.gonzalez/miniconda3/envs/denovo/bin/spades.py     --test

System information:
  SPAdes version: 3.15.3
  Python version: 3.12.4
  OS: Linux-5.15.0-118-generic-x86_64-with-glibc2.35

Output dir: /home2b/eduardo.gonzalez/ccit_denovo/spades_test
Mode: read error correction and assembling
Debug mode is turned OFF

Dataset parameters:
  Standard mode
  For multi-cell/isolate data we recommend to use '--isolate' option; for single-cell MDA data use '--sc'; for metagenomic data use '--meta'; for RNA-Seq use '--rna'.
  Reads:
Traceback (most recent call last):
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/bin/spades.py", line 659, in <module>
    main(sys.argv)
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/bin/spades.py", line 599, in main
    print_params(log, log_filename, command_line, args, cfg)
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/bin/spades.py", line 327, in print_params
    print_used_values(cfg, log)
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/bin/spades.py", line 117, in print_used_values
    dataset_data = pyyaml.load(open(cfg["dataset"].yaml_filename))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/__init__.py", line 72, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/constructor.py", line 37, in get_single_data
    return self.construct_document(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/constructor.py", line 46, in construct_document
    for dummy in generator:
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/constructor.py", line 204, in construct_mapping
    return super().construct_mapping(node, deep=deep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home2b/eduardo.gonzalez/miniconda3/envs/denovo/share/spades/pyyaml3/constructor.py", line 126, in construct_mapping
    if not isinstance(key, collections.Hashable):
                           ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Hashable'

spades.log

spades.log

params.txt

params.txt

SPAdes version

3.15.3

Operating System

Linux-5.15.0-118-generic-x86_64-with-glibc2.35

Python Version

3.12.4

Method of SPAdes installation

conda

No errors reported in spades.log

SimonHegele commented 3 months ago

Hi Eduardo,

I have used SPAdes before on a different system but after installing it from conda I had the very same problem as you did. For some reason conda also installed an older version on my system. I now have v3.15.5 and it works for me Try uninstalling SPAdes using "conda uninstall spades" Then reinstall a newer version using "conda install -c bioconda -c conda-forge spades=3.15.5" (Some dependencies of SPAdes are in the Conda-forge channnel) Of course you could also test the very new v4.0.

Since you are using both short and long reads I would reommend giving Rnabloom a shot. Basically, it will perform a long read assembly and only use the short reads for error correction. However, it's results strongly depend on the coverage by the long reads. If the coverage is low it is probably better to stick to assemblers like SPAdes or Trinity, that rely more on the information coming from short reads.

asl commented 3 months ago

This is the known issue with SPAdes 3.15.3. Consider upgrading to the latest SPAdes 4.0. We do not maintain conda packages, consider reporting the version issue to them