Giter VIP home page Giter VIP logo

mcbette's Introduction

mcbette

peer-review DOI

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

mcbette allows for doing a Model Comparison using babette (hence the name), that is, given a (say, DNA) alignment, it compares multiple phylogenetic inference models to find the model that is likeliest to generate that alignment. With this, one can find the phylogenetic inference model that is simple enough, but not too simple.

To do so, mcbette uses babette [Bilderbeek and Etienne, 2018] with the addition of using the BEAST2 [Bouckaert et al., 2019] nested sampling package as described in [Russell et al., 2019].

Installation

⚠️ mcbette only works on Linux and Mac.

mcbette depends on the rJava and Rmpfr packages.

On Linux, to install these, do (as root):

apt install r-cran-rjava libmpfr-dev

After this, installing mcbette is rather easy:

install.packages("mcbette")
remotes::install_github("richelbilderbeek/beastierinstall")
beastierinstall::install_beast2()
remotes::install_github("richelbilderbeek/mauricerinstall")
mauricerinstall::install_beast2_pkg("NS")

Note that mcbette uses the non-CRAN extensions beastierinstall and mauricerinstall to install and uninstall BEAST2 and its packages.

Example

library(mcbette)

Suppose we have a DNA alignment, obtained by sequencing multiple species:

fasta_filename <- beautier::get_beautier_path("anthus_aco_sub.fas")
ape::image.DNAbin(ape::read.FASTA(fasta_filename))

Note that this alignment holds too little information to really base a publishable research on.

To create a posterior distribution of phylogenies from this alignment, one needs to specify an inference model. An inference model is (among others) a combination of a site model, clock model and tree model. See the ‘Available models’ section to see the available models.

In this example we let two inference models compete.

Here is the default inference model:

inference_model_1 <- beautier::create_ns_inference_model()
message(
  paste(
    inference_model_1$site_model$name,
    inference_model_1$clock_model$name,
    inference_model_1$tree_prior$name
  )
)
#> JC69 strict yule

The JC69 site model assumes that the four DNA nucleotides are equally likely to mutate from/to. The strict clock model assumes that mutation rates of all species are equal. The Yule tree model assumes that new species form at a constant rate for an extinction rate of zero.

The competing model has a different site, clock and tree model:

inference_model_2 <- inference_model_1
inference_model_2$site_model <- beautier::create_hky_site_model()
inference_model_2$clock_model <- beautier::create_rln_clock_model()
inference_model_2$tree_prior <- beautier::create_bd_tree_prior()

The HKY site model assumes that DNA substitution rates differ between transitions (purine-to-purine or pyrimidine-to-pyrimidine) and translations (purine-to-pyrimidine or the other way around). The relaxed log-normal clock model assumes that mutation rates of all species are differ, where all these rates together follow a log-normal distribution. The birth-death tree model assumes that new species form and go extinct at a constant rate.

mcbette shows the evidence (also called marginal likelihood) for each inference model, which is the likelihood that a model has generated the data.

if (can_run_mcbette()) {
  marg_liks <- est_marg_liks(
    fasta_filename = fasta_filename,
    inference_models = list(inference_model_1, inference_model_2)
  )
}

Here we display the marginal likelihoods as a table:

if (can_run_mcbette()) {
  knitr::kable(marg_liks)
}

The most important result are the model weights. When a model’s weight is very close to one, one would prefer to use that inference model in doing a Bayesian inference. If these model weights are rather similar, one could argue to use either model.

Here we display the marginal likelihoods as a barplot:

if (can_run_mcbette()) {
  plot_marg_liks(marg_liks)
}

Available models

The available site models:

beautier::get_site_model_names()
#> [1] "JC69" "HKY"  "TN93" "GTR"

The available clock models:

beautier::get_clock_model_names()
#> [1] "relaxed_log_normal" "strict"

The available tree models:

beautier::get_tree_prior_names()
#> [1] "birth_death"                    "coalescent_bayesian_skyline"   
#> [3] "coalescent_constant_population" "coalescent_exp_population"     
#> [5] "yule"

