FixedTreeAnalysis with starting tree

74 views
Skip to first unread message

Frasella De Martino

unread,
May 22, 2024, 8:13:30 PMMay 22
to beast-users
Hi all,

I'm trying to run an analysis providing a starting tree, but I encounter the following error: 

Error 1017 parsing the xml input file

Class could not be found. Did you mean beast.base.evolution.tree.TreeParser?
Perhaps a package required for this class is not installed?

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <init id='NewickTree.t:COI' spec='beast.util.TreeParser'>

at beast.base.parser.XMLParser.createObject(Unknown Source)
at beast.base.parser.XMLParser.parseInputs(Unknown Source)
at beast.base.parser.XMLParser.createObject(Unknown Source)
at beast.base.parser.XMLParser.parseRunElement(Unknown Source)
at beast.base.parser.XMLParser.parse(Unknown Source)
at beast.base.parser.XMLParser.parseFile(Unknown Source)
at beastfx.app.beast.BeastMCMC.parseArgs(Unknown Source)
at beastfx.app.beast.Controller$2.run(Unknown Source)

When I changed the spec from "beast.util.TreeParser" to "beast.base.evolution.tree.TreeParser" I got the following error: 

Error 110 parsing the xml input file

validate and intialize error: initAndValidate() failed! Cannot invoke "beast.base.evolution.tree.Node.isLeaf()" because "<parameter1>" is null

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <distribution id='posterior' spec='CompoundDistribution'>
              <distribution id='likelihood' spec='CompoundDistribution'>
                  <distribution id='treeLikelihood.COI' spec='ThreadedTreeLikelihood'>

I have run the .xml without specifying the initial tree and I have no problems.... Anyone has experienced the same issue or has an idea how to solve it?? If it is of any help I can provide the xml files

Thank you so much!

Best wishes, 
Frasella

higg...@gmail.com

unread,
May 22, 2024, 8:15:59 PMMay 22
to beast-users
Hi Frasella, 

