NullPointerException error

Hello

It’s my first time analysing data with MEGAN. I’ve just attempted to meganize my files with daa-meganizer; however, I keep getting the following errors.

Version MEGAN Ultimate Edition (version 6.22.2, built 10 Mar 2022)
Author(s) Daniel H. Huson
Copyright © 2022 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Java version: 17.0.2
Functional classifications to use: EC, EGGNOG, GTDB, INTERPRO2GO, SEED
Loading ncbi.map: 2,396,736
Loading ncbi.tre: 2,396,740
Loading ec.map: 8,200
Loading ec.tre: 8,204
Loading eggnog.map: 30,875
Loading eggnog.tre: 30,986
Loading gtdb.map: 240,103
Loading gtdb.tre: 240,107
Loading interpro2go.map: 14,242
Loading interpro2go.tre: 28,907
Loading seed.map: 961
Loading seed.tre: 962
Meganizing: R4V1_2603_S1__dfopt_merged.daa.assembled_unassembledforward.fastq.daa
Meganizing init
Annotating DAA file using FAST mode (accession database and first accession per line)
Annotating references
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (70.7s)
Writing
10% 20% 30% 40% 50% 60% 70% 80% 90% Caught:
java.lang.NullPointerException
at java.base/java.lang.System.arraycopy(Native Method)
at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:129)
at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:134)
at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:147)
at megan/megan.daa.DAAReferencesAnnotator.apply(DAAReferencesAnnotator.java:245)
at megan/megan.daa.Meganize.apply(Meganize.java:60)
at megan/megan.tools.DAAMeganizer.run(DAAMeganizer.java:262)
at megan/megan.tools.DAAMeganizer.main(DAAMeganizer.java:62)
at megan6u/megan6u.tools.DAAMeganizer.main(Unknown Source)

The command I’ve been using is

for x in $(ls *.daa) ; do daa-meganizer -t 50 -i $x -mdb /Data/diamondDB/megan-map-Feb2022.db ;done 2>> megan_output.log    

I’m unsure what a NullPointerException is. Is it an issue with my installation? I’ve had a look on the forum and it seems like they are caused by a few issues, my installation and files processing are both recent, and I have 128gig Memory available
I did have to add my tools folder to the path to be able to run daa-meganizer using…

export PATH=$PATH:/localhome/usersoftware/megan/tools

The first few files in my loop threw up the NullPointerException within a couple of minutes however the file I am currently processing has been going for about 30 now without throwing up the issue, which makes me wonder if there is a problem with the pre-processing on some of my files?

I’d appreciate any guidance on the issue.

Thanks

I think I have resolved one of my original issues reading a bit more into other posts that MEGAN is limited by memory in vmoptions.

I now seem to be getting a new issue, I assume the issue may be related to the fact there were now assignments made by meganizer ?

Version MEGAN Ultimate Edition (version 6.22.2, built 10 Mar 2022)
Author(s) Daniel H. Huson
Copyright © 2022 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Java version: 17.0.2
Functional classifications to use: EC, EGGNOG, GTDB, INTERPRO2GO, SEED
Loading ncbi.map: 2,396,736
Loading ncbi.tre: 2,396,740
Loading ec.map: 8,200
Loading ec.tre: 8,204
Loading eggnog.map: 30,875
Loading eggnog.tre: 30,986
Loading gtdb.map: 240,103
Loading gtdb.tre: 240,107
Loading interpro2go.map: 14,242
Loading interpro2go.tre: 28,907
Loading seed.map: 961
Loading seed.tre: 962
Meganizing: R4V1_2603_S1__dfopt_merged.assembled.daa
Meganizing init
Annotating DAA file using FAST mode (accession database and first accession per line)
Annotating references
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (33.7s)
Writing
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (1.9s)
Binning reads Initializing…
Initializing binning…
Using ‘Naive LCA’ algorithm for binning: Taxonomy
Using Best-Hit algorithm for binning: SEED
Using Best-Hit algorithm for binning: EGGNOG
Using ‘Naive LCA’ algorithm for binning: GTDB
Using Best-Hit algorithm for binning: EC
Using Best-Hit algorithm for binning: INTERPRO2GO
Binning reads…
Binning reads Analyzing alignments
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (521.8s)
Total reads: 14,903,697
With hits: 14,903,697
Alignments: 353,505,901
Assig. Taxonomy: 0
Assig. SEED: 0
Assig. EGGNOG: 0
Assig. GTDB: 0
Assig. EC: 4,350,329
Assig. INTERPRO2GO: 0
MinSupport set to: 1490
Binning reads Writing classification tables
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (3.8s)
Binning reads Syncing
100% (0.0s)
Caught:
java.lang.NullPointerException: Cannot invoke “megan.data.IClassificationBlock.getKeySet()” because “classificationBlock” is null
at megan/megan.daa.connector.DAAConnector.getClassificationSize(DAAConnector.java:115)
at megan/megan.algorithms.DataProcessor.apply(DataProcessor.java:413)
at megan/megan.core.Document.processReadHits(Document.java:545)
at megan/megan.daa.Meganize.apply(Meganize.java:97)
at megan/megan.tools.DAAMeganizer.run(DAAMeganizer.java:262)
at megan/megan.tools.DAAMeganizer.main(DAAMeganizer.java:62)
at megan6u/megan6u.tools.DAAMeganizer.main(Unknown Source)

Megan is not finding any assignments.

There are two possible issues:

  1. there could be something wrong with the mapping db file.
    Could you please try opening it using the command line program sqlite3 like this:

sqlite3 megan-map-Feb2022-ue.db

and then type:

select * from info;
.quit

Does that work?

If it does, then the question is
(2) which database did you align against? Which mapping db file are you using (e.g. megan-map-Feb2022-ue.db?). If there is a mismatch between the database against which you aligned the sequences and the mapping db file that you are using, then this would explain why there are 0 assignments.