nf-core / mag

Assembly and binning of metagenomes
https://nf-co.re/mag
MIT License
192 stars 102 forks source link

Problem with DUMPSOFTWAREVERSIONS #596

Closed VasylVaskivskyi closed 3 months ago

VasylVaskivskyi commented 4 months ago

Description of the bug

I encountered a bug in almost last step of the pipeline. It's something with YAML. Not sure what caused it but, there is a weird string that sticks out just saying END_VERSIONS, and the identatation is incorrect for prokka, inside collated_versions.yml:

"NFCORE_MAG:MAG:BINNING:MAXBIN2":
    maxbin2: 2.2.7
   "NFCORE_MAG:MAG:PROKKA":
       prokka: 1.14.6
   END_VERSIONS
"NFCORE_MAG:MAG:DEPTHS:MAG_DEPTHS":
    python: 3.6.7
    pandas: 1.1.5

Command used and terminal output

Command used:

srun -p compute -c 64 --mem 400G -t 36:00:30 nextflow run  nf-core/mag -r 2.5.4  -resume -profile singularity -c /flash/HusnikU/vasylv/data/gm/nf_mag.config 
--outdir /flash/HusnikU/vasylv/data/gm/out/nf_mag_out/ylst1 --busco_db https://busco-data.ezlab.org/v5/data/lineages/cyanobacteria_odb10.2024-01-08.tar.gz  --skip_concoct --keep_phix --input "/bucket/HusnikU/Unit_Members/vasylv/data/gm/SRR8554436/SRR8554436_{1,2}.fastq.gz"

Output

Process `NFCORE_MAG:MAG:CUSTOM_DUMPSOFTWAREVERSIONS (1)` terminated with an error exit status (1)
Traceback (most recent call last):
  File "/flash/HusnikU/vasylv/data/gm/work/c7/2735fa75944a5fd06b7da8f2d0a784/.command.sh", line 101, in <module>
    main()
  File "/flash/HusnikU/vasylv/data/gm/work/c7/2735fa75944a5fd06b7da8f2d0a784/.command.sh", line 61, in main
    versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/yaml/parser.py", line 438, in parse_block_mapping_key
    raise ParserError("while parsing a block mapping", self.marks[-1],
yaml.parser.ParserError: while parsing a block mapping
  in "collated_versions.yml", line 1, column 1
expected <block end>, but found '<block mapping start>'
  in "collated_versions.yml", line 12, column 4


### Relevant files

[bug_report.zip](https://github.com/nf-core/mag/files/14370020/bug_report.zip)

### System information

-     Nextflow version: 23.10.1 build 5891
-     Hardware: HPC
-     Executor: slurm
-     Container engine: singularity 3.5.2
-     OS: CentOS Linux 8
-     Version of nf-core/mag: 2.5.4
jfy133 commented 4 months ago

Thank you for the bug report and the identification of the problem. That is very strange why that has not come up before... I'm currently travelling but will look into it when back next week..

jfy133 commented 3 months ago

Hi @VasylVaskivskyi

Thank you very much for the bug report file in particular.

I am unable to recreate the issue you are encountering. Re-running your command (with the test data) I get a correctly formatted YML file with PROKKA in the right place.

image

I find the error doubly strange as the rest of your YML is correctly formatted, and the PROKKA module itself also is correct.

I see you're resume'ing, did you happen to try modify or edit the file in thework` directory yourself?

But as I can't replicate the error, and the code looks OK, I will close this for now.

You could also try running your command as above but with the -profile test,singularity profile and without your data, and see if the same thing happens in that run too (this would at least suggest there is something more systematic).