BEAST 1.10.4 EBSP Error parsing '<scaleOperator>' element with id, 'null'

1,657 views
Skip to first unread message

Tim McInerney

unread,
Jan 2, 2019, 9:37:04 PM1/2/19
to beast-users
Hi all, I am attempting to run BEAST 1.10.4 to perform extended Bayesian skyline plot analyses using the following command:

beast -working -threads 4 -beagle -save_every 100000 -save_state chr22_block111_saved chr22_block111.xml

However, I am hitting this error:

        BEAST v1.10.4 Prerelease #bc6cbd9, 2002-2018

       Bayesian Evolutionary Analysis Sampling Trees

                 Designed and developed by

   Alexei J. Drummond, Andrew Rambaut and Marc A. Suchard

                              

               Department of Computer Science

                   University of Auckland

                  ale...@cs.auckland.ac.nz

                              

             Institute of Evolutionary Biology

                  University of Edinburgh

                     a.ra...@ed.ac.uk

                              

              David Geffen School of Medicine

           University of California, Los Angeles

                     msuc...@ucla.edu

                              

                Downloads, Help & Resources:

                  http://beast.community

                              

Source code distributed under the GNU Lesser General Public License:

          http://github.com/beast-dev/beast-mcmc

                              

                     BEAST developers:

Alex Alekseyenko, Guy Baele, Trevor Bedford, Filip Bielejec, Erik Bloomquist, Matthew Hall,

Joseph Heled, Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li,

Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel,

          Oliver Pybus, Chieh-Hsi Wu, Walter Xie

                              

                         Thanks to:

    Roald Forsberg, Beth Shapiro and Korbinian Strimmer


Using BEAGLE library v3.1.2 for accelerated, parallel likelihood evaluation

2009-, BEAGLE Working Group - https://beagle-dev.github.io/

Citation: Ayres et al (2012) Systematic Biology 61: 170-173 | doi:10.1093/sysbio/syr100



Random number seed: 1546482656257



Loading additional development parsers from development_parsers.properties, which is additional set of parsers only available for development version ...

Parsing XML file: chr22_block111.xml

  File encoding: UTF8

Looking for plugins in /Volumes/TimMcInerney/1000_Genomes_Test/raijin/analyses/seqs_from_blocks/testBEAST_2018-01-03/plugins


Read alignment: alignment

  Sequences = 206

      Sites = 36249

   Datatype = nucleotide

Site patterns 'patterns' created from positions 1-36249 of alignment 'alignment'

  unique pattern count = 116


Creating the tree model, 'treeModel'

  taxon count = 206

  tree height = 335.01242104095024

Variable demographic: linear control points

INFO: resetting length of parameter demographic.popSize(size 1) in variable demographic model to 206

INFO: resetting length of parameter demographic.indicators in variable demographic model to 205


Using strict molecular clock model.


Creating state frequencies model 'frequencies': Using empirical frequencies from data = {0.34153, 0.18421, 0.19482, 0.27944}


Creating HKY substitution model. Initial kappa = 2.0


Creating site rate model: 

  10 category discrete gamma with initial shape = 0.5

  initial proportion of invariant sites = 0.5


Using BEAGLE DataLikelihood Delegate

  Using BEAGLE resource 0: CPU

    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_CPP PROCESSOR_CPU FRAMEWORK_CPU

  Ignoring ambiguities in tree likelihood.

  With 116 unique site patterns.

  Using rescaling scheme : dynamic (rescaling every 100 evaluations, delay rescaling until first overflow)


Using TreeDataLikelihood

  Branch rate model used: strictClockBranchRates

Jan 03, 2019 1:30:58 PM dr.app.beast.BeastMain <init>

SEVERE: Parsing error - poorly formed BEAST file, chr22_block111.xml:

Error parsing '<scaleOperator>' element with id, 'null':

Scale operator can only be used on parameters constrained to be strictly positive or negative (demographic.popSize)


Error thrown at: dr.inferencexml.operators.ScaleOperatorParser.parseXMLObject(Unknown Source)


