Dear Editor,
I am grateful for the associate editor and the two reviewers time and very encouraging comments that I totally believe have improved the package, the manual and this manuscript. Please find my response to the reviewers comments in the following document. I've highlight the Associate Editor and both reviewers comments in blue and my response black. I'm also sorry for the delay in dealing with the reviewers comments: I was unemployed until November so didn't work on it until then.
Best regards, Thomas
As both reviewers, I really liked the idea of the package, but also found the manuscript itself a bit hard to follow, which, at least to me, made it hard to fully appreciate what “treats” can currently do and what are the future additions that might be easily implemented (either by the developer, or by users). Reading the online manual, I got a better idea, and hence I think there is still room (metaphorically and I suspect also physically) for improvement. Sure, the online material has no space limit constraints, but I do think the manuscript text could be improved and both reviewers offered some nice suggestions. Apart from the really good suggestions given by both reviewers I would add the following suggestions/comments:
The trait data in treats
is only stored at nodes and tips due to the code architecture. However, using the argument save.steps
allows to create singleton nodes (nodes with one ancestor and only one descendant) that can be generated at some specified or regular time intervals thus effectively saving trait values as the simulation goes. I've now specified this in the main text (and removed the typo):
4. Generating some trait(s) value(s) for the selected lineage (either a tip or a node - but see the "Simulating traits section" below to generate trait values along edges). line 78-79.
and:
"Traits are always generated (and stored) only for tips or nodes and not along edges. However, it is possible so generate trait values at specific or regular time intervals by using the option save.steps
in the treats
function. This will generate singleton nodes (i.e. nodes with only one descendant) with associated trait values." line 110-112.
This is an excellent suggestion. I've now reworked events
to now always generates singleton nodes (and associated trait values if needed) at the time of the event before applying the modification. This way it will generate extinction based at the trait value of the extinction time rather than the latest node as it should be the case. It is then possible to remove the generated singleton nodes to clean up the tree (to have just data for bifurcating nodes and tips). This is now updated in the example.
I've changed the seeds for the plotted random/non-random extinctions that illustrates the selectivity more. I've also added a horizontal line at the value 0 to show the positivity of the extinction event for the non-random one.
I've changed the comment to ## Simulate the tree and traits with a selective extinction event
. code block after line 203.
I've added references to figures 5 and 6 in the text on lines 203 and 207.
I've removed the repetitions.
The results seems a bit different now having chosen a different seed. However, I have added the Associate Editor's judicious comment to the main text:
"Both scenarios illustrate two different types of mass extinctions but they are not equivalent: because of the ancestral trait value starting at 0, we expect the second scenario to remove on average only 50% of the species (i.e. half the species are expected to evolve a trait value above 0). For more details on simulating the effect of mass extinction and the difficulties to simulate an unambiguous effect of a mass extinction, see Puttick, Guillerme, and Wills (2020)." lines 195-199.
This article by Guillerme introduces a new R package treats, which implements a flexible framework for simulating phylogenies and associated trait values. Overall, I really like the concept of the package, and I think it can be very useful for more advanced users who run many simulations and change their setup often. My comments are mostly about clarifying the presentation of the different functions. I also reviewed the manual.
I've now clarified what treats
does and doesn't in the introduction:
"Note that although treats
is modular and thus allows to be used as go to tool for simulating and trees and traits, it lacks the ready-to-use implemented methods featured in other packages such as fossilisation and sampling [@fossilsim; @treesim; @paleobuddy] or specific macroevolutionary simulations [@rpanda; @puttick2020complex].
". line 63-67
I've also removed the mention of the future time-dependent and lineage-dependent simulations: these are meant to be internal implementations allowing the algorithm to track time and lineage IDs across each edges which will allow even more modularity in the future but is out of the scope of this paper.
"For example future planned versions will include abiotic events and a better integration with the dispRity
package.
". line 218-219
I tried (and saved the tests in tests/test-benchmarking.R
for people to explore) but I'm not convinced how useful it is.
First I feel it's confrontational to the other authors since none of them had the same objectives in mind.
Second I will be biased in making treats look better (when possible) because I know how it works in much more details.
Third I don't think it's something I want to put forward as a reason of why to use the package, e.g. it's slower than TreeSim but faster than diversitree (under certain parameters) but that's not the reason while one should use treats over diversitree and TreeSim (the point I am trying to sell is the modularity, i.e. if you want to simulate something specific, treats is good, otherwise, go with what other people have used before).
I've now added the following precision:
"The number of time units in treats
is arbitrary and is not equivalent to millions of years.
Using 30 time units here allows to simulate number of tips in a similar order of magnitude as the ones in the observed data." lines 181-183.
I am happy that both reviewers are enthusiastic about the templates library. Unfortunately I'm not totally sure how to implement it and make it easier to use and browse by users. So for now I've set up a templated category of issues on github called simulation templates. I've updated the README file with some indications on how to save and share such a template.
Fixed.
Fixed.
Fixed.
Fixed.
Fixed.
This one is just generated as such from the mee.csl
reference style.
I've now added a cheat sheet to the github page that shows the key arguments and their inputs/outputs here. This cheat sheet is rather minimal for now but I'm planning on expanding on it and making it more interactive (with mouse over menus, etc.) in the future. Furthermore I've tidied up the summarising of functions in the manual as suggested by the reviewer.
I have now added clarifications of what the "modifiers"
are and how they should be used. Both in the section 2.3 as a simple explanation and in the section 4 dedicated to "modifiers"
.
I've added a @return
section to the treats
, make.treats
, make.bd.params
, make.traits
, make.modifiers
and make.events
documentations as well as the following section in the manual "Getting started" section:
treats
will output either just a tree (class "phylo"
) if no traits were generated or a "treats"
object that contains both a $tree
("phylo"
) and a $data
("matrix"
) component.
Note that this "treats"
class is generalised to most outputs of the package functions.
This allows for a smoother handeling of the objects outputs such as summarising the content of a make.bd.params
output or visualising a trait output from make.traits
.
Thank you for the opportunity to review this manuscript, titled “treats: a modular R package for simulating trees and traits”. This manuscript describes and showcases a new R package that provides users with an extensive toolbox to jointly simulate phylogenies and evolving traits. While the example provided within the manuscript gives readers a small taste of the flexibility of this toolbox, the online manual (http://tguillerme.github.io/treats.html) showcases the true extent of how useful this package will be for evolutionary biologists far and wide. I really enjoyed reading the manuscript, and I believe it will be suitable for publication in Methods in Ecology & Evolution once my concerns have been addressed.
For context, for this review I read the supplied manuscript, tested the functionality of the R package, and browsed the built-in documentation and the online supplemental manual. I was unable to review the functional code of the R package in time for the due date of this review, but it appears to work properly from my testing. I have one major concern and a handful of minor concerns. The major concern is that the overall flow of the manuscript seems a little off. I think this mostly stems from the worked example preceding the detailed overview of the package’s functions. I think if these two sections were swapped the manuscript would flow much better. My minor concerns are included at the end of this review in order of their appearance in the manuscript. I look forward to reviewing a revised version of this manuscript, if necessary.
I have now changed the order of the structure of the manuscript with the description coming first and the example coming second.
Best,
William Gearty
Done.
Fixed.
Done with the now new inclusion of the dispRitreats
code that streamlines the analysis.
Done.
I've now added a verbose
option to the treats
function allowing to display the progress or not. Unfortunately the progress bar suggestion, although comfortable to most users is not feasible effectively with stochastic data: here the output indicates every re-ran tree for each replicate. And because the number of runs varies depending on the random seed, tracking the progress in terms of percentage will require more computational time (i.e. estimating how many re-run are expected for the current seed before increase the progress bar).
I've added the following sentence at the end of the paragraph:
"Because of the stochasticity of the simulations, we will repeat them 50 times (using replicates = 50
) to generate a distribution of possible simulated scenarios as opposed to a random single one that could be idiosyncratic." lines 200-203
I have streamlined and display the code to allow the users to test the package while reading the paper.
Done. line 207.
I've added the URL spelt out.
As mentioned before, I was not sure how to effectively implement that so I made a simulation templates issues category on github for now.
Fixed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.