diff --git a/R/compilation.R b/R/compilation.R index c3517c002..2c2244fa3 100644 --- a/R/compilation.R +++ b/R/compilation.R @@ -52,7 +52,7 @@ compile_model <- function(populations, generation_time, path = NULL, resolution simulation_length = NULL, direction = NULL, slim_script = NULL, description = "", sim_length = NULL) { if (is.null(simulation_length) && !is.null(sim_length)) { - message("Argument `sim_length` will soon be deprecated in favor of `simulation_length`.") + warning("Argument `sim_length` will soon be deprecated in favor of `simulation_length`.", call. = FALSE) simulation_length <- sim_length } @@ -316,6 +316,7 @@ read_model <- function(path) { #' will be saved (most likely for use with \code{animate_model}). #' @param slim_path Optional way to specify path to an appropriate SLiM binary (this is useful #' if the \code{slim} binary is not on the \code{$PATH}). +#' @param sampling Deprecated in favor of \code{samples}. #' #' @return A tree-sequence object loaded via Python-R reticulate interface function \code{ts_load} #' (internally represented by the Python object \code{tskit.trees.TreeSequence}) @@ -359,7 +360,7 @@ slim <- function( model, sequence_length, recombination_rate, samples = NULL, output = NULL, burnin = 0, max_attempts = 1, spatial = !is.null(model$world), coalescent_only = TRUE, method = c("batch", "gui"), random_seed = NULL, verbose = FALSE, load = TRUE, - locations = NULL, slim_path = NULL + locations = NULL, slim_path = NULL, sampling = NULL ) { method <- match.arg(method) @@ -382,6 +383,11 @@ slim <- function( if (!is.numeric(recombination_rate) | recombination_rate < 0) stop("Recombination rate must be a numeric value", call. = FALSE) + if (!is.null(sampling) && is.null(samples)) { + warning("Argument `sampling` will soon be deprecated in favor of `samples`.", call. = FALSE) + samples <- sampling + } + # verify checksums of serialized model configuration files checksums <- readr::read_tsv(file.path(model_dir, "checksums.tsv"), progress = FALSE, col_types = "cc") @@ -523,6 +529,7 @@ slim <- function( #' file is written to a custom location to be loaded at a later point. #' @param verbose Write the output log to the console (default \code{FALSE})? #' @param debug Write msprime's debug log to the console (default \code{FALSE})? +#' @param sampling Deprecated in favor of \code{samples}. #' #' @return A tree-sequence object loaded via Python-R reticulate interface function \code{ts_load} #' (internally represented by the Python object \code{tskit.trees.TreeSequence}) @@ -563,7 +570,7 @@ slim <- function( #' @export msprime <- function(model, sequence_length, recombination_rate, samples = NULL, output = NULL, random_seed = NULL, - load = TRUE, verbose = FALSE, debug = FALSE) { + load = TRUE, verbose = FALSE, debug = FALSE, sampling = NULL) { if (is.null(output) & !load) warning("No custom tree-sequence output path is given but loading a tree sequence from\n", "a temporary file after the simulation has been prevented", call. = FALSE) @@ -580,6 +587,11 @@ msprime <- function(model, sequence_length, recombination_rate, samples = NULL, if (!is.numeric(recombination_rate) | recombination_rate < 0) stop("Recombination rate must be a numeric value", call. = FALSE) + if (!is.null(sampling) && is.null(samples)) { + warning("Argument `sampling` will soon be deprecated in favor of `samples`.", call. = FALSE) + samples <- sampling + } + # verify checksums of serialized model configuration files checksums <- readr::read_tsv(file.path(model_dir, "checksums.tsv"), progress = FALSE, col_types = "cc") diff --git a/docs/reference/msprime.html b/docs/reference/msprime.html index c273d5880..4d4186edc 100644 --- a/docs/reference/msprime.html +++ b/docs/reference/msprime.html @@ -124,7 +124,8 @@

Run a slendr model in msprime

random_seed = NULL, load = TRUE, verbose = FALSE, - debug = FALSE + debug = FALSE, + sampling = NULL ) @@ -156,6 +157,8 @@

Arguments

Write the output log to the console (default FALSE)?

debug

Write msprime's debug log to the console (default FALSE)?

+
sampling
+

Deprecated in favor of samples.

Value

diff --git a/man/msprime.Rd b/man/msprime.Rd index 1dd752b2f..a4080b65a 100644 --- a/man/msprime.Rd +++ b/man/msprime.Rd @@ -13,7 +13,8 @@ msprime( random_seed = NULL, load = TRUE, verbose = FALSE, - debug = FALSE + debug = FALSE, + sampling = NULL ) } \arguments{ @@ -42,6 +43,8 @@ file is written to a custom location to be loaded at a later point.} \item{verbose}{Write the output log to the console (default \code{FALSE})?} \item{debug}{Write msprime's debug log to the console (default \code{FALSE})?} + +\item{sampling}{Deprecated in favor of \code{samples}.} } \value{ A tree-sequence object loaded via Python-R reticulate interface function \code{ts_load} diff --git a/man/slim.Rd b/man/slim.Rd index 851da8c33..04646ed49 100644 --- a/man/slim.Rd +++ b/man/slim.Rd @@ -19,7 +19,8 @@ slim( verbose = FALSE, load = TRUE, locations = NULL, - slim_path = NULL + slim_path = NULL, + sampling = NULL ) } \arguments{ @@ -71,6 +72,8 @@ will be saved (most likely for use with \code{animate_model}).} \item{slim_path}{Optional way to specify path to an appropriate SLiM binary (this is useful if the \code{slim} binary is not on the \code{$PATH}).} + +\item{sampling}{Deprecated in favor of \code{samples}.} } \value{ A tree-sequence object loaded via Python-R reticulate interface function \code{ts_load}