java.lang.ArrayIndexOutOfBoundsException: -1 error

1,122 views
Skip to first unread message

Natalia

unread,
Oct 20, 2015, 1:22:15 PM10/20/15
to beast-users
hello,
I am trying to set up an xml file using the Lewis Mk model for multistate characters (number of states vary from 2 to 7). I am using Beast 1.8.2.  The run seems to be ready to start when it crashes giving the following error: 

Creating the MCMC chain:
  chainLength=10000000
  autoOptimize=true
  autoOptimize delayed for 100000 steps
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at dr.inference.model.CompoundLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.model.CompoundLikelihood.evaluateLikelihoods(Unknown Source)
at dr.inference.model.CompoundLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.markovchain.MarkovChain.evaluate(Unknown Source)
at dr.inference.markovchain.MarkovChain.<init>(Unknown Source)
at dr.inference.mcmc.MCMC.init(Unknown Source)
at dr.inference.mcmc.MCMC.init(Unknown Source)
at dr.inferencexml.MCMCParser.parseXMLObject(Unknown Source)
at dr.xml.AbstractXMLObjectParser.parseXMLObject(Unknown Source)
at dr.xml.XMLParser.convert(Unknown Source)
at dr.xml.XMLParser.convert(Unknown Source)
at dr.xml.XMLParser.parse(Unknown Source)
at dr.app.beast.BeastMain.<init>(Unknown Source)
at dr.app.beast.BeastMain.main(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at dr.evomodel.treelikelihood.GeneralLikelihoodCore.calculateStatesPartialsPruning(Unknown Source)
at dr.evomodel.treelikelihood.AbstractLikelihoodCore.calculatePartials(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.calculateLogLikelihood(Unknown Source)
at dr.evomodel.treelikelihood.AbstractTreeLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.model.CompoundLikelihood$LikelihoodCaller.call(Unknown Source)
at dr.inference.model.CompoundLikelihood$LikelihoodCaller.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thre# BEAST v1.8.2, r6687
# Generated Tue Oct 20 19:01:31 CEST 2015 [seed=1445360475531]
state Posterior   Prior       Likelihood   rootHeight   clock.rate  
ad.run(Unknown Source)
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at dr.inference.model.CompoundLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.model.CompoundLikelihood.evaluateLikelihoods(Unknown Source)
at dr.inference.model.CompoundLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.markovchain.MarkovChain.evaluate(Unknown Source)
at dr.inference.markovchain.MarkovChain.runChain(Unknown Source)
at dr.inference.mcmc.MCMC.chain(Unknown Source)
at dr.inference.mcmc.MCMC.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at dr.evomodel.treelikelihood.GeneralLikelihoodCore.calculateStatesPartialsPruning(Unknown Source)
at dr.evomodel.treelikelihood.AbstractLikelihoodCore.calculatePartials(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.calculateLogLikelihood(Unknown Source)
at dr.evomodel.treelikelihood.AbstractTreeLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.model.CompoundLikelihood$LikelihoodCaller.call(Unknown Source)
at dr.inference.model.CompoundLikelihood$LikelihoodCaller.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more


and finally ends with 

... 1 more
Exception in thread "Thread-6" java.lang.ArrayIndexOutOfBoundsException: -1
at dr.evomodel.treelikelihood.GeneralLikelihoodCore.calculateStatesPartialsPruning(Unknown Source)
at dr.evomodel.treelikelihood.AbstractLikelihoodCore.calculatePartials(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.traverse(Unknown Source)
at dr.evomodel.treelikelihood.TreeLikelihood.calculateLogLikelihood(Unknown Source)
at dr.evomodel.treelikelihood.AbstractTreeLikelihood.getLogLikelihood(Unknown Source)
at dr.inference.model.AbstractModelLikelihood$LikelihoodColumn.getDoubleValue(Unknown Source)
at dr.inference.loggers.NumberColumn.getFormattedValue(Unknown Source)
at dr.inference.loggers.LogColumn$Abstract.getFormatted(Unknown Source)
at dr.inference.loggers.MCLogger.getColumnFormatted(Unknown Source)
at dr.inference.loggers.MCLogger.log(Unknown Source)
at dr.inference.mcmc.MCMC$1.currentState(Unknown Source)
at dr.inference.markovchain.MarkovChain.fireCurrentModel(Unknown Source)
at dr.inference.markovchain.MarkovChain.runChain(Unknown Source)
11.035 seconds 

at dr.inference.mcmc.MCMC.chain(Unknown Source)
at dr.inference.mcmc.MCMC.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Does anybody have any idea on what can have gone wrong? I am attaching the xml file too.

thank you very much,
Natalia



ChapMultistate.xml

Natalia

unread,
Oct 22, 2015, 5:20:20 AM10/22/15
to beast-users
Hello again,
I managed to find the problem. It had nothing to do with the BEAST part of things. The error was caused because a 3-state character was included by mistake among my 2-state characters.
Natalia

Damien Hinsinger

unread,
Oct 22, 2015, 9:32:14 AM10/22/15
to beast-users
Hello,
I'm facing the same problem, but with an analysis I would like to resume. I tried with BEAST 2.3.1, 2.3.0, always the same message, even if I increase the memory.
Any help would be appreciate, in order to finish this analysis :-)
Bests, Damien

Natalia Chousou-Polydouri

unread,
Oct 22, 2015, 9:44:11 AM10/22/15
to beast...@googlegroups.com
Hello Damien,
Are you sure there is the same code after the error message (-1)? When I was searching through the forum for my error, I found a lot of other similar looking error messages but with different numbers, such as java.lang.ArrayIndexOutOfBoundsException: 45.
i hope you find a solution soon,
Natalia

--
You received this message because you are subscribed to a topic in the Google Groups "beast-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beast-users/zJ3p2j-G66o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Andrew Rambaut

unread,
Oct 22, 2015, 9:58:26 AM10/22/15
to beast...@googlegroups.com
Damien,

java.lang.ArrayIndexOutOfBoundsException is a very general Java error that may have many causes so you will need to give more information about what the problem is.

Best,
Andrew

You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.

Damien Hinsinger

unread,
Oct 23, 2015, 7:35:18 PM10/23/15
to beast-users
Thank you for your answer.
after the BEAST run finished, I launched it again to increase ESS.
Here is the end of the starting log:

... 
ScaleOperator(ucedMeanScaler.c:RAG_Esox_aligned_1)                      0,4093    1212123    3714429     0,0050     0,2460 
UpDownOperator(relaxedUpDownOperatorExp.c:RAG_Esox_aligned_1)           0,9678    2533192   12235243     0,0150     0,1715 
     Tuning: The value of the operator's tuning parameter, or '-' if the operator can't be optimized.
    #accept: The total number of times a proposal by this operator has been accepted.
    #reject: The total number of times a proposal by this operator has been rejected.
      Pr(m): The probability this operator is chosen in a step of the MCMC (i.e. the normalized weight).
  Pr(acc|m): The acceptance probability (#accept as a fraction of the total proposals for this operator).
Start likelihood: -6123.539141218066 
java.lang.ArrayIndexOutOfBoundsException: 1
at beast.core.Logger.openLogFile(Unknown Source)
at beast.core.Logger.init(Unknown Source)
at beast.core.MCMC.run(Unknown Source)
at beast.app.BeastMCMC.run(Unknown Source)
at beast.app.beastapp.BeastMain.<init>(Unknown Source)
at beast.app.beastapp.BeastMain.main(Unknown Source)
at beast.app.beastapp.BeastLauncher.main(Unknown Source)

I realize that the error code is "1", not "-1"...
Thank you in advance for any help, Damien

Tim Vaughan

unread,
Oct 25, 2015, 11:03:30 PM10/25/15
to beast-users
Hi Damien,  it looks like BEAST is having trouble opening the log file that you're trying to resume.  Are there by any chance spaces in the name of this file?  It may be that these are causing problems.

Tim

Damien Hinsinger

unread,
Oct 29, 2015, 9:40:08 AM10/29/15
to beast-users
Thank you for your reply, but there is no spaces in the names...
I noted that each time I restart BEAST, a new file appears, with the same name as my tree file (name_tree.trees), bu with a .bu at the end. If it could help...
Damien
Reply all
Reply to author
Forward
0 new messages