ropensci / babette

babette is an R package to work with BEAST2
https://docs.ropensci.org/babette
GNU General Public License v3.0
44 stars 6 forks source link

Babette with beauti 2.6 #106

Closed thijsjanzen closed 4 months ago

thijsjanzen commented 1 year ago

It seems like babette no longer correctly formats an XML file for beauti 2.6:

mrca_pr <- beautier::create_mrca_prior(taxa_names = beautier::get_taxa_names(fasta_filename),
                                       is_monophyletic = TRUE,
                                       mrca_distr = beautier::create_distr_normal(mean = 66, sigma = 1))

inf_model <- beautier::create_inference_model(tree_prior = beautier::create_bd_tree_prior(),
                                              clock_model = beautier::create_clock_model_rln(mean_clock_rate = ),
                                              mcmc = beautier::create_mcmc(chain_length = 1e6,
                                                                           store_every = sample_interval),
                                              mrca_prior = mrca_pr,
                                              beauti_options = beautier::create_beauti_options_v2_6())

beast_result <- babette::bbt_run_from_model(fasta_filename = fasta_filename,
                                            inference_model = inf_model,
                                            beast2_options = beastier::create_beast2_options(rng_seed = 42))

gives the error message:

Error in beastier::check_input_filename_validity(beast2_options) : 'input_filename' must be a valid BEAST2 XML file. File 'C:\Users\P251362\AppData\Local\beastier\beastier\Cache\beast2_1d2448cd7d78.xml' is not a valid BEAST2 file. FALSE

Which upon investigation is caused by:

Running command: 'C:\Program Files\Java\jre-1.8\bin\java.exe -cp C:\Users\P251362\AppData\Local\BEAST\lib\beast.jar beast.app.beastapp.BeastLauncher -validate C:\Users\P251362\AppData\Local\beastier\beastier\Cache\beast2_1d247a863c66.xml' BEAST v2.6.0, 2002-2019 Bayesian Evolutionary Analysis Sampling Trees Designed and developed by Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard Centre for Computational Evolution University of Auckland [r.bouckaert@auckland.ac.nz](mailto:r.bouckaert@auckland.ac.nz)  [alexei@cs.auckland.ac.nz](mailto:alexei@cs.auckland.ac.nz)  Institute of Evolutionary Biology University of Edinburgh [a.rambaut@ed.ac.uk](mailto:a.rambaut@ed.ac.uk)  David Geffen School of Medicine University of California, Los Angeles [msuchard@ucla.edu](mailto:msuchard@ucla.edu)  Downloads, Help & Resources: http://beast2.org/  Source code distributed under the GNU Lesser General Public License: http://github.com/CompEvol/beast2  BEAST developers: Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie Thanks to: Roald Forsberg, Beth Shapiro and Korbinian StrimmerRandom number seed: 1699018260867File: beast2_1d247a863c66.xml seed: 1699018260867 threads: 1Loading package BEAST v2.6.7Loading package BEASTLabs v1.9.7Loading package MODEL_SELECTION v1.5.3Loading package NS v1.1.0Loading package SA v2.0.2Error 1017 parsing the xml input fileClass could not be found. Did you mean beast.evolution.likelihood.ThreadedTreeLikelihood?Perhaps a package required for this class is not installed?Error detected about here: <beast> <run id='mcmc' spec='MCMC'> <distribution id='posterior' spec='util.CompoundDistribution'> <distribution id='likelihood' spec='util.CompoundDistribution'> <distribution id='treeLikelihood.primates' spec='ThreadedTreeLikelihood'>

Error 1017, according to the BEAST group, is typically caused by a typo in the XML.

The error does not arise when I drop the beauti_options from the inference model - but then the mrca prior is no longer supported

richelbilderbeek commented 1 year ago

@thijsjanzen yes, you are right. Thanks for sharing!

I am working on the fix, problem is caused by beautier/beastier/babette/mcbette/pirouette dependencies and changes :-/, it may be slow due to that ...

richelbilderbeek commented 1 year ago

Note to self: this is a regression of #29

[edit from future: those failing tests work again too now :-) ]

richelbilderbeek commented 8 months ago

Hi @thijsjanzen, I've been quicker to fix bugs, but I think I did it. Update beautier to v2.6.12 and it should work correctly.

Could you confirm? Would be awesome!

richelbilderbeek commented 4 months ago

I assume this is fixed :-)