Documentation

FAQ

Under which platforms does mcbette work?

mcbette only works on Linux and Mac, because BEAST2 package management only works on those platforms.

How do I let mcbette compare all models?

First, this is impossible, as there are infinitely many inference models possible.

inference_models <- list()
i <- 1
for (site_model in beautier::create_site_models()) {
  for (clock_model in beautier::create_clock_models()) {
    for (tree_prior in beautier::create_tree_priors()) {
      inference_models[[i]] <- beautier::create_ns_inference_model(
        site_model = site_model,
        clock_model = clock_model,
        tree_prior = tree_prior
      )
      i <- i + 1
    }
  }
}

Now, inference_models holds a list of inference models, to be used with mcbette::est_marg_liks.

Error: dir.exists(examples_folder) is not TRUE

Currently, this line gives a suboptimal error message:

beastier::get_beast2_example_filename("Primates.nex")

The error message is:

Error: dir.exists(examples_folder) is not TRUE

The error message it should display is:

Error: BEAST2 examples folder not found at path '[path]'.
Maybe BEAST2 is not installed? 
Tip: run 'beastier::install_beast2()'

This will be added in a future version of beastier.

Using an existing BEAST2 installation

When BEAST2 is already installed, yet at a non-default location, one can use the beast2_bin_path argument in create_mcbette_beast2_options.

Code of conduct

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Links

References

  • Bilderbeek, Richel JC, and Rampal S. Etienne. “babette: BEAUti 2, BEAST 2 and Tracer for R.” Methods in Ecology and Evolution (2018). https://doi.org/10.1111/2041-210X.13032
  • Bouckaert R., Vaughan T.G., Barido-Sottani J., Duchêne S., Fourment M., Gavryushkina A., et al. (2019) BEAST 2.5: An advanced software platform for Bayesian evolutionary analysis. PLoS computational biology, 15(4), e1006650.
  • Russel, Patricio Maturana, et al. “Model selection and parameter inference in phylogenetics using nested sampling.” Systematic biology 68.2 (2019): 219-233.
beastier::remove_beaustier_folders()
beastier::check_empty_beaustier_folders()

mcbette's People

Contributors

maelle avatar richelbilderbeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mcbette's Issues

Installation on cluster, issue with Rmpfr

One of the dependencies of mcbette; Rmpfr; doesn't install for me on the cluster, I receive the following error:

install.packages("Rmpfr")
Installing package into ‘/home/p251362/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://ftp.fau.de/cran/src/contrib/Rmpfr_0.7-2.tar.gz'
Content type 'application/x-gzip' length 626031 bytes (611 KB)
==================================================
downloaded 611 KB

  • installing source package ‘Rmpfr’ ...
    ** package ‘Rmpfr’ successfully unpacked and MD5 sums checked
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking mpfr.h usability... no
    checking mpfr.h presence... no
    checking for mpfr.h... no
    configure: error: Header file mpfr.h not found; maybe use --with-mpfr-include=INCLUDE_PATH
    ERROR: configuration failed for package ‘Rmpfr’
  • removing ‘/home/p251362/R/x86_64-pc-linux-gnu-library/3.5/Rmpfr’

Apparently, this is a known issue: https://stackoverflow.com/questions/33750315/installation-of-package-rmpfr-had-non-zero-exit-status and https://stackoverflow.com/questions/28868789/error-when-trying-to-install-rmpfr-in-r-related-to-the-header-file-mpfr-h

Commonly fixed by installing the mpfr libraries, for which you need sudo, which I don't have on the cluster.

Is there any way to make mcbette run without Rmpfr ?

Process feedback JOSS

My JOSS submission can be found at openjournals/joss-reviews#2738.

Process the first feedback:

open source license

Upon your request, I have added the LICENSE file.

DOI's are missing from references (see list above)

Fixed the DOIs indited by this @whelan commit.

Your paper needs a high level non-technical short introduction to orient a reader who might be interested in using your software to decide whether it is relevant or not.

AFAICS the Introduction serves that purpose:

