PalMuc / TransPi

TransPi – a comprehensive TRanscriptome ANalysiS PIpeline for de novo transcriptome assembly
Other
26 stars 14 forks source link

rnaspades step dies with "AttributeError: module 'collections' has no attribute 'Hashable'" #35

Closed laninsky closed 2 years ago

laninsky commented 2 years ago

The rnaspades step is dying with AttributeError: module 'collections' has no attribute 'Hashable' with the transpi repo version pulled on the 27th December 2021 using the conda profile.

It appears to be the following issue: https://github.com/ablab/spades/issues/863

It could potentially be solved until rnaspades is updated by using python < 3.10.

I was using Nextflow/21.04.3 amd Miniconda3/4.9.2 (Python 3.8.5), however there doesn't seem to be a way to specify rnaspades to use python < 3.10 through transpi (i.e. under system information in the error message below, Python version: 3.10.1 was the version being used with rnaspades)

Command:

nextflow run ../TransPi/TransPi.nf --all --reads '/nesi/nobackup/uoo00105/orthoskim_test/*_[1,2].fastq.gz' \
     --k 25,41,53 --maxReadLen 150 -profile conda -resume

Full error message:

Something went wrong. Check error message below and/or log files.
Error executing process > 'rna_spades_assembly (SRR6472974)'

Caused by:
  Process `rna_spades_assembly (SRR6472974)` terminated with an error exit status (1)

Command executed:

  echo -e "\n-- Starting rnaSPADES assemblies --\n"

  mem=$( echo 100 GB | cut -f 1 -d " " )

  for x in `echo 25,41,53 | tr "," " "`;do
      echo -e "\n-- rnaSPADES k${x} --\n"
      rnaspades.py -1 left-SRR6472974.norm.fq -2 right-SRR6472974.norm.fq -o SRR6472974_spades_${x} -t 36 -k ${x} -m ${mem}
  done

  echo -e "\n-- Finished with the assemblies --\n"

  for x in `echo 25,41,53 | tr "," " "`;do
      sed -i "s/>/>SPADES.k${x}./g" SRR6472974_spades_${x}/transcripts.fasta
  done

  cat SRR6472974_spades_*/transcripts.fasta >SRR6472974.SPADES.fa

  for x in `echo 25,41,53 | tr "," " "`;do
      cp SRR6472974_spades_${x}/transcripts.fasta SRR6472974.SPADES.k${x}.fa
  done

  rm -rf SRR6472974_spades_*

  v=$( rnaspades.py -v 2>&1 | awk '{print $4}' | tr -d "v" )
  echo "rna-SPADES: $v" >rna_spades.version.txt

Command exit status:
  1

Command output:

  -- Starting rnaSPADES assemblies --

  -- rnaSPADES k25 --

  Command line: /scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/bin/rnaspades.py -1  left-SRR6472974.norm.fq -2  right-SRR6472974.norm.f-o   SRR6472974_spades_25    -t  36  -k  25  -m  100 

  System information:
    SPAdes version: 3.14.0
    Python version: 3.10.1
    OS: Linux-3.10.0-693.2.2.el7.x86_64-x86_64-with-glibc2.17

  Output dir: SRR6472974_spades_25
  Mode: ONLY assembling (without read error correction)
  Debug mode is turned OFF

  Dataset parameters:
    RNA-seq mode
    Reads:

Command error:
  Traceback (most recent call last):
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/bin/rnaspades.py", line 639, in <module>
      main(sys.argv)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/bin/rnaspades.py", line 579, in main
      print_params(log, log_filename, command_line, args, cfg)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/bin/rnaspades.py", line 322, in print_params
      print_used_values(cfg, log)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/bin/rnaspades.py", line 112, in print_used_values
      dataset_data = pyyaml.load(open(cfg["dataset"].yaml_filename))
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/__init__.py", line 72, in load
      return loader.get_single_data()
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/constructor.py", line 37, in get_single_data
      return self.construct_document(node)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/constructor.py", line 46, in construct_document
      for dummy in generator:
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/constructor.py", line 398, in construct_yaml_map
      value = self.construct_mapping(node)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/constructor.py", line 204, in construct_mapping
      return super().construct_mapping(node, deep=deep)
    File "/scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-8715806f9fdbb3029a17af22acc9fcad/share/spades/pyyaml3/constructor.py", line 126, in construct_mapping
      if not isinstance(key, collections.Hashable):
  AttributeError: module 'collections' has no attribute 'Hashable'

Work dir:
  /scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/work/cf/9b79cada5568a0d4a90a83cab19c56

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`
rivera10 commented 2 years ago

Hello @laninsky,

Could you pull again the repository. I see that your spades is v3.14.0. Currently, TransPi uses v3.15.3 where this issue is solved. See https://github.com/bioconda/bioconda-recipes/pull/31789/files

I did a test run and the pipeline is working fine with this version. Let me know how it goes.

Best, Ramon

laninsky commented 2 years ago

Thanks Ramon! I've pulled the new version and will let you know how it goes.

laninsky commented 2 years ago

Hi Ramon - slightly different error is now stopping transpi (sorry - I know this is probably pretty trivial to edit the TransPi.nf file for, but I'm not fluent in either nextflow or python):

Error executing process > 'rna_spades_assembly (SRR6472974)'

Caused by:
  Failed to create Conda environment
  command: conda create --mkdir --yes --quiet --prefix /scale_wlg_nobackup/filesets/nobackup/uoo00105/transpi_conda/condaEnv/env-5ab1df8f4ffd36472969883031adc864 -c conda-forge bioconda::spades=3.15.3=h95f258a_1
  status : 1
  message:
    [Errno 2] No such file or directory: '/nesi/nobackup/uoo00105/alana.alexander/conda_pkgs/spades-3.15.3-h95f258a_1.tar.bz2'
laninsky commented 2 years ago

Hi Ramon,

Just letting you know that the current test run I am doing with the repo pulled on Jan 18th seems to be working fine (the run is still in progress, but the rnaspades step has completed without an error), so going to go ahead and close this issue. Thanks for the help!

Alana