nf-core / taxprofiler

Highly parallelised multi-taxonomic profiling of shotgun short- and long-read metagenomic data
https://nf-co.re/taxprofiler
MIT License
116 stars 33 forks source link

megan version 6.21.7 throw `java.lang.NullPointerException` error #407

Closed MajoroMask closed 10 months ago

MajoroMask commented 10 months ago

Description of the bug

Hi guys it's me again, I been testing my local sets of taxprofiler reference and encountered this bug.

The error massage kinda like this:

Caused by:
  Process `NFCORE_MAG:MAG:VISUALIZATION_KRONA:MEGAN_RMA2INFO_KRONA (2613.phix_removed.unmapped_1 - virus-malt)` terminated with an error exit status (1)

Command executed:

  rma2info \
      -i 2613.phix_removed.unmapped_1.rma6 \
      -o 2613.phix_removed.unmapped_1_virus-malt.txt.gz \
       \
      --read2class Taxonomy

  cat <<-END_VERSIONS > versions.yml
  "NFCORE_MAG:MAG:VISUALIZATION_KRONA:MEGAN_RMA2INFO_KRONA":
      megan: $(echo $(rma2info 2>&1) | grep version | sed 's/.*version //g;s/, built.*//g')
  END_VERSIONS

Command exit status:
  1

Command output:
  (empty)

Command error:
  Error: JavaFX detected no fonts! Please refer to release notes for proper font configuration
  Version   MEGAN Community Edition (version 6.21.7, built 23 Jun 2021)
  Author(s) Daniel H. Huson
  Copyright (C) 2021 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
  Loading ncbi.map: 2,302,807
  Loading ncbi.tre: 2,302,811
  Caught:
  java.lang.NullPointerException
    at megan/megan.tools.RMA2Info.isDescendant(RMA2Info.java:455)
    at megan/megan.tools.RMA2Info.reportRead2Count(RMA2Info.java:387)
    at megan/megan.tools.RMA2Info.run(RMA2Info.java:153)
    at megan/megan.tools.RMA2Info.main(RMA2Info.java:63)

Work dir:
  /path/df/00a947f63ff0bfab7feeb6ca32a317

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`

I noticed that the megan has a newer version docker container in biocontainer project, so I tried to modify modules/nf-core/megan/rma2info/main.nf as below, and the problem got solved:

process MEGAN_RMA2INFO {
    tag "$meta.id"
    label 'process_single'

-     conda "bioconda::megan=6.21.7"
-     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
-         'https://depot.galaxyproject.org/singularity/megan:6.21.7--h9ee0642_0':
-         'biocontainers/megan:6.21.7--h9ee0642_0' }"
+     conda "bioconda::megan=6.24.20"
+     container 'quay.io/biocontainers/megan:6.24.20--h9ee0642_0'

    input:
    tuple val(meta), path(rma6)
    val(megan_summary)

I'm just a engineer here in my facility so I did not look into it further. Do you guys need to check this out?

Command used and terminal output

nextflow run ./main.nf -profile test,docker --outdir test --run_krona true --krona_taxonomy_directory /local/path/krona/taxonomy.tab

Relevant files

No response

System information

No response

jfy133 commented 10 months ago

Hi @MajoroMask I can't replicate...

The only thing I can think of is you maybe hit a memory error (java is really wierd and inconsistent with memory usage)... , MALT/MEGAN databases are extremely large, so if you have a custom one that could cause errors.

Could you try increasing the amount of memory to that process with a config file, before we bump the version in a patch release (although this will come in the next major release)?

MajoroMask commented 10 months ago

Hi @jfy133 Thanks for your reply.

I tried your solution and I think this time it's not the out of memory issue.

cd /path/into/workdir/34/3e38ec40e5e77328f24cffaba38e1e
cat .exitcode
1
cat .command.run | grep 'docker run * --memory'
docker run -i --cpus 1.0 --memory 51200m -e "NXF_DEBUG=${NXF_DEBUG:=0}"
cat .command.err
Error: JavaFX detected no fonts! Please refer to release notes for proper font configuration
Version   MEGAN Community Edition (version 6.21.7, built 23 Jun 2021)
Author(s) Daniel H. Huson
Copyright (C) 2021 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Loading ncbi.map: 2,302,807
Loading ncbi.tre: 2,302,811
Caught:
java.lang.NullPointerException
        at megan/megan.tools.RMA2Info.isDescendant(RMA2Info.java:455)
        at megan/megan.tools.RMA2Info.reportRead2Count(RMA2Info.java:387)
        at megan/megan.tools.RMA2Info.run(RMA2Info.java:153)
        at megan/megan.tools.RMA2Info.main(RMA2Info.java:63)
--- Release notes MEGAN6 V6_21_11 (Fri, 20 Aug 2021): ---

- Fixed newly introduce bug in Project menu
- Fixed minor bug in rma2info

Since megan is not open source, I think we can't confirm it on code level. The only thing we know is that they do have a rma2info bug fixed between release 6.21.7 and 6.24.20. So fixing this problem by updating megan version makes sense to me.

That's all I have for now. Hope this information could be of help for you guys.

MajoroMask commented 10 months ago

Well, turns out megan CE is open source (the commit)

image

jfy133 commented 10 months ago

OK! Thanks @MajoroMask that's enough to warrant the bump.

I will aim to update the module and pipeline over the next few days and include taht with the other bug fixes :)

jfy133 commented 10 months ago

First step: module update https://github.com/nf-core/modules/pull/4228