BEAST2 run terminates

1,229 views
Skip to first unread message

Leo R

unread,
Jun 2, 2015, 1:01:04 AM6/2/15
to beast...@googlegroups.com
Hello fellow Beast-users,

I am trying to generate a Coalescent Bayesian Skyline on BEAST2 with my data, but the run keeps terminating with the following error message:

java.lang.IllegalArgumentException: n must be positive

at beast.util.MersenneTwisterFast.nextInt(Unknown Source)

at beast.util.Randomizer.nextInt(Unknown Source)

at beast.evolution.operators.DeltaExchangeOperator.proposal(Unknown Source)

at beast.core.Operator.proposal(Unknown Source)

at beast.core.MCMC.doLoop(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)


I get this for many of the runs I have tried, and wonder if anyone knows what the problem could be? The set conditions have been attached for many of the terminated runs. 

Much thanks in advance!
Leo


















































































100000 autodetect smart yes PvMt_060215_FINALVERSIONS_MelOnly_270515.screen 100000 PvMt_060215_FINALVERSIONS_MelOnly_270515.trees 100000
BEASTRuns_DataSheet_Share_BEAST2Forum_020615.pdf

Remco Bouckaert

unread,
Jun 2, 2015, 3:05:31 PM6/2/15
to beast...@googlegroups.com
Hi Leo,

The delta exchange operator fails because it tries to exchange values on a parameter that has dimension 1, so it cannot find two values to exchange between. This may indicate the analysis is not set up as it should be. Probably the first thing to look for is the parameters that are used by any of the DeltaExchangeOperators in the analysis.