I tried the fix found here (https://groups.google.com/forum/#!topic/beast-users/yaRk7HFU15I), however no luck.


(Also just tried to attach the XML file, but it is too large. I can email this to you if requested)


Thank you in advance,

Tim McI

carlo pacioni

unread,
Jan 6, 2019, 9:54:51 PM1/6/19
to beast-users
Hi Tim,
what was is worth, I think that the scale operator for demographic.popSize is correct. I can replicate your error (with made up data) despite the element demographic.popSize has been declared correctly earlier in the xml file, so I'm not sure what's causing the error.

carlo

Andrew Rambaut

unread,
Jan 7, 2019, 7:33:19 AM1/7/19
to beast...@googlegroups.com, Tim McInerney
This error occurs if the scale operator is used on a parameter that doesn't have a non-negative lower bound or a non-positive upper bound. This is because if the parameter can be negative or positive then using a scale operator is incorrect (a random walk operator would then be appropriate). 

Can you post the bit of the XML that defines the popSize parameter?

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.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Carlo Pacioni

unread,
Jan 7, 2019, 7:03:45 PM1/7/19
to beast...@googlegroups.com
Hi Andrew,
Thanks for clarifying this.
Attached is the 'made-up' xml I tested. I imported the data, unlinked the trees and clocks, changed the tree prior to EBSP and generated the xml. Hence, this xml should have all default settings from BEAUti 1.10.4.

carlo

EBSP_test_bis.xml

Andrew Rambaut

unread,
Jan 7, 2019, 7:56:37 PM1/7/19
to beast...@googlegroups.com
Hi Carlo,

This looks like it may be a bug in BEAUti. To fix the xml look for:

<parameter id="initialDemo.popSize" value="100.0”/>

and add the lower bound:

<parameter id="initialDemo.popSize” lower=“0.0” value="100.0"/>

Andrew

<EBSP_test_bis.xml>


Andrew Rambaut

unread,
Jan 7, 2019, 7:58:22 PM1/7/19
to beast...@googlegroups.com
Sorry I meant look for:

<parameter id="demographic.popSize" value="1.0"/>

and add the lower bound:

<parameter id="demographic.popSize” lower=“0.0” value=“1.0"/>

Andrew

Carlo Pacioni

unread,
Jan 7, 2019, 9:19:00 PM1/7/19
to beast...@googlegroups.com
thanks Andrew.

carlo

Tim McInerney

unread,
Jan 7, 2019, 9:40:44 PM1/7/19
to beast-users
Hi Andrew,

Please find attached the .xml file (I didn't try to compress it last time, for whatever reason, but I'll blame the silly season!)

I wont be at a computer with access to beast for a few days, but I'll try the work around you and Carlo posted.
Thank you very much!

Tim
chr22_block111.xml.zip

Tim McInerney

unread,
Jan 8, 2019, 10:52:39 PM1/8/19
to beast-users
Hi Carlo and Andrew,

I've tried the <parameter id="demographic.popSize” lower=“0.0” value=“1.0"/> suggestion, however I'm still getting this error thrown:

Using TreeDataLikelihood

  Branch rate model used: strictClockBranchRates

Jan 09, 2019 2:51:25 PM dr.app.beast.BeastMain <init>

SEVERE: Parsing error - poorly formed BEAST file, chr22_block111.xml:

Error parsing '<scaleOperator>' element with id, 'null':

Scale operator can only be used on parameters with an infinite upper or lower bound (use a RandomWalk) (demographic.popSize)


Error thrown at: dr.inferencexml.operators.ScaleOperatorParser.parseXMLObject(Unknown Source)


Any suggestions? Updated XML attached
chr22_block111.xml.zip

Andrew Rambaut

unread,
Jan 9, 2019, 5:39:14 AM1/9/19
to beast...@googlegroups.com
Hi Tim,

I fixed the issue in the current development code. You can get it from the GitHub:


Or on the mac, install using HomeBrew. For HomeBrew use `brew install --HEAD beast` to install the current developers version.

There was other issue with your XML - the <priors> section had two instances of the following line:

<coalescentLikelihood idref="coalescent"/>
<coalescentLikelihood idref="coalescent"/>

Was this produced by BEAUti (in which case it is another bug in BEAUti to fix) or could it have happened during editing?

Andrew


<chr22_block111.xml.zip>

Marc Suchard

unread,
Jan 9, 2019, 9:44:49 AM1/9/19
to beast-users

Hi all -- 

I believe this error is arising inside the Java class `VariableDemographicModel` in the code lines:

```
if (popSizes != events) {

System.err.println("INFO: resetting length of parameter " + popSizeParameter.getParameterName() +
"(size " + popSizeParameter.getSize() + ") in variable demographic model to " + events);
popSizeParameter.setDimension(events);
popSizeParameter.addBounds(new Parameter.DefaultBounds(Double.MAX_VALUE, -Double.MAX_VALUE, popSizeParameter.getDimension()));
}
```

Here `events` is set to a value > 1 while the length of the population-size parameter in the XML is 1.

best, Marc



Andrew Rambaut

unread,
Jan 9, 2019, 10:19:35 AM1/9/19
to beast...@googlegroups.com
Hi Marc,

The issue here was setting the upper bound of the parameter to a finite value (Double.MAX_VALUE) which the scale operator doesn’t like. Changing this line to 

   popSizeParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, popSizeParameter.getDimension()));

