Giter VIP home page Giter VIP logo

beastier's Introduction

beastier

Peer Review Status CRAN_Status_Badge Project Status: Active – The project has reached a stable, usable state and is being actively developed. DOI

Branch GitHub Actions logo Codecov logo
master R-CMD-check codecov.io
develop R-CMD-check codecov.io

beastier is an R package to run BEAST2.

beastier logo

beastier is part of the babette package suite:

Related R packages:

Install BEAST2

Due to CRAN policy, beastier cannot install BEAST2. As a workaround, the non-CRAN beastierinstall can be used.

To install BEAST2:

remotes::install_github("richelbilderbeek/beastierinstall")
beastierinstall::install_beast2()

Example for v2.1

Run BEAST2:

output_state_filename <- "out.state"

run_beast2(
  input_filename = get_beastier_path("2_4.xml"),
  output_state_filename = output_state_filename
)

This will create the files as specified in the 2_4.xml BEAST2 input file.

Example for v2.0.25

output_log_filename <- "out.log"
output_trees_filename <- "out.trees"
output_state_filename <- "out.state"

run_beast2(
  input_filename = get_beastier_path("2_4.xml"),
  output_log_filename = output_log_filename,
  output_trees_filenames = output_trees_filename,
  output_state_filename = output_state_filename
)

Note that in this version, the filenames for the .log and .trees files could be specified. This is unneeded: the 2_4.xml BEAST2 input file specifies where these files will be stored:

<?xml [...]?><beast [...]>

[...]

<run [...]>

    [...]

    <logger id="tracelog" fileName="test_output_0.log" [...]>
        [...]
    </logger>

    [...]

    <logger id="treelog.t:[...]" fileName="$(tree).trees" [...]>
        [...]
    </logger>
</run>
</beast>

When using beautier, this can be specified in create_mcmc:

create_mcmc(
  tracelog = create_tracelog(
    filename = "my_trace.log"
  ),
  treeslog = create_treeslog(
    filename = "my_trees.trees"
  )
)

See install.

See FAQ

Missing features/unsupported

beastier cannot do everything BEAST2 can.

  • Remove: install BEAST2, use beastierinstall
  • Experimental: Continue a BEAST2 run
  • Untested: Setup BEAGLE

There is a feature I miss

See CONTRIBUTING, at Submitting use cases

I want to collaborate

See CONTRIBUTING, at 'Submitting code'

I think I have found a bug

See CONTRIBUTING, at 'Submitting bugs'

There's something else I want to say

Sure, just add an Issue. Or send an email.

External links

Dependencies

Branch GitHub Actions logo Codecov logo
beautier master R-CMD-check codecov.io
beautier develop R-CMD-check codecov.io
beastierinstall master R-CMD-check codecov.io
beastierinstall develop R-CMD-check codecov.io
Branch AppVeyor logo
beastier_on_windows master Build status
beastier_on_windows develop Build status

References

Article about babette:

FASTA files anthus_aco.fas and anthus_nd2.fas from:

  • Van Els, Paul, and Heraldo V. Norambuena. "A revision of species limits in Neotropical pipits Anthus based on multilocus genetic and vocal data." Ibis.

ropensci_footer

beastier's People

Contributors

giappo avatar jeroen avatar olivroy avatar richelbilderbeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

giappo olivroy

beastier's Issues

Forbidden to download from https://github.com on CARL cluster

[edit by @richelbilderbeek: this Issue had nothing to do with beastier]

On a cluster (not peregrine), beastier::install_beast2 fails with:

downloaded 0 bytes

Error in utils::download.file(url = url, destfile = local_path) : 
  cannot download all files
In addition: Warning message:
In utils::download.file(url = url, destfile = local_path) :
  URL 'https://github-production-release-asset-2e65be.s3.amazonaws.com/15949777/195f6580-2aaa-11e9-9ba5-3f6739d075c1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190603%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190603T084329Z&X-Amz-Expires=300&X-Amz-Signature=4835b41670df45c54f9e07df88a37b62212f1903dcf942cd5d7c3b2302aa4605&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DBEAST.v2.5.2.Linux.tgz&response-content-type=application%2Foctet-stream': status was '403 Forbidden'

