Skip to content

Commit

Permalink
Merge pull request #30 from rsetienne/develop
Browse files Browse the repository at this point in the history
v3.0.1
  • Loading branch information
rsetienne authored Sep 29, 2023
2 parents d651227 + b272b39 commit 3979888
Show file tree
Hide file tree
Showing 19 changed files with 558 additions and 317 deletions.
106 changes: 52 additions & 54 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
{
"title": "secsse: Several Examined and Concealed States-Dependent Speciation and Extinction",
"license": "GPL-3.0",
"upload_type": "software",
"description": "<p>SecSSE is an R package designed for multistate data sets under a concealed state and speciation (hisse) framework. In this sense, it is parallel to the 'MuSSE' functionality implemented in diversitree, but it accounts for finding possible spurious relationships between traits and diversification rates ('false positives', Rabosky & Goldberg 2015) by testing against a 'hidden trait' (Beaulieu et al. 2013), which is responsible for more variation in diversification rates than the trait being investigated. <\/p>",
"keywords": [
"Evolving traits",
"macroevolution",
"phylogenetic tools",
"speciation rates",
"model",
"maximum-likelihood",
"parameter estimation"
],
"access_right": "open",
"language": "eng",
"contributors": [
{
"name": "Janzen, Thijs",
"affiliation": "University of Groningen",
"orcid": "0000-0002-4162-1140",
"type": "ProjectMember"
},
{
"name": "Hildenbrandt, Hanno",
"affiliation": "University of Groningen",
"orcid": "0000-0002-6784-1037",
"type": "ProjectMember"
},
{
"name": "Santos Neves, Pedro",
"affiliation": "University of Groningen",
"orcid": "0000-0003-2561-4677",
"type": "ProjectMember"
}
],
"creators": [
{
"name": "Herrera Alsina, Leonel",
"affiliation": "University of Aberdeen",
"orcid": "0000-0003-0474-3592",
},
{
"name": "van Els, Paul",
"affiliation": "Sovon Dutch Centre for Field Ornithology",
"orcid": "0000-0002-9499-8873",
},
{
"name": "Etienne, Rampal S.",
"affiliation": "University of Groningen",
"orcid": "0000-0003-2142-7612",
},
],
"notes": "Compiled code (*.cpp and *.h files) is licensed under the BSL-1.0. See file COPYRIGHTS and LICENSE.note for mode details",
}
"title": "secsse: Several Examined and Concealed States-Dependent Speciation and Extinction",
"license": "GPL-3.0",
"upload_type": "software",
"description": "<p>SecSSE is an R package designed for multistate data sets under a concealed state and speciation (hisse) framework. In this sense, it is parallel to the 'MuSSE' functionality implemented in diversitree, but it accounts for finding possible spurious relationships between traits and diversification rates ('false positives', Rabosky & Goldberg 2015) by testing against a 'hidden trait' (Beaulieu et al. 2013), which is responsible for more variation in diversification rates than the trait being investigated. <\/p>",
"keywords": [
"Evolving traits",
"macroevolution",
"phylogenetic tools",
"speciation rates",
"model",
"maximum-likelihood",
"parameter estimation"
],
"access_right": "open",
"language": "eng",
"contributors": [{
"name": "Janzen, Thijs",
"affiliation": "University of Groningen",
"orcid": "0000-0002-4162-1140",
"type": "ProjectMember"
},
{
"name": "Hildenbrandt, Hanno",
"affiliation": "University of Groningen",
"orcid": "0000-0002-6784-1037",
"type": "ProjectMember"
},
{
"name": "Santos Neves, Pedro",
"affiliation": "University of Groningen",
"orcid": "0000-0003-2561-4677",
"type": "ProjectMember"
}
],
"creators": [{
"name": "Herrera Alsina, Leonel",
"affiliation": "University of Aberdeen",
"orcid": "0000-0003-0474-3592"
},
{
"name": "van Els, Paul",
"affiliation": "Sovon Dutch Centre for Field Ornithology",
"orcid": "0000-0002-9499-8873"
},
{
"name": "Etienne, Rampal S.",
"affiliation": "University of Groningen",
"orcid": "0000-0003-2142-7612"
}
],
"notes": "Compiled code (*.cpp and *.h files) is licensed under the BSL-1.0. See file COPYRIGHTS and LICENSE.note for mode details"
}
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: secsse
Type: Package
Title: Several Examined and Concealed States-Dependent Speciation and
Extinction
Version: 3.0.0
Date: 2023-07-27
Version: 3.0.1
Date: 2023-09-29
License: GPL (>= 3) | file LICENSE
Authors@R: c(
person(given = "Leonel",
Expand Down
175 changes: 107 additions & 68 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,131 @@
# secsse 3.0.0
# secsse 3.0.1

Version 3.0.0 extends the C++ code base used for the standard likelihood to the "cla_"
likelihood, harnessing the same computation improvement.
Version 3.0.1 patches some inaccuracies in simulation functions, and
deprecates expand_q_matrix, as this was making some incorrect
assumptions.

## Breaking changes
* Function name changes:
* `create_lambda_matrices()` is now called `create_lambda_list()`
* `create_transition_matrix()` is now called `create_q_matrix()`
* `create_mus()` is now called `create_mu_vector()`
* `create_default_q_list()` is now called `create_default_shift_matrix()`
* `create_default_lambda_list ()` is now called `create_default_lambda_transition_matrix()`
* `create_default_q_list()` is now called `create_default_shift_matrix()`
* Package data files renamed:
* `phylo_Vign` is now called `phylo_vignette`
* `traitinfo` is now called `traits`
* `phy` is now called `example_phy_GeoSSE`
* `plot_state_exact()` argument `steps` renamed to `num_steps` and argument
`focal_tree` renamed to `phy` for consistency with other functions.

- The function expand_q_matrix is now deprecated, please use
q_doubletrans

## Minor changes

- Added conditioning of simulation of complete trees on complete tree
size
- Fixed some issues with setting `pool_init_states`
- Added option to return a histogram of simulated tree sizes, across
all successful and failed trees.

# 3.0.0

Version 3.0.0 extends the C++ code base used for the standard likelihood
to the "cla\_" likelihood, harnessing the same computation improvement.

## Breaking changes

- Function name changes:
- `create_lambda_matrices()` is now called `create_lambda_list()`
- `create_transition_matrix()` is now called `create_q_matrix()`
- `create_mus()` is now called `create_mu_vector()`
- `create_default_q_list()` is now called
`create_default_shift_matrix()`
- `create_default_lambda_list ()` is now called
`create_default_lambda_transition_matrix()`
- `create_default_q_list()` is now called
`create_default_shift_matrix()`
- Package data files renamed:
- `phylo_Vign` is now called `phylo_vignette`
- `traitinfo` is now called `traits`
- `phy` is now called `example_phy_GeoSSE`
- `plot_state_exact()` argument `steps` renamed to `num_steps` and
argument `focal_tree` renamed to `phy` for consistency with other
functions.

## Major changes

* Vastly improve the computational speed of "cla_" likelihood calculation.
* Optimization of parallelization resulting in better scaling with more threads
and faster run time for standard secsse and cla_secsse likelihood calculations.
- Vastly improve the computational speed of "cla\_" likelihood
calculation.
- Optimization of parallelization resulting in better scaling with
more threads and faster run time for standard secsse and cla_secsse
likelihood calculations.

## Minor changes
* Added a `NEWS.md` file to track changes to the package.
* Documentation reworked into `default_params_doc()`.
* Several documentation formatting improvements and linking. Documentation now
follows and allows for roxygen2 markdown.
* A new vignette:
* _Using secsse with complete phylogenies (with extinction)_ `vignette("complete_tree", package = "secsse")`
* A new [pkgdown website](https://rsetienne.github.io/secsse/index.html)!
* It contains all the documentation and vignettes of the package, along with
additional interesting information like the _Secsse versions_ article with
details on performance and the development history of secsse.
* Revise, combine and simplify the _Using SecSSE ML search_ and _Setting up a
secsse analysis_ into the _Starting secsse_ vignette
`vignette("starting_secsse", package = "secsse")`.
* `secsse_sim()` argument `conditioning` now defaults to `"obs_states"` from
`"none"`.
* No longer Import package 'stringr' and Suggest package 'testit'.
* New organisation of code in .R, .cpp and .h files. (Developer side).
* Start archiving in Zenodo, with new .zenodo.json metadata file.

- Added a `NEWS.md` file to track changes to the package.
- Documentation reworked into `default_params_doc()`.
- Several documentation formatting improvements and linking.
Documentation now follows and allows for roxygen2 markdown.
- A new vignette:
- *Using secsse with complete phylogenies (with extinction)*
`vignette("complete_tree", package = "secsse")`
- A new [pkgdown
website](https://rsetienne.github.io/secsse/index.html)!
- It contains all the documentation and vignettes of the package,
along with additional interesting information like the *Secsse
versions* article with details on performance and the
development history of secsse.
- Revise, combine and simplify the *Using SecSSE ML search* and
*Setting up a secsse analysis* into the *Starting secsse* vignette
`vignette("starting_secsse", package = "secsse")`.
- `secsse_sim()` argument `conditioning` now defaults to
`"obs_states"` from `"none"`.
- No longer Import package 'stringr' and Suggest package 'testit'.
- New organisation of code in .R, .cpp and .h files. (Developer side).
- Start archiving in Zenodo, with new .zenodo.json metadata file.

## Bug fixes
* `secsse_sim()` fix bug causing error when simulating trees with extinct
species.

- `secsse_sim()` fix bug causing error when simulating trees with
extinct species.

# 2.6.0

## Major changes
* C++ code base for the standard likelihood, making smarter use of
parallelization, this marks another 10-fold increase in speed.

- C++ code base for the standard likelihood, making smarter use of
parallelization, this marks another 10-fold increase in speed.

## Minor changes
* Add a number of helper functions: `fill_in()`, `create_default_q_list()`,
`create_default_transition_list()`, `create_mus()`
* Implemented necessary changes to comply with CRAN clang16 build and solve
issue with the boost odeint library uninitialized variable
(see https://github.com/boostorg/odeint/issues/59 and more details at
https://github.com/rsetienne/DAISIE/pull/158)
* Updated Copyright license to the Boost Software License, Version 1.0 for
included C++ code (R code remains GPL>=3).

- Add a number of helper functions: `fill_in()`,
`create_default_q_list()`, `create_default_transition_list()`,
`create_mus()`
- Implemented necessary changes to comply with CRAN clang16 build and
solve issue with the boost odeint library uninitialized variable
(see <https://github.com/boostorg/odeint/issues/59> and more details
at <https://github.com/rsetienne/DAISIE/pull/158>)
- Updated Copyright license to the Boost Software License, Version 1.0
for included C++ code (R code remains GPL\>=3).

## Bug fixes
* Fix memory leaks

- Fix memory leaks

# 2.5.0
Version 2.5.0 appeared in 2021 on GitHub and was published in May 2023 on CRAN.
Version 2.5.0 marks the first version using C++ to perform the integration,
and it used tbb (from the RcppParallel package) to perform multithreading. This
marks a ten fold increase in speed over previous versions.
Secondly, 2.5.0 introduces the function `secsse_sim()` to simulate a
diversification process using the (cla) secsse framework.
Lastly, in version 2.5.0 functions were added to allow visualisation of
inferred rates of speciation across the tree (e.g. `plot_state_exact()` and
`secsse_loglik_eval()`).

Version 2.5.0 appeared in 2021 on GitHub and was published in May 2023
on CRAN. Version 2.5.0 marks the first version using C++ to perform the
integration, and it used tbb (from the RcppParallel package) to perform
multithreading. This marks a ten fold increase in speed over previous
versions. Secondly, 2.5.0 introduces the function `secsse_sim()` to
simulate a diversification process using the (cla) secsse framework.
Lastly, in version 2.5.0 functions were added to allow visualisation of
inferred rates of speciation across the tree (e.g. `plot_state_exact()`
and `secsse_loglik_eval()`).

# 2.0.0
Version 2.0.0 appeared in June of 2019 on CRAN and extended the package with the
cla framework, e.g. including state shifts during speciation / asymmetric
inheritance during speciation.

Version 2.0.0 appeared in June of 2019 on CRAN and extended the package
with the cla framework, e.g. including state shifts during speciation /
asymmetric inheritance during speciation.

# 1.0.0
The first version of secsse appeared in January of 2019 on CRAN. It used the
package deSolve to solve all integrations, and could switch between either using
a fully R based evaluation, or use FORTRAN to speed up calculations.
Furthermore, using the foreach package, within-R parallelization was
implemented. However, parallelization only situationally improved computation
times, and generally, computation was relatively slow.

The first version of secsse appeared in January of 2019 on CRAN. It used
the package deSolve to solve all integrations, and could switch between
either using a fully R based evaluation, or use FORTRAN to speed up
calculations. Furthermore, using the foreach package, within-R
parallelization was implemented. However, parallelization only
situationally improved computation times, and generally, computation was
relatively slow.
7 changes: 5 additions & 2 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ ct_condition_cpp <- function(rhs, state, t, lambdas, mus, Q, method, atol, rtol)
.Call(`_secsse_ct_condition_cpp`, rhs, state, t, lambdas, mus, Q, method, atol, rtol)
}

secsse_sim_cpp <- function(m_R, lambdas_R, q_R, max_time, max_species, min_species, init_states, condition, num_concealed_states, non_extinction, verbose, max_tries, seed, conditioning_vec) {
.Call(`_secsse_secsse_sim_cpp`, m_R, lambdas_R, q_R, max_time, max_species, min_species, init_states, condition, num_concealed_states, non_extinction, verbose, max_tries, seed, conditioning_vec)
#'
NULL

secsse_sim_cpp <- function(m_R, lambdas_R, q_R, max_time, max_species, max_species_extant, min_species, init_states, condition, num_concealed_states, non_extinction, verbose, max_tries, seed, conditioning_vec, return_tree_size_hist) {
.Call(`_secsse_secsse_sim_cpp`, m_R, lambdas_R, q_R, max_time, max_species, max_species_extant, min_species, init_states, condition, num_concealed_states, non_extinction, verbose, max_tries, seed, conditioning_vec, return_tree_size_hist)
}

10 changes: 9 additions & 1 deletion R/default_params_doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
#' tree is not conditioned on this number, but that this is a safeguard
#' against generating extremely large trees).
#' @param min_spec Minimum number of species in the tree.
#' @param max_species_extant Should the maximum number of species be counted in
#' the reconstructed tree (if TRUE) or in the complete tree (if FALSE).
#' @param tree_size_hist if TRUE, returns a vector of all found tree sizes.
#' @param conditioning can be `"obs_states"`, `"true_states"` or `"none"`, the
#' tree is simulated until one is generated that contains all observed states
#' (`"obs_states"`), all true states (e.g. all combinations of obs and hidden
Expand Down Expand Up @@ -209,6 +212,11 @@ default_params_doc <- function(phy,
params,
param_posit,
ml_pars,
mu_vector) {
mu_vector,
max_spec,
min_spec,
max_species_extant,
tree_size_hist,
optimmethod) {
# Nothing
}
Loading

0 comments on commit 3979888

Please sign in to comment.