mcbette is an R package to do model comparison between
a set of evolutionary models on a DNA alignment, which allows
to select that model that is closest to the process that underlied
the DNA alignment and species tree.

I assume the rOpenSci reviewers agree. If you disagree, let me know and I will make it less technical 👍

you should be able to resize your giant logo in the paper too

Done!

Error: dir.exists(examples_folder) is not TRUE, due to not having installed BEAST2

Describe the bug
I tried to run the. code in https://ropensci.org/blog/2020/12/01/mcbette-selecting-the-best-inference-model/
To Reproduce
Script to reproduce the behavior:

library(beastier) # beastier is part of babette
fasta_filename <- tempfile("primates.fasta")
save_nexus_as_fasta(
  get_beast2_example_filename("Primates.nex"),
  fasta_filename
)

Expected behavior
it got to give me a DNA alignment

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:
Show the results of running the following script:

library(mcbette)
mcbette::mcbette_report()
> library(mcbette)
> mcbette::mcbette_report()
***********

* mcbette *

***********

Can run mcbette: FALSE

OS: mac

****************

* Dependencies *

****************

beautier version: 2.4

tracerer version: 2.1

beastier version: 2.2.1

mauricer version: 2.3

babette version: 2.2

**********

* BEAST2 *

**********

Java version: 10.0.2+13

Is BEAST2 installed: FALSE

****************

* session info *

****************Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.3 (2020-10-10)
 os       macOS Big Sur 10.16         
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Asia/Kolkata                
 date     2020-12-07Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version    date       lib source                           
 ape           5.4-1      2020-08-13 [1] CRAN (R 4.0.2)                   
 assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.0)                   
 beastier    * 2.2.1      2020-10-30 [1] CRAN (R 4.0.2)                   
 beautier      2.4        2020-10-16 [1] CRAN (R 4.0.2)                   
 callr         3.5.1      2020-10-13 [1] CRAN (R 4.0.2)                   
 cli           2.2.0      2020-11-20 [1] CRAN (R 4.0.2)                   
 crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.0)                   
 desc          1.2.0      2018-05-01 [1] CRAN (R 4.0.0)                   
 devtools      2.3.2      2020-09-18 [1] CRAN (R 4.0.2)                   
 digest        0.6.27     2020-10-24 [1] CRAN (R 4.0.2)                   
 ellipsis      0.3.1      2020-05-15 [1] CRAN (R 4.0.2)                   
 evaluate      0.14       2019-05-28 [1] CRAN (R 4.0.0)                   
 fansi         0.4.1      2020-01-08 [1] CRAN (R 4.0.0)                   
 fs            1.5.0      2020-07-31 [1] CRAN (R 4.0.2)                   
 glue          1.4.2      2020-08-27 [1] CRAN (R 4.0.2)                   
 htmltools     0.5.0      2020-06-16 [1] CRAN (R 4.0.2)                   
 htmlwidgets   1.5.2      2020-10-03 [1] CRAN (R 4.0.2)                   
 knitr         1.30       2020-09-22 [1] CRAN (R 4.0.2)                   
 lattice       0.20-41    2020-04-02 [1] CRAN (R 4.0.3)                   
 magrittr      2.0.1      2020-11-17 [1] CRAN (R 4.0.2)                   
 mauricer      2.3        2020-10-31 [1] CRAN (R 4.0.2)                   
 mcbette     * 1.13       2020-12-05 [1] Github (ropensci/mcbette@6d3b851)
 memoise       1.1.0      2017-04-21 [1] CRAN (R 4.0.0)                   
 nlme          3.1-149    2020-08-23 [1] CRAN (R 4.0.3)                   
 pkgbuild      1.1.0.9000 2020-11-24 [1] Github (r-lib/pkgbuild@a5193f0)  
 pkgload       1.1.0      2020-05-29 [1] CRAN (R 4.0.2)                   
 prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.0.0)                   
 processx      3.4.5      2020-11-30 [1] CRAN (R 4.0.2)                   
 ps            1.4.0      2020-10-07 [1] CRAN (R 4.0.2)                   
 R6            2.5.0      2020-10-28 [1] CRAN (R 4.0.2)                   
 rappdirs      0.3.1      2016-03-28 [1] CRAN (R 4.0.0)                   
 Rcpp          1.0.5      2020-07-06 [1] CRAN (R 4.0.2)                   
 remotes       2.2.0      2020-07-21 [1] CRAN (R 4.0.2)                   
 rJava         0.9-13     2020-07-06 [1] CRAN (R 4.0.2)                   
 rlang         0.4.9      2020-11-26 [1] CRAN (R 4.0.2)                   
 rmarkdown     2.5        2020-10-21 [1] CRAN (R 4.0.3)                   
 rprojroot     2.0.2      2020-11-15 [1] CRAN (R 4.0.2)                   
 rstudioapi    0.13       2020-11-12 [1] CRAN (R 4.0.2)                   
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.0)                   
 testit        0.12       2020-09-25 [1] CRAN (R 4.0.2)                   
 testthat      3.0.0      2020-10-31 [1] CRAN (R 4.0.2)                   
 usethis       1.6.3      2020-09-17 [1] CRAN (R 4.0.2)                   
 withr         2.3.0      2020-09-22 [1] CRAN (R 4.0.2)                   
 xfun          0.19       2020-10-30 [1] CRAN (R 4.0.2)                   
 yaml          2.2.1      2020-02-01 [1] CRAN (R 4.0.0)                   

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
> 