Idea: run BEAST2 in temporary folder?

Currently, BEAST2 is run in the working directory of the user, after which files are moved to temporary paths.

Perhaps using a temporary folder for BEAST2 simplifies things a lot.

BEAST2 .log file not created

Thanks @thijsjanzen for the bug report!

Re: BEAST op het cluster: nogmaalser

9 August 2019 14:22 111 KB
From: Janzen, T.
Met VERBOSE = TRUE:

inferring alternative trees

/data/p251362/nodeSub/no_extinct/shared/7 

working dir updated to: 

/home/p251362/.cache/file1d8d62a4db8a/7 

[1] "input_filename: /local/tmp/RtmpMFJNhH/file1d8d66a637bd7.xml"

[1] "output_log_filename: alternative.log"

[1] "output_trees_filenames: alternative.trees"

[1] "output_state_filename: /local/tmp/RtmpMFJNhH/file1d8d635b9521a.xml.state"

 [1] ""                                                                                

 [2] "                        BEAST v2.6.0, 2002-2019"                                 

 [3] "             Bayesian Evolutionary Analysis Sampling Trees"                      

 [4] "                       Designed and developed by"                                

 [5] " Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard"          

 [6] "                                    "                                            

 [7] "                   Centre for Computational Evolution"                           

 [8] "                         University of Auckland"                                 

 [9] "                       [email protected]"                               

[10] "                        [email protected]"                                

[11] "                                    "                                            

[12] "                   Institute of Evolutionary Biology"                            

[13] "                        University of Edinburgh"                                 

[14] "                           [email protected]"                                   

[15] "                                    "                                            

[16] "                    David Geffen School of Medicine"                             

[17] "                 University of California, Los Angeles"                          

[18] "                           [email protected]"                                    

[19] "                                    "                                            

[20] "                      Downloads, Help & Resources:"                              

[21] "                           http://beast2.org/"                                   

[22] "                                    "                                            

[23] "  Source code distributed under the GNU Lesser General Public License:"          

[24] "                   http://github.com/CompEvol/beast2"                            

[25] "                                    "                                            

[26] "                           BEAST developers:"                                    

[27] "   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, "            

[28] " Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, "          

[29] "Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, "        

[30] "          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie"                   

[31] "                                    "                                            

[32] "                               Thanks to:"                                       

[33] "          Roald Forsberg, Beth Shapiro and Korbinian Strimmer"                   

[34] ""                                                                                

[35] "Random number seed: 1565352693439"                                               

[36] ""                                                                                

[37] "File: file1d8d66a637bd7.xml seed: 1565352693439 threads: 1"                      

[38] "Loading package BEAST v2.6.0"                                                    

[39] "Loading package BEAST v2.6.0"                                                    

[40] "Alignment(temp)"                                                                 

[41] "  100 taxa"                                                                      

[42] "  1000 sites"                                                                    

[43] "  1000 patterns"                                                                 

[44] ""                                                                                

[45] "Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path"            

[46] "TreeLikelihood(treeLikelihood.temp0) uses BeerLikelihoodCore4"                   

[47] "  Alignment(temp): [taxa, patterns, sites] = [100, 1000, 1000]"                  

[48] "===============================================================================" 

[49] "Citations for this model:"                                                       

[50] ""                                                                                

[51] "Bouckaert, Remco, Timothy G. Vaughan, Joëlle Barido-Sottani, Sebastián Duchêne, "

[52] "  Mathieu Fourment, Alexandra Gavryushkina, Joseph Heled et al. "                

[53] "  BEAST 2.5: An advanced software platform for Bayesian evolutionary analysis. " 

[54] "  PLoS computational biology 15, no. 4 (2019): e1006650."                        

[55] ""                                                                                

[56] "===============================================================================" 

[57] "Done!"                                                                           