fixes the issue. 

The length of the pop-size parameter is dynamically set (if .setDimension(x) is called on a parameter of dimension 1 then it is expanded to length x).

Andrew


Tim McInerney

unread,
Jan 14, 2019, 6:07:50 PM1/14/19
to beast-users
Hi Andrew,

Apologies I've just been away for a few days. Internet is a bit slow where I am at the moment, but I'm downloading the developers BEAST at the moment.
The double line for coalescentLikelihood idref="coalescent"/> would be a BEAUti issue, I've only modified the lines mentioned above.

I will let you know how it goes.

Thank you for all your help, its greatly appreciated!
Tim

Tim McInerney

unread,
Jan 14, 2019, 6:19:36 PM1/14/19
to beast-users
Hi Andrew,

Okay the problem is fixed. I've attached two XMLs (marked good and bad).
Around liens 1507 I deleted the duplicate <coalescentLikelihood idref="coalescent"/>
This bug was generated by BEAUti 1.10.5 pre-release

Thanks,
Tim

On Wednesday, 9 January 2019 21:39:14 UTC+11, rambaut wrote:
chr22_block111_BEAUti1-10-5_GOODnBAD.zip

Sere Bix

unread,
Jul 12, 2019, 10:18:00 AM7/12/19
to beast-users
Hi all,
I revive this thread since I run into the same error but for a different reason.
I set

<strictClockBranchRates id="branchRates">
     <rate>
         <parameter id="clock.rate" value="1E-3" lower="1E-5" upper="1E-2" />
     </rate>
</strictClockBranchRates>

To restrain the clockrate into fixed boundaries. For this case I got the

Scale operator can only be used on parameters with an infinite upper or lower bound (use a RandomWalk)
error.

When I exclude the lower boundarie and set it like this:

<strictClockBranchRates id="branchRates">
     <rate>
         <parameter id="clock.rate" value="1E-3" upper="1E-2" />
     </rate>
</strictClockBranchRates>

I get the
Scale operator can only be used on parameters constrained to be strictly positive or negative
error.

Do I have to change my approch to fix the clockrate into specific bounds or is this too due the BEAUTI-bug?

All the best,
Sere


Andrew Rambaut

unread,
Jul 12, 2019, 10:28:32 AM7/12/19
to beast...@googlegroups.com
Dear Sere,

Generally we no longer put bounds on parameters in this way but set a prior on them. In BEAUti you can set a uniform prior between boundaries to replicate what you are trying to do below. Add this to the <prior> section:

<uniformPrior lower="1E-5" upper="1E-2”>
<parameter idref=“clock.rate”/>
</uniformPrior>


However, generally I wouldn’t advise a uniform prior like this as it is unlikely to really represent your prior belief, I think? If you are trying to insert information about the rate, then a normal or lognormal prior is likely to be more appropriate.

Andrew


For more options, visit https://groups.google.com/d/optout.

Andrew Rambaut 
Institute for Evolutionary Biology 
Ashworth Laboratories, University of Edinburgh, Edinburgh, EH9 3FL, UK


Message has been deleted

Sere Bix

unread,
Jul 12, 2019, 11:03:29 AM7/12/19
to beast-users
Dear Andrew,
Thanks for the fast answer!
In my analysis I use a hierarchical phylogenetic model over the clock rates but in a test run with an empty alignment (sample from prior only), we got clock rates in the range of 20 to 1E7, which is absurd. This lead me to the conclusion, that a) the settings for the HPM are improper or b) the system has to much freedom.
To check if its b) I tried to restrict the clock rate with the above line of code since the HPM don't have a option (as far as I know) to set boundaries.

I work with virus data and know that the clock rate should be somewhat around 1E-3 to 1E-4
Any idea how I can bypass or solve this?

All the best,
Sere

Sere Bix

unread,
Aug 8, 2019, 10:05:22 AM8/8/19
to beast-users
I am still stuck on this strange behaviour when using a HPM. Any input is welcome in that matter. Its also just to rule out any error when using the "sample prior only" feature.

ZHAO Helen

unread,
Dec 23, 2019, 7:05:32 AM12/23/19
to beast-users

