Skip to content

SEIR Template

Igor Siveroni edited this page Mar 12, 2020 · 10 revisions

SEIR Template

PhyDyn v1.3.6 packs a subtemplate (Phydyn SEIR) that generates xml code that replicates the Phydyn Weifang analysis (weifang-sarscov2/beast/seir.xml)

You need BEAST version 2.6 or higher in order to install Phydyn v1.3.6.

The following steps explain how to set the same parameters used in seir.xml.

Sequences

BEAST must be able to extract the dates from the sequence names. Phydyn needs every sequence name to by suffixed by '" (exog and Il in our example). I have the following format: Guangdong/20SF201/2020_2020.06010928962_exog

  • Import the sequence file with the File->Import_Alignment option from the main menu.
  • Click on the Tip_Dates tab and select the use_tip_dates check-box.
  • Click on the Auto-configure button and select the appropiate format to extract the date. In my case I used: Split on character '_' and take group 2.

Substitution and Clock model and select the Use_tip_dates checkbox.

Click on the Site_Model tab and set the following:

  • Gamma Category Count: 4
  • Substitution model : HKY (from the drop-down menu)

Click on the Clock Model tab. Leave Strict_Clock unchanged but set:

  • Clock.rate : 0.002

Starting tree

BEAST starts the analysis with a random tree. The default population size used is 1.0 but the current analysis uses 0.01. You can change this value from Beauti:

  • Click on the View option from the main menu and select Show_starting_tree panel.
  • Change Pop Size from 1.0 to 0.01.

Priors

BEAST generates default priors for the site and clock model parameters. The analysis uses a different starting value (already changed) and prior for clock rate. We need to change the clock rate prior to Uniform[0.0007, 0.003].

  • Select clockRate.c:. A panel showing the current prior, Uniform[0,Infinity], will appear below.
  • Change lower to 0.0007 and upper to 0.003.

The PhyDyn tree prior: STreeLikelihoodODE

Phydyn's likelihood function is normally used as a tree prior in BEAST analyses. The current tree prior is Yule_Model. We need to change this:

  • Select Phydyn_SEIR from the drop-down menu (it should be there! otherwise v1.3.6 is not installed)

Priors from E, S, b, exog,exogGrowthRate and importRate will automaticaly be added. These are the model parameters currently sampled.

You can inspect and edit Phydyn's parameter values by clicking on Tree.t: - a panel describing the main STreeLikelihood options will open below. The population model (SEIR) can be accessed by selecting the 'pencil' next to popmodel. If you select popmodel->model_parameters you will see the list of all the parameters used by the SEIR model; popmodel->PopParams will give you access to the deme and non-deme parameters (with initial values at t0) and t0. If, for example, you click on seir.b.pv.t: you will see that b's value is 25.0 and that it is a parameter being sampled by the analysis (the estimate checkbox is selected). You can add/remove parameters from the mcmc state by selecting/unselecting the estimate box - Beauti will automatically add/remove the corresponding priors and operators.

Generate XML

Generate the XML with the File->Save_As option. You can always go back and edit the analysis specification by loading the XML file with the File->Load option (as long as the original xml was not modified drastically by hand). Operators can be accessed via the Operators panel (View->Show_Operators_panel).

Clone this wiki locally