[1] "input_filename_full: /local/tmp/RtmpMFJNhH/file1d8d66a637bd7.xml"

[1] "actual_log_filename: /home/p251362/.cache/file1d8d62a4db8a/7/temp.log"

[1] "actual_trees_filenames: /home/p251362/.cache/file1d8d62a4db8a/7/temp.trees"

[1] "output_log_filename_full: /data/p251362/nodeSub/no_extinct/shared/7/alternative.log"

[1] "output_trees_filenames_full: /data/p251362/nodeSub/no_extinct/shared/7/alternative.trees"

[1] "output_state_filename_full: /local/tmp/RtmpMFJNhH/file1d8d635b9521a.xml.state"

 [1] ""                                                                                

 [2] "                        BEAST v2.6.0, 2002-2019"                                 

 [3] "             Bayesian Evolutionary Analysis Sampling Trees"                      

 [4] "                       Designed and developed by"                                

 [5] " Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard"          

 [6] "                                    "                                            

 [7] "                   Centre for Computational Evolution"                           

 [8] "                         University of Auckland"                                 

 [9] "                       [email protected]"                               

[10] "                        [email protected]"                                

[11] "                                    "                                            

[12] "                   Institute of Evolutionary Biology"                            

[13] "                        University of Edinburgh"                                 

[14] "                           [email protected]"                                   

[15] "                                    "                                            

[16] "                    David Geffen School of Medicine"                             

[17] "                 University of California, Los Angeles"                          

[18] "                           [email protected]"                                    

[19] "                                    "                                            

[20] "                      Downloads, Help & Resources:"                              

[21] "                           http://beast2.org/"                                   

[22] "                                    "                                            

[23] "  Source code distributed under the GNU Lesser General Public License:"          

[24] "                   http://github.com/CompEvol/beast2"                            

[25] "                                    "                                            

[26] "                           BEAST developers:"                                    

[27] "   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, "            

[28] " Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, "          

[29] "Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, "        

[30] "          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie"                   

[31] "                                    "                                            

[32] "                               Thanks to:"                                       

[33] "          Roald Forsberg, Beth Shapiro and Korbinian Strimmer"                   

[34] ""                                                                                

[35] "Random number seed: 1565352696500"                                               

[36] ""                                                                                

[37] "File: file1d8d66a637bd7.xml seed: 1565352696500 threads: 1"                      

[38] "Loading package BEAST v2.6.0"                                                    

[39] "Loading package BEAST v2.6.0"                                                    

[40] "Alignment(temp)"                                                                 

[41] "  100 taxa"                                                                      

[42] "  1000 sites"                                                                    

[43] "  1000 patterns"                                                                 

[44] ""                                                                                

[45] "Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path"            

[46] "TreeLikelihood(treeLikelihood.temp0) uses BeerLikelihoodCore4"                   

[47] "  Alignment(temp): [taxa, patterns, sites] = [100, 1000, 1000]"                  

[48] "===============================================================================" 

[49] "Citations for this model:"                                                       

[50] ""                                                                                

[51] "Bouckaert, Remco, Timothy G. Vaughan, Joëlle Barido-Sottani, Sebastián Duchêne, "

[52] "  Mathieu Fourment, Alexandra Gavryushkina, Joseph Heled et al. "                

[53] "  BEAST 2.5: An advanced software platform for Bayesian evolutionary analysis. " 

[54] "  PLoS computational biology 15, no. 4 (2019): e1006650."                        

[55] ""                                                                                

[56] "===============================================================================" 

[57] "Done!"                                                                           

[1] "cmd: /apps/generic/software/Java/1.8.0_192/jre/bin/java -jar '/home/p251362/.local/share/beast/lib/launcher.jar' -seed 1565352623.58915 -statefile \"/local/tmp/RtmpMFJNhH/file1d8d635b9521a.xml.state\" -overwrite \"/local/tmp/RtmpMFJNhH/file1d8d66a637bd7.xml\""