A similar issue was reported yesterday (https://groups.google.com/g/beast-users/c/f9WLArFoZoo), but I have not been able to reproduce the problem.
If you can send me the XML I can have a look to see why this is happening.

Cheers, Remco

Frasella De Martino

unread,
May 23, 2024, 10:50:40 PMMay 23
to beast-users
Hi Remco, 

Sure, I have the .xml files here. Thank you so much for your help! 

Best, 
Frasella

higg...@gmail.com

unread,
May 23, 2024, 10:57:32 PMMay 23
to beast-users
Hi Frasella,

Thanks for the link -- "beast.util.TreeParser" is for BEAST v2.6 and earlier, while "beast.base.evolution.tree.TreeParser" should be used for BEAST v2.7.

However, with that change, and using BEAST v2.7.6, the XML starts in BEAST. Since the starting tree is not compatible with the time constraints (the starting tree has clades as a height that do not fit inside the uniform distribution intervals) BEAST gives up after 10 innitialisation attempts though.

Perhaps you can update to BEAST v2.7.6 and make sure the starting tree is compatible with the MRCA priors in the analysis.

Hope this helps,
Remco

Frasella De Martino

unread,
Jun 12, 2024, 4:20:01 PMJun 12
to beast-users
Hi Remco!

Sorry for the late reply, and thank you for point out the error in the starting tree topology! I have corrected this, and I'm already working on BEAST v2.7.6. With the revised .xml file, I'm getting the error "validate and intialize error: initAndValidate() failed! Cannot invoke "beast.base.evolution.tree.Node.isLeaf()" because "<parameter1>" is null". Is this still due to a incompatibly of the starting tree with the MRCA priors?  

The xml file can be found here and the full message of my run is the following: 

Running file C:\Users\frase.FRASELLA\Desktop\Haeterini\Arbol Calibrado\SpTree_Haeterini\Setup_Files\Cal_spHaeterini_50M_120624_StartTree.xml
File: Cal_spHaeterini_50M_120624_StartTree.xml seed: 4861341032548760451 threads: 1
Loading package BEAST.app v2.7.6 BEAST.base v2.7.6 BEASTLabs v2.0.2 CA v2.1.0 FastRelaxedClockLogNormal v1.2.0 FixedTreeAnalysis v0.0.2 MM v1.2.1 ORC v1.2.0 SA v2.1.1 SSM v1.2.0 starbeast2 v1.0.0 starbeast3 v1.1.8 TreeStat2 v0.1.1    
Alignment(Concatenado_Calibration)
  36 taxa
  1463 sites
  600 patterns

Filter 1-686
36 taxa
686 sites
309 patterns
Starting frequencies: [0.25, 0.25, 0.25, 0.25]
  UCRelaxedClockModel: using real rates for rate distribution across branches.
Failed to load BEAGLE library: no hmsbeagle64 in java.library.path: C:\Users\frase.FRASELLA\Downloads\Programs\BEAST\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Users\frase.FRASELLA\miniconda3\condabin;C:\Users\frase.FRASELLA\AppData\Local\Programs\Python\Launcher\;C:\Program Files\Geneious Prime;C:\Users\frase.FRASELLA\AppData\Local\Programs\Python\Python311e;C:\Users\frase.FRASELLA\AppData\Local\Microsoft\WindowsApps;C:\Users\frase.FRASELLA\AppData\Local\Microsoft\WindowsApps;C:\Users\frase.FRASELLA\.dotnet\tools;C:\Users\frase.FRASELLA\AppData\Roaming\TinyTeX\bin\windows;C:\rtools44;C:\Users\frase.FRASELLA\Downloads\Programs\BEAST\jre\bin;.
TreeLikelihood(treeLikelihood.COI0) uses BeerLikelihoodCore4
  FilteredAlignment(COI): [taxa, patterns, sites] = [36, 309, 686]
java.lang.NullPointerException: Cannot invoke "beast.base.evolution.tree.Node.isLeaf()" because "<parameter1>" is null
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.setStates(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.initCore(Unknown Source)
at beast.base.evolution.likelihood.TreeLikelihood.initAndValidate(Unknown Source)
at beast.base.core.BEASTInterface.initByName(Unknown Source)
at beast.base.evolution.likelihood.ThreadedTreeLikelihood.initAndValidate(Unknown Source)
at beast.base.parser.XMLParser.initBEASTObjects(Unknown Source)

at beast.base.parser.XMLParser.parse(Unknown Source)
at beast.base.parser.XMLParser.parseFile(Unknown Source)
at beastfx.app.beast.BeastMCMC.parseArgs(Unknown Source)
at beastfx.app.beast.Controller$2.run(Unknown Source)
java.lang.RuntimeException: initAndValidate() failed! Cannot invoke "beast.base.evolution.tree.Node.isLeaf()" because "<parameter1>" is null
at beast.base.core.BEASTInterface.initByName(Unknown Source)
at beast.base.evolution.likelihood.ThreadedTreeLikelihood.initAndValidate(Unknown Source)
at beast.base.parser.XMLParser.initBEASTObjects(Unknown Source)

at beast.base.parser.XMLParser.parse(Unknown Source)
at beast.base.parser.XMLParser.parseFile(Unknown Source)
at beastfx.app.beast.BeastMCMC.parseArgs(Unknown Source)
at beastfx.app.beast.Controller$2.run(Unknown Source)
beast.base.parser.XMLParserException:
Error 110 parsing the xml input file

validate and intialize error: initAndValidate() failed! Cannot invoke "beast.base.evolution.tree.Node.isLeaf()" because "<parameter1>" is null

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <distribution id='posterior' spec='CompoundDistribution'>
              <distribution id='likelihood' spec='CompoundDistribution'>
                  <distribution id='treeLikelihood.COI' spec='ThreadedTreeLikelihood'>

at beast.base.parser.XMLParser.initBEASTObjects(Unknown Source)

at beast.base.parser.XMLParser.parse(Unknown Source)
at beast.base.parser.XMLParser.parseFile(Unknown Source)
at beastfx.app.beast.BeastMCMC.parseArgs(Unknown Source)
at beastfx.app.beast.Controller$2.run(Unknown Source)


Thank you so much!! Sorry for all the trouble

higg...@gmail.com

unread,
Jun 12, 2024, 8:55:39 PMJun 12
to beast-users
Hi Frasella,

The starting tree is not a binary tree: it has some nodes that only have a single child. Below a binary form of the starting tree, which should help with the problem you encountered.
However, there is another problem: the starting tree is not compatible with the calibrations. One way around this is to replace the tree with a binary tree that is compatible. Another solution is to use "AlmostMRCAPrior"s instead of MRCAPrior. These can be found in the AlmostDistributions package (https://github.com/rbouckaert/AlmostDistributions) and search/replace beast.base.evolution.tree.MRCAPrior with almostbeast.math.distributions.AlmostMRCAPrior should fix this and make the XML start.

Cheers,

Remco

(((Pararge_aegeria:2.0,(Lethe_minerva:1.0,Bicyclus_anynana:1.0):1.0):1.0,((Oressinoma_sorata:1.0,Orsotriaena_medus:1.0):5.0,(Taygetis_virgilia:5.0,(Calisto_smintheus:4.0,(Manerebia_cyclopina:3.0,(Erebia_oeme:1.0,Satyrus_actaea:1.0):1.0):1.0):1.0):1.0):1.0):3.0,(((Aeropetes_tulbaghia:1.0,Melanitis_leda:1.0):2.0,((Brassolis_sophorae:1.0,Morpho_helenor:1.0):1.0,(Elymnias_casiphone:1.0,Zeuxidia_dorhni:1.0):1.0):1.0):7.0,(((((Haetera_macleannania:1.0,Haetera_piera:1.0):5.0,(Cithaerias_pireta:5.0,((((Cithaerias_cliftoni:1.0,Cithaerias_aurora:1.0):1.0,Cithaerias_aurorina:2.0):1.0,Cithaerias_pyropina:3.0):1.0,Cithaerias_andromeda:4.0):1.0):1.0):1.0,(Pseudohaetera_mimica:1.0,Pseudohaetera_hypaesia:1.0):6.0):1.0,Dulcedo_polita:8.0):1.0,(Pierella_lena:8.0,(Pierella_hyalinus:7.0,(Pierella_helvina:6.0,(Pierella_astyoche:5.0,(Pierella_hortona:4.0,(Pierella_nereis:3.0,(Pierella_luna:2.0,(Pierella_hyceta:1.0,Pierella_lamia:1.0):1.0):1.0):1.0):1.0):1.0):1.0):1.0):1.0):1.0):1.0):0.0;
Reply all
Reply to author
Forward
0 new messages