In the latest release (preview available here: https://github.com/CompEvol/beast2/releases/tag/v2.3.0-pre) the analysis won’t be halted by this problem any more.

Cheers,

Remco

--
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.
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.
<BEASTRuns_DataSheet_Share_BEAST2Forum_020615.pdf>

Leonie R

unread,
Jun 3, 2015, 12:30:10 AM6/3/15
to beast...@googlegroups.com
Thank you, Remco. I had a quick look.

These are the DeltaExchangeOperator values I have in all the analyses, both the failed and the older ones that worked. As they are the same across both, I am not sure if the issue lies with the DeltaExchangeOperator?:
<operator id="groupSizesDelta.t:AllPvMtAligned_SN 270515" integer="true" spec="DeltaExchangeOperator" weight="6.0">
        <intparameter idref="bGroupSizes.t:AllPvMtAligned_SN 270515"/>
    </operator>

    <operator delta="0.01" id="FrequenciesExchanger.s:AllPvMtAligned_SN 270515" spec="DeltaExchangeOperator" weight="0.1">
        <parameter idref="freqParameter.s:AllPvMtAligned_SN 270515"/>
    </operator>

--
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/NbzkeFZLTxQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.

Remco Bouckaert

unread,
Jun 8, 2015, 3:11:57 AM6/8/15
to beast...@googlegroups.com
Hi Leo,

The problem is that the dimension of the the parameters (here the group sizes parameter and frequency parameter) have a dimension of 1, which causes the problem, and I am concerned that this problem may be caused by a bug in BEAUti. I am happy to have a look at the XML if you send it, but in the mean time recommend upgrading to v2.3.0.

Cheers,

Remco

Leonie R

unread,
Jun 15, 2015, 4:39:22 AM6/15/15
to beast...@googlegroups.com
Hi Remco,

Upgraded to v2.3.0 but now facing a whole other set of bugs, including that beast v2.3.0 does not find my updated Java version and gives a warning that I am working with an older one, and beauti v. 2.3.0 can only upload xml files (which is not the case for the older version, which can import fasta alignments). Which basically means I get stuck on v2.3.0 from the very start, before even running an xml file...

Attached is one of the xml files that has been giving issues. Please do feel free to have a look. I hope you find something!

Cheers,
Leo
PvMt_MelSEAsia_HKY_CBS_StrictClock4En9_020615.xml

Remco Bouckaert

unread,
Jun 15, 2015, 5:07:38 PM6/15/15
to beast...@googlegroups.com
Hi Leo,

Looking at the file you posted, the mutation rate is estimated, but there is no timing information (like calibrations on clades, or tip dates) so the mutation rate is sampling from the prior (1/X in your case), which makes it very hard for the analysis to converge. Also, the mutation rate can become zero or infinity, which may have cause numerical problems and could explain the termination of the run.
 
If you keep the mutation rate fixed (e.g. by removing the mutationRateScaler from the XML, or in BEAUti by unchecking the estimate box in the Site Model panel next to substitution rate) it should run much better.

Are you running OSX? If so, there is a version of BEAST v2.3.0 which include a correct java version, which can be downloaded from here: 


Can you try and see whether it makes BEAUti start without the Java version warning?

Cheers,

Remco

<PvMt_MelSEAsia_HKY_CBS_StrictClock4En9_020615.xml>

Leonie R

unread,
Jun 16, 2015, 6:18:15 AM6/16/15
to beast...@googlegroups.com
Dear Remco,

Thank you for the advice and the link to BEAST v2.3.0. Sadly the latter is giving the exact same problem (BEAUti can only load xml files and crashes as soon as you load one, and BEAST gives the java error when opened in terminal and refuses to work, opened directly it crashes as soon as an xml file is loaded).

Will have a look at your suggestions regarding the mutation rate and get back to you on that. Just thought you should know v2.3.0 currently seems unstable in both BEAUti and BEAST.

Best wishes,
Leonie

Leonie R

unread,
Jun 18, 2015, 11:41:00 AM6/18/15
to beast...@googlegroups.com
Dear Remco,

Quick point for v2.3.0: I have Mavericks. That might be a reason for (some of) the issues?

On the other point: I have tried to tweak settings, and have also used an xml which is a combination of two parts of one BEAST tutorial. Short story: it does not work. Attached is the xml, and below is the error message given in Terminal.

Apologies for this endless story. Much thanks for all the help so far.

Best wishes,
Leo


Turning on scaling to prevent numeric instability 1.0201

Start likelihood: -56607.80979561096 

Writing file AllPvMtAligned_060215_EAsiaMel_GCC5_GTR_CBS_180615.log

Writing file AllPvMtAligned_060215_EAsiaMel_GCC5_GTR_CBS_180615.screen

Writing file AllPvMtAligned_060215_EAsiaMel_GCC5_GTR_CBS_180615.tree

PvMt_MelSEAsia_HKY_MR_CBS4En9_180615.xml

Remco Bouckaert

unread,
Jun 21, 2015, 4:24:32 PM6/21/15
to beast...@googlegroups.com
Hi Leo,

Thanks for the update — keep those details coming, there may be a clue at some point that makes it possible for me to figure out what is going on.

Looking at the file, I noticed both substitution rate and clock rate are set at 4.0E-9. The rate that is used is the product of these two, so it was set at 4.0E-9x4.0E-9=1.6e-17. The best way to think about the substitution rate is that it is a relative rate compared to other partitions. Since you only have one partition, it should be set at 1.0 and with that value the file runs.

Cheers,

Remco

<PvMt_MelSEAsia_HKY_MR_CBS4En9_180615.xml>

Leonie R

unread,
Jun 22, 2015, 5:15:29 AM6/22/15
to beast...@googlegroups.com
Hello Remco,

Thanks for that! I actually suddenly have a few files running, and the suggestion to remove the MutationRateScaler has helped. Though the issues started on a remote UNIX server, I decided to try the runs on my computer before going through with uploading them there. However, it appears my computer then added other issues. Files that do not run on my computer now run fine on the remote server, especially when fixing the mutation rates as suggested by you. Will be putting the information on failed and working files together to check for other errors.

Thanks for all the help so far.

Cheers,
Leo

Katie Moon

unread,
Jun 29, 2015, 4:10:12 AM6/29/15
to beast...@googlegroups.com
Hello Remco and Leo,

I am getting almost identical errors to Leo, except that my errors indicate an issue with the 'Node.Budger' rather than the DeltaExchangeOperator. I am trying to run my SNP data (with SNAPP xml file as input), but keep getting the same error. I (think I) have removed the MutationRateScaler as suggested above, but keep getting the following errors:

java.lang.IllegalArgumentException: n must be positive
at beast.util.MersenneTwisterFast.nextInt(Unknown Source)
at beast.util.Randomizer.nextInt(Unknown Source)
at snap.operators.NodeBudger.proposal(Unknown Source)
at beast.core.Operator.proposal(Unknown Source)
at beast.core.MCMC.doLoop(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)


When I delete the NodeSwapper section in the xml file I get this error:

java.lang.NullPointerException
at snap.operators.NodeSwapper.proposal(Unknown Source)
at beast.core.Operator.proposal(Unknown Source)
at beast.core.MCMC.doLoop(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 am trying to run a test of the data before I delineate the populations etc. but it is clear something is going wrong. The .log and .trees files created at the end of the run are empty of data.

This is a link to my SNAPP xml file (https://drive.google.com/file/d/0B8owYjISGJ3kQmhrbWlXRzNlVjQ/view?usp=sharing). Let me know if it doesnt work. In all likelihood, I am doing something wrong, but perhaps there is an easy fix? This is my first time using SNAPP data inputted into BEAST. I am using the BEAST 2.3.0 version. 

Cheers,
Katie

Remco Bouckaert

unread,
Jun 30, 2015, 2:15:23 AM6/30/15
to beast...@googlegroups.com
Hi Katie,

It appears that you only defined a single species in the file. SNAPP only runs with at least two species at the moment. To make the file run, you have to specify at least one more species in the ‘Species’ tab in BEAUti instead of only ‘PI’.

Cheers,

Remco

Katie Moon

unread,
Jun 30, 2015, 9:17:56 PM6/30/15
to beast...@googlegroups.com
Hi Remco,

Thank you for your quick reply! I have rerun BEAST using a SNAPP xml file where I identified multiple species rather than only 'PI'. However, I don't think I am getting any output. It appears as though the program removes the SNPs without data across all the samples, and no samples remain by the end of the process. Is this what is happening? Is it because I have 'missing' data in my SNPs (delineated with a '?')? Can I fix this? The original SNAPP xml file is available here ( https://drive.google.com/folderview?id=0B8owYjISGJ3kfjdWRFl4bE1tdWNnQXBqTFhLUHNuQlVyUzNPOHpNUHFrUnFHVjUzTVhRZG8&usp=sharing ). I have attached the .xml.state file (which seems to be filled with errors) and the .log and .trees files. 

Thank you so much.

Cheers,
Katie
Katie Moon

PhD Candidate 
Fenner School of Environment & Society, Australian National University
School of Biological Sciences, Monash University

Faculty of Science 
Bld 17, Rm 138A, School of Biological Sciences
Monash University, Clayton Campus, VIC 3800

Phone: 03 9905 0697  Email: katielo...@gmail.com 
BEAST Rerun with species
PhillipIslandTrial.xml.state
snap.log
snap.trees

Remco Bouckaert

unread,
Jul 1, 2015, 3:30:30 PM7/1/15
to beast...@googlegroups.com
Hi Katie,

Indeed the screen output says: "WARNING: removed 116490 patterns (116490 sites) becaues they have one or more branches without data.” SNAPP does not handle the case where all data for a species is missing, so it removes these sites. What is left is 826 patterns for 1525 sites, so that less than 1.5% of your original data. You might want to consider removing one or more of the species for which there is very little data.

I think the reason that you do not see output is that the number of lineages is quite large, which means it takes a long time to calculate a single step, and logging is only done once every 1000 or more steps. Calculation time is dominated by the number of sequences used, so if you reduce that number to say 40 and see how that works out, you can always add more once the analysis runs fine and you have some rough idea how fast it runs.

Cheers,

Remco


<BEAST Rerun with species><PhillipIslandTrial.xml.state><snap.log><snap.trees>

Julian W Tang

unread,
Jul 2, 2015, 6:37:26 AM7/2/15
to beast...@googlegroups.com
Hi Remco,

I'm just wondering where you are with the BEAST 2 book?

There seem to be a lot of issues with the software at the moment - are you delaying the publication of the book to deal with some of these?

Thanks,

Julian




From: higg...@gmail.com
Subject: Re: BEAST2 run terminates
Date: Thu, 2 Jul 2015 07:30:22 +1200
To: beast...@googlegroups.com

Remco Bouckaert

unread,
Jul 2, 2015, 4:27:30 PM7/2/15
to beast...@googlegroups.com
Hi Julian,

The manuscript is with the publisher at the moment, and last month we were told it should be printed later this month.

BEAST2 is a complex piece of software and so teething problems are not unexpected. We are working through the issues as fast as we can, but we are not delaying the publication of the book because of this.

Cheers,

Remco

Julian W Tang

unread,
Jul 2, 2015, 6:16:14 PM7/2/15
to beast...@googlegroups.com
Yes, Remco, I know this and also how long you've been working on this - and I will probably buy the book anyway to support you and Alexei, as always ;)

But there is a real practical issue here. If you are going to spend X $$ on a book, but find that the solution is no longer valid as published by the time the book comes out, and you have to ask for help on this beast-users site - then it may be easier (and cheaper) to do this from the start.

Your response times are so good that, I would probably just post or email you my query anyway - it is just easier.

So I guess that the book is just nice to dip into when you want more background on the theory, which is less likely to change as quickly as the software fixes...

Julian




From: higg...@gmail.com
Subject: Re: BEAST2 run terminates
Date: Fri, 3 Jul 2015 08:27:17 +1200
To: beast...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages