beast2 icon indicating copy to clipboard operation
beast2 copied to clipboard

java.lang.NullPointerException: Cannot invoke "beast.base.evolution.tree.Node.getNr()" because "<local2>" is null

Open forianfinest opened this issue 2 years ago • 3 comments

Hello there, I'm trying to run Coalescent Bayesian Skyline analysises with Beast 2.7.2 on Fedora 36, but it bugs with one of my files: java.lang.NullPointerException: Cannot invoke "beast.base.evolution.tree.Node.getNr()" because "<local2>" is null at beastlabs.evolution.tree.RNNIMetric.getCommonAncestor(Unknown Source) at beastlabs.evolution.tree.RNNIMetric.getCommonAncestor(Unknown Source) at beastlabs.evolution.tree.RNNIMetric.mrca(Unknown Source) at beastlabs.evolution.tree.RNNIMetric.distance(Unknown Source) at beastlabs.evolution.tree.RNNIMetric.distance(Unknown Source) at beast.base.evolution.operator.AdaptableOperatorSampler.computeSS(Unknown Source) at beast.base.evolution.operator.AdaptableOperatorSampler.accept(Unknown Source) at beast.base.inference.MCMC.propagateState(Unknown Source) at beast.base.inference.MCMC.doLoop(Unknown Source) at beast.base.inference.MCMC.run(Unknown Source) at beastfx.app.beast.BeastMCMC.run(Unknown Source) at beastfx.app.beast.BeastMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source) at beast.pkgmgmt.launcher.BeastLauncher.main(Unknown Source) I'm not sure what is the issue. I tried to run a Yule model with the same settings (mutation model and soft molecular clock) and it outputted correctly. I attach here the XML file (edited as a .txt file because GitHub does not allow to attach XML) nexus_edited.xml.txt . Thanks in advance for the suggestions on how to fix it. Best wishes, Mattia

forianfinest avatar Nov 02 '22 01:11 forianfinest

Hi, I was able to reproduce this issue using your xml file. There appears to be a bad interaction between the EpochFlexOperator and clock model. We are working on this issue now. In the meantime if you delete the 2 EpochFlexOperator objects from the xml file, or set their operator weights to 0, it should work fine.

jordandouglas avatar Nov 03 '22 06:11 jordandouglas

When running the analysis, population sizes seem to collapse to very small values. An alternative workaround is to keep the operators but set the lower bound on population sizes to a small value, so change the line

            <parameter id="bPopSizes.t:trimmed_acuto_all_modified" spec="parameter.RealParameter" dimension="5" lower="0" name="stateNode">380.0</parameter>

to

            <parameter id="bPopSizes.t:trimmed_acuto_all_modified" spec="parameter.RealParameter" dimension="5" lower="0.01" name="stateNode">380.0</parameter>

rbouckaert avatar Nov 14 '22 18:11 rbouckaert

I met a problem, could you heip me?

Restoring from file Fatal exception: Cannot invoke "beast.evolution.tree.Node.isLeaf()" because "" is null java.lang.NullPointerException: Cannot invoke "beast.evolution.tree.Node.isLeaf()" because "" is null at snap.likelihood.SnAPPrior.heightSum(Unknown Source) at snap.likelihood.SnAPPrior.heightSum(Unknown Source) at snap.likelihood.SnAPPrior.calculateLogP(Unknown Source) at beast.core.util.CompoundDistribution.calculateLogP(Unknown Source) at beast.core.util.CompoundDistribution.calculateLogP(Unknown Source) at beast.core.State.robustlyCalcPosterior(Unknown Source) at beast.core.MCMC.robustlyCalcPosterior(Unknown Source) at beast.inference.PathSamplingStep.run(Unknown Source) at beast.app.BeastMCMC.run(Unknown Source) at beast.app.beastapp.BeastMain.(Unknown Source) at beast.app.beastapp.BeastMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at beast.app.beastapp.BeastLauncher.run(Unknown Source) at beast.app.beastapp.BeastLauncher.main(Unknown Source) Fatal exception: Cannot invoke "beast.evolution.tree.Node.isLeaf()" because "" is null java.lang.RuntimeException: An error was encounted. Terminating BEAST at beast.app.util.ErrorLogHandler.publish(Unknown Source) at java.logging/java.util.logging.Logger.log(Logger.java:980) at java.logging/java.util.logging.Logger.doLog(Logger.java:1007) at java.logging/java.util.logging.Logger.log(Logger.java:1030) at java.logging/java.util.logging.Logger.severe(Logger.java:1777) at beast.app.beastapp.BeastMain.(Unknown Source) at beast.app.beastapp.BeastMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at beast.app.beastapp.BeastLauncher.run(Unknown Source) at beast.app.beastapp.BeastLauncher.main(Unknown Source)

Loading /tmp715/OneSp//step0/likelihood.logFile error: \tmp715\OneSp\step0\likelihood.log (系统找不到指定的文件。) java.lang.RuntimeException: An error was encounted. Terminating BEAST at beast.app.util.ErrorLogHandler.publish(Unknown Source) at java.logging/java.util.logging.Logger.log(Logger.java:980) at java.logging/java.util.logging.Logger.doLog(Logger.java:1007) at java.logging/java.util.logging.Logger.log(Logger.java:1030) at java.logging/java.util.logging.Logger.severe(Logger.java:1777) at beast.app.beastapp.BeastMain.(Unknown Source) at beast.app.beastapp.BeastMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at beast.app.beastapp.BeastLauncher.run(Unknown Source) at beast.app.beastapp.BeastLauncher.main(Unknown Source)

zyy-1111 avatar Jul 16 '24 04:07 zyy-1111