 Hello, my name is Tim Vaughan. I'm a senior scientist in Danish Douglas Computational Evolution Group at the ETH Steric. And I'm going to talk to you today about how to easily simulate trees and populations in beast 2 using a new tool remaster. So just to start off, to clarify the target audience for this talk is primarily beast 2 users. So people are already using beast 2. And in particular, package or model developers, I think would get a lot out of this. But apart from this, anybody keen on engaging in phyladynamic simulation studies for various purposes, including model exploration or validation. In terms of learning objectives, by the end of this presentation, you should understand roughly, and roughly, not in detail, but roughly what remaster is, how it relates to an earlier package master, how to design and specify phyladynamic models for remaster, how to use these models to simulate population trajectories and trees, and of course, where to go for further information. So firstly, what is remaster and what does it do? The first thing you need to know about it is that it's a beast 2 package. So it's a package that runs on another piece of software. You know, in a beast 2, that is a more general purpose phyladynamic and phyladynamic inference software platform. In terms of remaster itself, the idea is that you conceptualize some model. I'll get into the details of this later on. And using remaster, you can generate simulations, simulated realizations of population dynamics through time and the trees that relate sampled individuals from those populations. In terms of how this actually works, practically you specify a model using an XML file syntax. This model is passed to remaster and beast and the software produces output files that constitute the output of the simulations. To install and run remaster is quite simple. You need beast 2 installed. And once you have beast 2 installed, you just need to install the remaster package in the same way that you install other beast 2 packages. Remaster XMLs, simply beast 2 XMLs. So this is the format for analyses that you run in beast and the way you run these analyses or run these simulations is to just load these XMLs into beast as usual. Just for context and the reason for the name, remaster is a complete rewrite of an earlier package that was developed and published in 2013 on his master. It is similar in many ways, but the original package had several problems that remaster ain't to address. In particular, tree simulation was very slow and memory intensive. Common sampling schemes that are used in birth death models were difficult to configure. Coalescent model simulations were very awkward to set up and overall the general integration with the rest of beast was very, very poor. So remaster aims to solve these problems. Now we're going to dive into model specification, what a remaster model actually represents. So models in remaster consist of two primary components. Firstly, one or more populations of individuals. So here we have two populations of individuals labeled A and B. If you want to sample trees, you additionally need one more sample population. In addition to these populations, one needs to specify one or more reactions that indicate how groups of individuals are updated over the course of the dynamics to produce population trajectories and trees. In order to actually simulate trees, though the reactions on their own and on enough, one also has to specify the parent-child relationships between individual reactants on one hand and the products of a given reaction. For birth-death trees, an additional set of reactions are necessary that produce samples. These correspond to tips in the simulated trees. Just an overview of what an XML input file for a remaster simulation would look like. This is one such XML input file. I'm not going to go into the details, but what you can see just roughly is that we have these population specifications and we have these reaction specifications right in the file. So it is mirroring this conceptual overview that I gave on the previous slide. Okay, so that's all in terms of background. For the worked examples, we're going to just look at two examples of applying remaster to the simulation of different kinds of models. Firstly, I'll look at a model that is common in epidemiology, namely the susceptible exposed infectious and the remove model, which is a classic four-compartment model. So we define in terms of our remaster model, we define four populations, SE, INR, to correspond to each of these four compartments. And to actually model the start of an outbreak, we need to define the initial population sizes. So we'd set these to something like this vector here where the initial number of S is N minus one, where N is some total number of individuals, and the number of initially exposed individuals is just one, and the number in the other compartments is just zero. The reactions that would define an SEIR model in remaster would be as follows. So here we can see just for this first reaction, we've got an infection where an infected individual and susceptible individual interact to produce one more exposed individual. These exposed individuals eventually become infectious, and those infectious individuals eventually removed all of these at various rates. And these rates, beta, alpha, gamma must be chosen for the simulation. You need numerical values for these, of course. The simulation XML for this SEIR model looks or could look like this. So again, we see that we have these four population elements here defining the populations and their initial sizes. And we also have these three reactions that we talked about. Finally, we also have this output specification that says we're going to write these trajectories to this output.trag file. This output file, once the analysis is actually run, can be read directly into R and plotted with something like ggplot to produce this kind of graphic where we can see the dynamics of each of these four compartments over time. What we're seeing here is actually several realizations of this process independently produced by renaster. Moving on to the second example. So the fossilized birth death model is a model from macroevolution. And it's used to describe the appearance of fossils on species tree lineages sampled at the present. So in terms of the simplest incarnation of this model, we define one population. Here we're just going to label it X to represent all species, including unobserved species. And of course, we have to define some initial population size for this. And here we're just going to say one at some point in the past. We also have a sample population to represent samples. So they could be present day species or fossils. The reactions here, we're going to need a speciation reaction, an extinction reaction and this sampling reaction. And you can see this sampling reaction doesn't actually remove individuals from the pool, but rather just adds a new sample at a particular time. And in addition to these, we use a punctual reaction. This is remaster's notation or nomenclature for a reaction that occurs at a particular time. So this occurs only at the present and produces the present day samples. So this is what the XML depiction of this model might look like. Again, when we see exactly the same things we saw on the previous slide. The only difference here with the trajectory simulation in the last example is that we've racked the whole simulation element in this simulated tree element. And we're also outputting a tree file rather than a trajectory file. So once that's run, we get this tree file. We can load that into IC tree or fig tree or your favorite tree visualization tool. And we can see the outcome of the simulation. We can see that we have some samples, some tips that are appearing through time and these dots correspond to samples that are collected through time as well. And then we have all of our samples at the present. So just some additional things. Firstly, I haven't until now mentioned coalescent simulations, remaster handles coalescent models similarly to the way we've discussed for birth death models. But here populations, instead of just an initial population size, they're deterministic parametric functions of time. And the reactions that one must specify govern how tree lineages call us and migrate backward in time rather than how the process evolves forward in time. In addition, I mentioned that integration with beast two was something that master lacked. Remaster really is tightly integrated with the rest of beasts. A lot of this is only going to make sense if you're familiar already with beast. But if you are, this is important. So trees are standard beast tree objects, the simulated trees that is. Remaster is using standard logger objects to produce the output. It uses real parameter or function objects to define birth death populations. And it uses beast standard population function objects to define coalescent populations. And all of the inputs defining numerical quantities such as rates, times or probabilities or numbers expect just these generic function inputs. And all of this means that it's possible to use Remaster to do things like initialize MCMC chains or simulate sequence data or produce single combined XML simulation studies that combine both the simulation phase and an inference phase using beasts and Markov chain Monte Carlo mechanism. So that's the end of the very rough overview I wanted to give for further information. You should visit this website. The URL is given on the screen here. This is a comprehensive usage manual and this includes many, many examples, many more than I've presented here. So please read through that and look there for further information if you're interested in Remaster. Thank you.