Dear Andrew,

I ran into the same error message - parsing '<scaleOperator>' element with id, 'null'. I tried with your proposed solution, changed to <parameter id="demographic.popSize” lower=“0.0” value=“1.0"/>. I got new error message:

Open quote is expected for attribute "lower" associated with an element type  "parameter"

Do you have any suggestions on how to fix it?

Thank you very much!

Many greetings,

Helen


在 2019年1月8日星期二 UTC+8上午8:58:22,rambaut写道:
Andrew

To unsubscribe from this group and stop receiving emails from it, send an email to beast...@googlegroups.com.

To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.

To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.

Andrew Rambaut

unread,
Dec 23, 2019, 7:10:50 AM12/23/19
to beast...@googlegroups.com
It sounds like the “ character is a non-standard character. What software are you using to edit the file?

Andrew

Sent from my phone. Apologies for brevity or illiteracy. 

On 23 Dec 2019, at 12:05, 'ZHAO Helen' via beast-users <beast...@googlegroups.com> wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/98356524-b1b5-4cc8-a805-3ac5e736c095%40googlegroups.com.

Andres Felipe Jaramillo

unread,
Jan 6, 2020, 4:59:20 PM1/6/20
to beast-users
Hi Andrew,

sorry for revive this thread. I have similiar error of Tim with the difference that is related with 'treeModel.rootHeight': 

BEAST has terminated with an error. Please select QUIT from the menu.

Jan 06, 2020 4:08:22 PM dr.app.beast.BeastMain <init>

SEVERE: Parsing error - poorly formed BEAST file, concatenated new2.xml:
Error parsing '<scaleOperator>' element with id, 'null':
Scale operator can only be used on parameters where all elements are strictly positive or negative (treeModel.rootHeight)

Error thrown at: dr.inferencexml.operators.ScaleOperatorParser.parseXMLObject(Unknown Source)


I tired to find in which line of xlm file need to incorporate the lower value (like the solution of Tim), but no luck

I attach the xml

Thank you in advance 

To unsubscribe from this group and stop receiving emails from it, send an email to beast...@googlegroups.com.
Salamander.xml

Cathy

unread,
Feb 4, 2020, 2:03:48 PM2/4/20
to beast-users
Hi Andrew,

I got a same problem as Andres: Scale operator can only be used on parameters where all elements are strictly positive or negative (treeModel.rootHeight).

However, I used a normal prior for the rootHeight and truncated at 0, so there are no negative values. I don't know how to fix it.


Jamie Thompson

unread,
Jun 21, 2020, 8:53:57 PM6/21/20
to beast-users
Hiya,

Did you resolve this issue?  I've had this issue on two separate analyses and not been able to resolve it.

Jamie

Jamie Thompson

unread,
Jun 29, 2020, 3:12:28 PM6/29/20
to beast-users
Hi Andres,

Did you manage to resolve this issue?  I have exactly the same with tree root height, I am tearing my hair out and no one has replied to threads I've opened on here.

Best wishes,
Jamie

Andrew Rambaut

unread,
Jul 1, 2020, 8:20:33 AM7/1/20
to noreply-spamdigest via beast-users
Hi Jamie,

If you change the scale operator to this:

<scaleOperator scaleFactor="0.75" scaleAll="true" ignoreBounds="true" weight="3">

(i.e., add the ignoreBounds="true") it should fix it. 

The preview release of 10.1.5 will generate this code correctly:


We intended to release this version a while back but got distracted by things - I will look in to what else needs doing for the release.

Andrew

To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/a3d2f492-5789-4104-a84c-f2d26732c1bdo%40googlegroups.com.

lokman galal

unread,
Mar 25, 2022, 4:48:45 PM3/25/22
to beast-users
Hello,

I have exactly the same problem with tree root height, and adding ignoreBounds="true" did not work for me.
 
I tried the latest versions of beast/beauti.

Lokman

lokman galal

unread,
Mar 25, 2022, 4:48:45 PM3/25/22
to beast-users
Hello Jamie,

Could you find a solution Jamie ? I have the same problem

thank you

Lokman

lokman galal

unread,
Mar 26, 2022, 1:09:03 PM3/26/22
to beast-users
I manage to initiate the run by removing the starting tree (using per default random tree)

peterpan10

unread,
Sep 29, 2024, 2:30:07 PM9/29/24
to beast-users
you can keep the starting tree if you select 'tree prior only' for the prior distribution on the root height.
Reply all
Reply to author
Forward
0 new messages