Error in beastier::run_beast2(input_filename = beast2_input_filename,  : 

  BEAST2 .log file not created at '/home/p251362/.cache/file1d8d62a4db8a/7/temp.log' 

Maybe no permission to write at that location?

Calls: infer_phylogeny -> <Anonymous> -> bbt_run -> <Anonymous>

In addition: Warning messages:

1: In regularize.values(x, y, ties, missing(ties)) :

  collapsing to unique 'x' values

2: In system2(command = cmd[1], args = cmd[-1], stdout = TRUE, stderr = TRUE) :

  running command ''/apps/generic/software/Java/1.8.0_192/jre/bin/java' -jar '/home/p251362/.local/share/beast/lib/launcher.jar' -seed 1565352623.58915 -statefile "/local/tmp/RtmpMFJNhH/file1d8d635b9521a.xml.state" -overwrite "/local/tmp/RtmpMFJNhH/file1d8d66a637bd7.xml" 2>&1' had status 1

Execution halted

Explore to run BEAST2 from temp folder

Currently, beastier has some special file handling, due to BEAST2's file creation. This would maybe vanish if BEAST2 was run run with pwd set to a temp folder.

Pass CRAN CI

From :

* checking examples ... ERROR
Running examples in ‘beastier-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: create_default_log_filename
> ### Title: Create the default '.log' filename as will be created by BEAST
> ### Aliases: create_default_log_filename
> 
> ### ** Examples
> 
>   library(testthat)
> 
>   input_filename <- get_beastier_path("2_4.xml")
>   log_filename <- create_default_log_filename(input_filename)
Error in check_beast2_path(beast2_path) : 
  'beast2_path' must be the name of an existing file. File '/home/hornik/.local/share/beast/lib/beast.jar' not found
Calls: create_default_log_filename -> check_beast2_path
Execution halted
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR, 1 NOTE

Clear: there is no BEAST2 installed on the CRAN CI, run Travis without installing it...

Bug reminder

(No subject)

2 November 2018 17:10 3 KB
From:
Rivera Leon, V.E.
To: [...]

Fx pease

https://github.com/richelbilderbeek/beastier/blob/3c9a43fa58df11133b3d9417b93800ad40ee5e59/R/is_beast2_input_file.R#L40

Implement feedback CRAN

Re: CRAN submission beastier 2.0.13

23 May 2019 11:56 9 KB
From:
Uwe Ligges
To:
Richèl J.C. Bilderbeek, CRAN

Thanks, can you please add a
SystemRequirements field to the DESCRIPTION file and define BEAST2 (and if applicable a minimal version) that you package apparently needs?

Please fix and resubmit.

Best,
Uwe Ligges

Update BEAST2

Write beastier::update_beast2() to update the current version of BEAST2

Invalid cross-device link

Error: file.exists(output_log_filename) is not TRUE
In addition: Warning messages:
1: In file.rename(from = from, to = output_log_filename) :
  cannot rename file 'test_output_0.log' to '/tmp/RtmpCkIwGP/file1ef65a706c8.log', reason 'Invalid cross-device link'
2: In file.rename(from = from, to = to) :

run_beast2 should or should not overwrite the correct file

Feedback bjoelle:

run_beast2, create_beast2_run_cmd: the -overwrite option for BEAST2 is not for overwriting the state file (it will always be overwritten), it is for overwriting the log & trees files. Thus at the moment setting overwrite_state_file does nothing (it's also always set back to TRUE at l107 in run_beast2).

Process CRAN feedback

From Martina Schmirl:

please omit the redundant "from R" in the title.

  • Done

please omit double spaces in the description (e.g. "'BEAST2' from").

  • Done, replaced all double spaces by four spaces

Please always write package names, software names and API names in single quotes (e.g. 'BEAST2', 'R') in the title and the description field.

  • Done.

The LICENSE file is only needed if you have additional restrictions to the GPL-3 which you have not? In that case omit the file and its reference in the DESCRIPTION file.

  • Done.

Please provide small executable examples in all your exported functions' Rd files to illustrate the use of the exported function but also enable automatic testing.

  • Done. Thanks for spotting this, I think this is important myself, but somehow overlooked it.

Please fix and resubmit.

  • TODO

Add 'update_beastier`

Calls remote::install_github on all beastier friends, which are tracerer and beautier

Fix CRAN build note: Author field differs from that derived from Authors@R

From CRAN build log:

* checking DESCRIPTION meta-information ... NOTE
Author field differs from that derived from Authors@R
  Author:    ‘Richèl J.C. Bilderbeek <[email protected]>’
  Authors@R: ‘Richèl J.C. Bilderbeek [aut, cre] (<https://orcid.org/0000-0003-1107-7049>), Joëlle Barido-Sottani [rev] (Joëlle reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/209), David Winter [rev] (David reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/209)’

Allow using BEAST2's example NEXUS and XML files

In ~/.local/share/beast/examples/nexus/ are NEXUS files, in its superfolder XML files.

  • Create a function get_beast2_example_filenames() that returns a list of the full path to the BEAST2 example filenames
  • Create a function get_beast2_example_filename(filename) that returns the full path to a BEAST2 example filename, or calls stop if the file is absent

install_beast2 fails on MacOS Sierra: status 403 Forbidden

Fix CRAN build

Feedback from Brian Ripley:

See https://cran.r-project.org/web/checks/check_results_beastier.html .

Your test seems wrong-headed: nothing mandates paths should start at /home on Unix: macOS uses /Users, my dept uses /homes for roving home directories and /users is quite common. And installing into ~/.local/share would be a violation of the CRAN policy ....

Please correct ASAP once all the results are in and before Jun 6 to safely retain the package on CRAN.

He is (of course) right!

Invalid cross-device link

A local-only error:

Error: file.exists(output_log_filename) is not TRUE
In addition: Warning messages:
1: In file.rename(from = from, to = output_log_filename) :
  cannot rename file 'test_output_0.log' to '/tmp/RtmpCkIwGP/file1ef65a706c8.log', reason 'Invalid cross-device link'
2: In file.rename(from = from, to = to) :
 
 Show Traceback
 
 Rerun with Debug
 Error: file.exists(output_log_filename) is not TRUE

Hypothesis: currently, I have two installations of Lubuntu on my HDD. I think the one tmp folder is of the other and older Lubuntu version.

Experiment: re-install Lubuntu on the full HDD and it may be solved.

run_beast2 should give a warning before overwriting log file

Feedback bjoelle:

run_beast2: I think that this function should give a warning before erasing beast_log_filename and beast_trees_filenames if they exist, because I wouldn't have expected those files to be touched at all if I have specified different values for output_log_filename and output_trees_filenames. A better solution would be to move/rename these files temporarily if they already exist, and restore them once the run is done.

Prevent BEAST2 freeze when overwriting a log file with overwrite set to false

test_that("BEAST2 freezes when treelog file already exists", {

  skip("Issue 50, Issue #50")

  if (!is_beast2_installed()) return()

  beast2_xml_filename <- tempfile(
    pattern = "beast2_", tmpdir = rappdirs::user_cache_dir(),
    fileext = ".xml"
  )

  beautier::create_beast2_input_file_from_model(
    input_filename = beautier::get_fasta_filename(),
    output_filename = beast2_xml_filename,
    inference_model = beautier::create_test_inference_model(
      mcmc = beautier::create_test_mcmc(
        screenlog = beautier::create_screenlog(filename = "")
      )
    )
  )
  testit::assert(file.exists(beast2_xml_filename))

  # First run works fine, takes approx 1 sec on my computer
  beastier::run_beast2_from_options(
    beastier::create_beast2_options(
      input_filename = beast2_xml_filename,
      overwrite = FALSE,
      verbose = TRUE
    )
  )

  # Second run causes BEAST2 to freeze
  beastier::run_beast2_from_options(
    beastier::create_beast2_options(
      input_filename = beast2_xml_filename,
      overwrite = FALSE,
      verbose = TRUE
    )
  )

})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.