Additional context
tried updating devtools,

Screenshot 2020-12-07 at 12 08 57 PM

Screenshot 2020-12-07 at 12 08 57 PM

I want to badly do the analysis, thanks

Check setup

From here, I quote:

✖ fix this R CMD check WARNING: LaTeX errors when creating PDF version.
This typically indicates Rd problems. LaTeX errors found: ! LaTeX Error: File
`ltxcmds.sty' not found. Type X to quit or to proceed, or enter new
name. (Default extension: sty) ! Emergency stop. <read *> l.105
\RequirePackage{ltxcmds}[2010/11/12] ^^M ! ==> Fatal error occurred, no output
PDF file produced!

Maybe/probably just a setup thing?

Fix it 👍

babette is on CRAN

From here I quote @maelle:

In the FAQ, it says the other packages are not on CRAN, but they're on CRAN now, aren't they?

Update the FAQ.

Feature request: speed up calculation

From @dksam:

Dear Dr Richel Bilderbeek, will you at least make iit possible to check a
total of 9 or 16 models comparing 2 by 2 or 3 by 3 or 4 by 4, then it will
help make a grand statement, out of 16 models tested, this had the lowest
log ratios and this the highest, I have a good mac which has 64 GB RAM, and
I can run for 2 weeks if needed, but this statement will help (not that all
will understand it,) thanks regards,Samuel

beastier dependency issue

When installing dependencies for nodeSub on Travis, I receive:


Installing package into ‘/home/travis/R/Library’
(as ‘lib’ is unspecified)
* installing *source* package ‘mcbette’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘beastier’ 2.1.3 is being loaded, but >= 2.2 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘mcbette’
* removing ‘/home/travis/R/Library/mcbette’
Error: Failed to install 'mcbette' from GitHub:

goodpractice is right

From here I quote goodpractice:

goodpractice output

✖ not use "Depends" in DESCRIPTION, as it can cause name clashes, and
poor interaction with other packages. Use "Imports" instead.
✖ not import packages as a whole, as this can cause name clashes between
the imported packages. Instead, import only the specific functions you need.

Fix floating point error

* using log directory ‘/data/gannet/ripley/R/packages/tests-noLD/mcbette.Rcheck’
* using R Under development (unstable) (2022-10-21 r83149)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--no-stop-on-test-error’
* checking for file ‘mcbette/DESCRIPTION’ ... OK
* this is package ‘mcbette’ version ‘1.15’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘mcbette’ can be installed ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... ERROR
Running examples in ‘mcbette-Ex.R’ failed
The error most likely occurred in:

> ### Name: calc_weights
> ### Title: Calculate the weights for each marginal likelihood
> ### Aliases: calc_weights
> 
> ### ** Examples
> 
> # Evidences (aka marginal likelihoods) can be very small
> evidences <- c(0.0001, 0.0002, 0.0003, 0.0004)
> 
> # Sum will be 1.0
> calc_weights(evidences)
[1] 0.1 0.2 0.3 0.4
> 
> beastier::check_empty_beaustier_folders()
Error in beautier::check_empty_beautier_folder(beautier_folder = beautier_folder) : 
  Files found in beautier folder. 
beautier_folder: /data/gannet/ripley/.cache/beautier 
length(list.files(beautier_folder))): 6 
head(list.files(beautier_folder)): /data/gannet/ripley/.cache/beautier/alignment_12fc24355e0bae.fasta,/data/gannet/ripley/.cache/beautier/alignment_12fc244e34e7f1.fasta,/data/gannet/ripley/.cache/beautier/alignment_12fc24afb1b70_twin.fasta,/data/gannet/ripley/.cache/beautier/alignment_13075f1502fab0.fasta,/data/gannet/ripley/.cache/beautier/alignment_13075f47154d89.fasta,/data/gannet/ripley/.cache/beautier/alignment_13075fab592b8_twin.fasta
Calls: <Anonymous> -> <Anonymous>
Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... [9s/13s] OK
* checking HTML version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 1 ERROR
See
  ‘/data/gannet/ripley/R/packages/tests-noLD/mcbette.Rcheck/00check.log’
for details.

Command exited with non-zero status 1
Time 1:25.57, 56.90 + 8.10

mcbette_report must use cat

Describe the bug

This is how a call to mcbette_report looks like (from here):

> mcbette::mcbette_report()
[1] "****************"
[1] "* Dependencies *"
[1] "****************"
[1] "beautier version: 2.3.4"
[1] "tracerer version: 2.0.4"
[1] "beastier version: 2.1.2"
[1] "mauricer version: 2.0.6"
[1] "babette version: 2.1.2"
[1] "***************"
[1] "* BEAST2      *"
[1] "***************"
[1] "Is BEAST2 installed: TRUE"
[1] "BEAST2 version: 2.6.1"
[1] "BEAST2 default path: /home/richel/.local/share/beast/bin/beast"
[1] "*******************"
[1] "* BEAST2 packages *"
[1] "*******************"
[1] "Is BEAST2 NS package installed: TRUE"
[1] "BEAST2 NS installed version: 1.1.0"
[1] "BEAST2 NS latest version: 1.1.0"
[1] "***************"
[1] "* sessionInfo *"
[1] "***************"
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.10

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=nl_NL.UTF-8          LC_NAME=nl_NL.UTF-8          
 [9] LC_ADDRESS=nl_NL.UTF-8        LC_TELEPHONE=nl_NL.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=nl_NL.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.6.1 magrittr_1.5   tools_3.6.1    curl_4.3       rappdirs_0.3.1
 [6] beautier_2.3.4 mcbette_1.8.2  mauricer_2.0.6 stringi_1.4.6  beastier_2.1.2
[11] stringr_1.4.0  testit_0.11    rJava_0.9-11  

The [1]s are useless.

To Reproduce

mcbette::mcbette_report()

Expected behavior

Without [1]s.

Screenshots

NA

Environment:
Show the results of running the following script:

library(mcbette)
mcbette::mcbette_report()

See above.

BEAST related error

Upon running mcbette::est_marg_liks:

mcbette::est_marg_liks(fasta_filename = "rag1_trimal.fasta")

I receive the following error:

Error: Could not find or load main class beast.util.PackageManager
Error: mauricer::is_beast2_pkg_installed("NS") are not all TRUE
In addition: Warning message:
In system2(command = beastier::get_default_java_path(), args = c("-cp",  :
  running command ''/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/bin/java' -cp '/Users/janzen/Library/Application Support/BEAST/lib/beast.jar' beast.util.PackageManager -list' had status 1

No warning if no internet connection, yet all packages needed are present

If one loses internet connection, this warning is given:

Error reading the following package repository URLs: https://raw.githubusercontent.com/CompEvol/CBAN/master/packages2.5.xml
Could not get an internet connection. The BEAST Package Manager needs internet access in order to list available packages and download them for installation. Possibly, some software (like security software, or a firewall) blocks the BEAST Package Manager.  If so, you need to reconfigure such software to allow access.

If I have all BEAST2 packages already installed, I need not see it.

Make it go away.

Bug: in max(stats::na.omit(pir_out$inference_model_weight)) : no non-missing arguments to max; returning -Inf

Hurray, it is fully replicable on a local computer:

richel@oldskool:~/GitHubs/pirouette_article/scripts$ Rscript example_3.R 33
[1] "Number of arguments: 1"
[1] 33
[1] "/home/richel/GitHubs/pirouette_article/example_3_33"
ggtree v1.14.6  For help: https://guangchuangyu.github.io/software/ggtree

If you use ggtree in published research, please cite the most appropriate paper(s):

- Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36, doi:10.1111/2041-210X.12628

- Guangchuang Yu, Tommy Tsan-Yuk Lam, Huachen Zhu, Yi Guan. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution 2018, accepted. doi: 10.1093/molbev/msy194
[1] "#######################################################################"
[1] "Settings to run on Peregrine cluster"
[1] "#######################################################################"
[1] "#######################################################################"
[1] "2019-05-07 16:15:47 CEST"
Warning message:
In max(stats::na.omit(pir_out$inference_model_weight)) :
  no non-missing arguments to max; returning -Inf
[1] "2019-05-07 16:30:19 CEST"

R script here:

example_3.R.zip

Only NA results

This might very well be a product of my alignment, but I find it very hard to debug/find the issue.

I have ran mcbette on the cluster (on Travis the run times out after 47 minutes (!)).
I run the following code:

library(mcbette)
f <- list.files(pattern = "*.fasta")
for(x in f) {
	df <- mcbette::est_marg_liks(
		  fasta_filename = x, verbose = TRUE
	)
	saveRDS(df, file = "results.RData")
	write.table(df, file = "results.txt")
}

With the following alignment:
RH1_trimal2.fasta.zip

This results in the following error messages:

<simpleError: all(file.exists(output_log_filename)) is not TRUE>
<simpleError: all(file.exists(output_log_filename)) is not TRUE>
...
<simpleError: all(file.exists(output_log_filename)) is not TRUE>
There were 50 or more warnings (use warnings() to see the first 50)

and the results.txt file can be found here:
results.txt

Clearly, something is going wrong, causing NA values for all models. However, I don't know what - it could be some sample naming issues in the fasta file, or perhaps something else. I would love to run a single model with detailed output in mcbette, to see where the error arises.

Document dependencies more explicitly

I quote @maelle from here:

In the README section about installation, please write how many dependencies in total are needed by the package (I had to install >30 packages) and that rJava and Rmpfr are among them (on e.g. Ubuntu, it means installing system dependencies before installing the R packages), to make it less of a surprise.

Do so 👍

'mcbette_report' must show Java version

Is your feature request related to a problem? Please describe.

'mcbette_report' does not show the Java version. This may be a cause for bugs.

Describe the solution you'd like

'mcbette_report' should show the Java version.

Describe alternatives you've considered

None.

Additional context

Tip: use beastier::get_java_version.

Seperate BEAST2 options params in experiment

There need be two beast2_options per experiment:

  • One for the inference:
    • mcmc must be a normal MCMC
    • beast2_path can be both .jar and binary
  • One for the estimation of the evidence (aka marginal likelihood):
    • mcmc must be a Nested Sampling MCMC
    • beast2_path must be to BEAST2 binary

overview

Create mcbette_run

Currently, mcbette is both an R package as well as something that runs an R script.

I quote @maelle from here:

  • In the README I think the existence of two modes (online, and offline on Mac and Linux) could be made clearer.

To resolve this, create a package called 'mcbette_run' that only runs a mcbette script.

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.