CompEvol / beast2

Bayesian Evolutionary Analysis by Sampling Trees
www.beast2.org
GNU Lesser General Public License v2.1
236 stars 83 forks source link

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

Open forianfinest opened 1 year ago

forianfinest commented 1 year ago

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

jordandouglas commented 1 year ago

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.

rbouckaert commented 1 year ago

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>
zyy-1111 commented 2 months ago

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)