Skip to content

Commit

Permalink
Prevent that beautier writes and leaves behind in .cache files, progr…
Browse files Browse the repository at this point in the history
…ess #129
  • Loading branch information
richelbilderbeek committed May 22, 2021
1 parent 39569d5 commit d5d576e
Show file tree
Hide file tree
Showing 84 changed files with 1,162 additions and 1,095 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
^scripts$
^\.appveyor\.yml$
^doc$
^created\.xml$
^expected\.xml$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: beautier
Title: 'BEAUti' from R
Version: 2.5.2
Version: 2.6
Authors@R: c(
person("Richèl J.C.", "Bilderbeek", email = "richel@richelbilderbeek.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1107-7049")),
person("Joëlle", "Barido-Sottani", role = "rev", comment = "Joëlle reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/209"),
Expand Down
18 changes: 18 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

Newest versions at top.

## beautier 2.6 (2021-05-22)

### NEW FEATURES

* None

### MINOR IMPROVEMENTS

* Make sure that no files are created in `~/.cache`

### BUG FIXES

* None

### DEPRECATED AND DEFUNCT

* None

## beautier 2.5.2 (2021-05-22)

### NEW FEATURES
Expand Down
3 changes: 2 additions & 1 deletion R/beautier.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
#' input_filename <- get_fasta_filename()
#'
#' # The file created by beautier, a BEAST2 input file
#' output_filename <- tempfile()
#' output_filename <- get_beautier_tempfilename()
#'
#' # Use the default BEAUti settings to create a BEAST2 input file
#' create_beast2_input_file_from_model(
#' input_filename,
#' output_filename,
#' inference_model = create_inference_model()
#' )
#' file.remove(output_filename)
#' @seealso
#' These are packages associated with \code{beautier}:
#' \itemize{
Expand Down
3 changes: 2 additions & 1 deletion R/create_beast2_input_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#' input_filename <- get_fasta_filename()
#'
#' # The file created by beautier, a BEAST2 input file
#' output_filename <- tempfile(pattern = "beast2", fileext = ".xml")
#' output_filename <- get_beautier_tempfilename()
#'
#' create_beast2_input_file(
#' input_filename,
#' output_filename
#' )
#' file.remove(output_filename)
#' @author Richèl J.C. Bilderbeek
#' @seealso
#' Use \link{create_beast2_input_file_from_model} to do the same with an
Expand Down
4 changes: 3 additions & 1 deletion R/create_beast2_input_file_from_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#' @seealso use \link{create_beast2_input_from_model} to
#' get the BEAST2 input file as text
#' @examples
#' output_filename <- get_beautier_tempfilename()
#' create_beast2_input_file_from_model(
#' input_filename = get_fasta_filename(),
#' output_filename = tempfile(),
#' output_filename = output_filename,
#' inference_model = create_inference_model()
#' )
#' file.remove(output_filename)
#' @author Richèl J.C. Bilderbeek
#' @seealso
#' See \code{\link{create_site_model}} for examples with
Expand Down
110 changes: 55 additions & 55 deletions R/create_clock_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
#' model, see \code{\link{create_strict_clock_model}}.
#' @author Richèl J.C. Bilderbeek
#' @examples
#' rln_clock_model <- create_rln_clock_model()
#' rln_clock_model <- create_rln_clock_model()
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model
#' )
#' file.remove(beast2_input_file)
#'
#' strict_clock_model <- create_strict_clock_model()
#' strict_clock_model <- create_strict_clock_model()
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model
#' )
#' file.remove(beast2_input_file)
#' @export
create_clock_model <- function(
name,
Expand Down Expand Up @@ -80,27 +80,27 @@ create_clock_model <- function(
#' @return a relaxed log-normal clock_model
#' @author Richèl J.C. Bilderbeek
#' @examples
#' rln_clock_model <- create_rln_clock_model()
#' rln_clock_model <- create_rln_clock_model()
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model
#' )
#' file.remove(beast2_input_file)
#'
#' rln_clock_model_exp <- create_rln_clock_model(
#' mean_rate_prior_distr = create_exp_distr()
#' )
#' rln_clock_model_exp <- create_rln_clock_model(
#' mean_rate_prior_distr = create_exp_distr()
#' )
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model_exp
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = rln_clock_model_exp
#' )
#' file.remove(beast2_input_file)
#' @aliases create_rln_clock_model create_clock_model_rln
#' @export create_rln_clock_model create_clock_model_rln
create_rln_clock_model <- create_clock_model_rln <- function(
Expand Down Expand Up @@ -139,30 +139,30 @@ create_rln_clock_model <- create_clock_model_rln <- function(
#' @return a strict clock_model
#' @author Richèl J.C. Bilderbeek
#' @examples
#' strict_clock_model <- create_strict_clock_model(
#' clock_rate_param = 1.0,
#' clock_rate_distr = create_uniform_distr()
#' )
#' strict_clock_model <- create_strict_clock_model(
#' clock_rate_param = 1.0,
#' clock_rate_distr = create_uniform_distr()
#' )
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model
#' )
#' file.remove(beast2_input_file)
#'
#' strict_clock_model_gamma <- create_strict_clock_model(
#' clock_rate_distr = create_gamma_distr()
#' )
#' strict_clock_model_gamma <- create_strict_clock_model(
#' clock_rate_distr = create_gamma_distr()
#' )
#'
#' beast2_input_file <- tempfile(fileext = ".xml")
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model_gamma
#' )
#' testit::assert(file.exists(beast2_input_file))
#' beast2_input_file <- get_beautier_tempfilename()
#' create_beast2_input_file(
#' get_fasta_filename(),
#' beast2_input_file,
#' clock_model = strict_clock_model_gamma
#' )
#' file.remove(beast2_input_file)
#' @aliases create_strict_clock_model create_clock_model_strict
#' @export create_strict_clock_model create_clock_model_strict
create_strict_clock_model <- create_clock_model_strict <- function(
Expand Down
Loading

0 comments on commit d5d576e

Please sign in to comment.