NullPointerException Error with `-ar` Option in `taxa2function` tool in MEGAN 6 UE

Operating Environment:

  • Platform: NESI Jupyter Terminal
  • MEGAN Version: MEGAN Ultimate Edition (version 6.25.3, built 15 Sep 2023)

Tool Used:

  • Tool: taxa2function via slurm script

Description: A NullPointerException error occurs when executing the taxonomy2function tool with the -ar option. The same command, minus the -ar Genus option, works flawlessly both before and after the 13 Sep 2023 update (Release notes MEGAN6 V6_25_2), which introduced -ar and -br options to the taxonomony2function tool.

Command Triggering Error:

sample_id="S01"
$TOOL_DIR/taxonomy2function -i ${sample_id}.genes.fna.daa -o outputDir2/${sample_id}.outgenusnametokeggpath -a Taxonomy -af name -ar Genus -b KEGG -bf path -s semi-colon -ps semi-colon -sh -v

Error Stack Trace:

...
Caught:
java.lang.NullPointerException: Cannot invoke "megan.classification.Classification.getIdMapper()" because "megan.viewer.TaxonomyData.taxonomyClassification" is null
	at megan/megan.viewer.TaxonomyData.getTaxonomicRank(TaxonomyData.java:116)
	at megan/megan.viewer.TaxonomyData.getAncestorAtGivenRank(TaxonomyData.java:154)
	at megan/megan.tools.Taxonomy2Function.run(Taxonomy2Function.java:233)
	at megan/megan.tools.Taxonomy2Function.main(Taxonomy2Function.java:55)
	at megan6u/megan6u.tools.Taxonomy2Function.main(Unknown Source)
    ...

Working Command:

# Same command as above 

Additional Information: The issue seems to stem from the -ar option added in the recent update. The input file used was ${sample_id}.genes.fna.daa, with no non-standard mapping or taxonomy files involved. The objective was to process data using the taxonomy2function tool to generate output in outputDir2/${sample_id}.outgenusnametokeggpath.

Further Observations: Switching the second classification to genus using -br doesn’t resolve the issue but seems to prolong the process before the error occurs.

...
Processing: First classification
10% 20%

Request for Guidance: Seeking guidance on resolving this error to continue with data analysis. It appears the -ar option is the root cause of the NullPointerException within the Taxonomy2Function tool.

Still encountering the same issue. Received a new error message alongside the previous one: “OpenJDK 64-Bit Server VM warning: Insufficient space for shared memory file: 106498. Try using the -Djava.io.tmpdir= option to select an alternate temp location.” Attempted to address this by setting a temp directory in two ways: first, through the script using the -Djava.io.tmpdir= option, and second, by modifying the taxonomy2function tool script to include this option. Here’s the specific modification made:

Original line:

java_flags="-server -Duser.language=en -Duser.region=US $vmOptions"

Modified line:

java_flags="-server -Duser.language=en -Duser.region=US -Djava.io.tmpdir=/nesi/nobackup/uoa03769/Saif/TuOra/TuORA $vmOptions"

However, neither method resolved the issue.

The process completes the first classification (KEGG) but fails at the taxonomy stage, likely due to the -br tag. It’s notable that there is more than enough disk quota/space (20GB) and memory assigned to the job via the slurm script. Further troubleshooting is ongoing.

I’ve found the bug in the program and will upload a new release later today.