Skip to content

Commit

Permalink
figure updates etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicfel committed Jul 30, 2019
1 parent 91bdbf7 commit c5234cd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
35 changes: 22 additions & 13 deletions README.md
Expand Up @@ -21,7 +21,7 @@ In order to allow inference in the presence of reassortment, we introduced the c

### BEAST2 - Bayesian Evolutionary Analysis Sampling Trees 2

BEAST2 ([http://www.beast2.org](http://www.beast2.org)) is a free software package for Bayesian evolutionary analysis of molecular sequences using MCMC and strictly oriented toward inference using rooted, time-measured phylogenetic trees. This tutorial is written for BEAST v{{ page.beastversion }} {% cite BEAST2book2014 --file CoupledMCMC-Tutorial/master-refs %}.
BEAST2 ([http://www.beast2.org](http://www.beast2.org)) is a free software package for Bayesian evolutionary analysis of molecular sequences using MCMC and strictly oriented toward inference using rooted, time-measured phylogenetic trees. This tutorial is written for BEAST v{{ page.beastversion }} {% cite BEAST2book2014 --file Reassortment-Tutorial/master-refs %}.


### BEAUti2 - Bayesian Evolutionary Analysis Utility
Expand Down Expand Up @@ -74,7 +74,7 @@ Then, repeat the same thing for the other segment.
<figure>
<a id="fig:example1"></a>
<img style="width:30%;" src="figures/SplitAlignments.png" alt="">
<figcaption>Figure 2: Split alignments into codon positions.</figcaption>
<figcaption>Figure 3: Split alignments into codon positions.</figcaption>
</figure>

## Linking the site models and clock models
Expand All @@ -89,15 +89,15 @@ In the new window, select split on character
<figure>
<a id="fig:example1"></a>
<img style="width:30%;" src="figures/SplitCharacter.png" alt="">
<figcaption>Figure 2: Split character and tke the second group to get the sampling times .</figcaption>
<figcaption>Figure 4: Split character and tke the second group to get the sampling times .</figcaption>
</figure>

In order to set the tip dates for both segments, select both partitions an press `OK`

<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/CloneTipDates.png" alt="">
<figcaption>Figure 2: Clone tip dates .</figcaption>
<figcaption>Figure 5: Clone tip dates .</figcaption>
</figure>

## Setting up the site model
Expand All @@ -108,15 +108,15 @@ Also, set the `Gamma Category Count` to 4 and make sure to click `estimate` for
<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/SiteModel.png" alt="">
<figcaption>Figure 2: Setting up the site models .</figcaption>
<figcaption>Figure 6: Setting up the site models .</figcaption>
</figure>

We next have to go back to the `Partitions` ta, select all Partitions and then press `Unlink Site Models`. This allows each parition to have its own site model with its own parameters.

<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/UnlinkSiteModels.png" alt="">
<figcaption>Figure 2: Setting up the site models.</figcaption>
<figcaption>Figure 7: Setting up the site models.</figcaption>
</figure>

## Setting up the Priors
Expand All @@ -128,7 +128,7 @@ This has to be done for both (!) trees.
<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/CoalescentWithReassortment.png" alt="">
<figcaption>Figure 2: Changing the Yule model to the coalescent with reassortment.</figcaption>
<figcaption>Figure 8: Changing the Yule model to the coalescent with reassortment.</figcaption>
</figure>

We now have to set the prior distribution on the parameters.
Expand All @@ -138,7 +138,7 @@ Set the prior distribution on the reassortment rate to be an exponential distrib
<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/ReassortmentPrior.png" alt="">
<figcaption>Figure 2: Setting the prior distribution on the reassortment rate.</figcaption>
<figcaption>Figure 9: Setting the prior distribution on the reassortment rate.</figcaption>
</figure>

## Setting up the Chain Length
Expand All @@ -148,7 +148,7 @@ This was the last step of setting up the xml and we can now save it by going to
<figure>
<a id="fig:example1"></a>
<img style="width:20%;" src="figures/SaveXml.png" alt="">
<figcaption>Figure 2: Save xml.</figcaption>
<figcaption>Figure 10: Save xml.</figcaption>
</figure>

## Run the xml
Expand All @@ -164,7 +164,7 @@ All ESS values should optimally be above 200.
<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/Tracer.png" alt="">
<figcaption>Figure 2: Check convergence in Tracer.</figcaption>
<figcaption>Figure 11: Check convergence in Tracer.</figcaption>
</figure>

Next, we can check what rates were inferred.
Expand All @@ -182,20 +182,29 @@ Next, choose the `networks.trees` file as input for the `Reassortment Network lo
<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/Summary.png" alt="">
<figcaption>Figure 2: Produce the maximum clade credibility network.</figcaption>
<figcaption>Figure 12: Produce the maximum clade credibility network.</figcaption>
</figure>


## Visualize the network using icytree.org
Next, open your browser and go to the webpage [icytree.org](icytree.org)
Next, open your browser and go to the webpage [icytree.org](icytree.org){% cite vaughan2017icytree --file Reassortment-Tutorial/master-refs %}
The resulting mcc network file can now be drag and dropped into icytree to visualize the network.
Icytree plots the network as a base tree that is connected by dotted branches.
This implies that at a reassortment event, there is a difference between the two parent branches.
This is, however, not the case in the coalescent with reassortment model, but for simplicity is plotted like this.
The "main" branch here is the always the parent branch that carries more segments.
If both branches carry the same amount of segments, the branch that is closer the next event is chosen as the main branch.

<figure>
<a id="fig:example1"></a>
<img style="width:70%;" src="figures/IcyTree.png" alt="">
<figcaption>Figure 2: Produce the maximum clade credibility network.</figcaption>
<figcaption>Figure 13: Visualize the mcc network in icytree.</figcaption>
</figure>

The 95 $\%$ highest posterior density intervals for node heights can be plotted by going to `Style > Node height error bars`.
The posterior support for each node can be shown by going to `Style > Internal noe text`.



----

Expand Down
5 changes: 5 additions & 0 deletions precooked_runs/H1N1pdm.mcc.network.trees
@@ -0,0 +1,5 @@
#nexus
begin trees;
tree STATE_0 = (((A/Bangkok/INS3_681/2012|2012-09-21[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={4.623894004042086,4.623894004042086}]:1.6974267284817657,((((((A/Nicaragua/6322_06/2015|2015-12-08[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.4109589041095196,1.4109589041095214}]:1.4294570757463028,A/Hawaii/67/2014|2014-10-12[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={2.5671232876711647,2.5671232876711665}]:0.2732926921846577)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.7869034406215316,height_95%_HPD={2.6368065664637355,3.149928831377712}]:0.668301611827467,A/New_York/WC_LVD_14_063/2014|2014-02-09[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={3.238356164383503,3.2383561643835046}]:0.27036142729964885)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.19755826859045506,height_95%_HPD={3.3320195966805968,3.857244216177078}]:0.22767152722750517,((((A/Seoul/224/2016|2016-02-03[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.2550415450257315,1.255041545025735}]:0.28993884507051915)#H2[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.8446170921198668,height_95%_HPD={1.2742202474000957,1.9234027771075741}]:0.6374987938328631,(A/Florida/100/2015|2015-12-20[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.3780821917807762,1.3780821917807788}]:0.3453365579046752)#H3[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.7524972253052165,height_95%_HPD={1.4038864433726932,2.2007519886777667}]:0.4590604342436737)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2]:0.5851464519790182,((#H3[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.7524972253052165,height_95%_HPD={1.4038864433726932,2.2007519886777667}]:0.1387104479792931,(A/Washington/01/2017|2017-01-06[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.3315068493150175,0.33150684931502106}]:0.6485443730373913)#H4[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.7991120976692564,height_95%_HPD={0.3796460039701577,1.6087746755710066}]:0.8820779753123348)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2]:0.33968977976190384,((((A/South_Dakota/13/2017|2017-02-18[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.21369863013705803,0.21369863013706158}]:1.2819928832077885,A/California/45/2016|2016-02-20[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.208593457594132,1.2085934575941355}]:0.2870980557507117)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.709211986681465,height_95%_HPD={1.3121379264070994,1.7550302749715847}]:0.22521283463647923,#H2[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.8446170921198668,height_95%_HPD={1.2742202474000957,1.9234027771075741}]:0.17592395788506465)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.6082130965593785,height_95%_HPD={1.516699248854814,1.9795573847159975}]:0.06313371558502379,(((A/North_Dakota/15/2017|2017-03-19[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.13424657534232942,0.13424657534233297}]:0.2533432217315954,A/California/19/2017|2017-01-29[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.268493150684888,0.26849315068489155}]:0.11909664638903683)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9866814650388457,height_95%_HPD={0.2754756372696727,0.6130130828574893}]:0.6074527904047787,(A/Illinois/26/2017|2017-03-16[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.14246575342462897,0.14246575342463252}]:0.2522467221284866,A/Alaska/07/2017|2017-02-13[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={0.227397260273845,0.22739726027384854}]:0.16731521527927057)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9844617092119867,height_95%_HPD={0.2642944880626459,0.5928063908855306}]:0.6003301119255879)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9500554938956715,height_95%_HPD={0.6834591601447269,1.3120919939858355}]:0.30977772495598177)#H5[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.07880133185349611,height_95%_HPD={0.8954532060624656,1.6772396210152598}]:0.4792177511316642)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.00776914539400666,height_95%_HPD={1.6272498091698413,2.111601932495745}]:0.04752464859984573,(((A/Kansas/14/2016|2016-03-24[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.1184295231678316,1.1184295231678352}]:0.2588144576033069,A/Utah/35/2016|2016-04-22[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.0391945504902633,1.0391945504902669}]:0.3380494302808752)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.3662597114317425,height_95%_HPD={1.2391799806593502,1.5438655825968377}]:0.10280071758156839,A/Arizona/32/2015|2015-12-29[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.3534246575343314,1.353424657534335}]:0.1266200408183611)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.7547169811320755,height_95%_HPD={1.3732262350941946,1.6682908672510308}]:0.1952707452518696,(((A/Arizona/33/2017|2017-05-07[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={-1.7763568394002505E-15,1.7763568394002505E-15}]:1.2541075941636584,#H4[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.7991120976692564,height_95%_HPD={0.3796460039701577,1.6087746755710066}]:0.27405637181124776)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.7291897891231964,height_95%_HPD={0.8348894603071271,1.6930606651256292}]:0.19948907600280075,#H5[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.07880133185349611,height_95%_HPD={0.8954532060624656,1.6772396210152598}]:0.148776357731772)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.021087680355160933,height_95%_HPD={1.1881844007273088,1.7076731216085541}]:0.232475841400948,A/New_Mexico/19/2016|2016-02-28[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={1.1867355340968953,1.1867355340968988}]:0.4993369774705101)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.003329633740288568,height_95%_HPD={1.6483878866917285,1.7436960128218333}]:-0.010757067962828826)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.0022197558268590455,height_95%_HPD={1.6269449356735919,1.7236859515355647}]:0.15624726856161875)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.37180910099889014,height_95%_HPD={1.6385083500497686,2.1133860308971837}]:0.3702562652604522)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.16537180910099888,height_95%_HPD={1.8545833873463087,2.5480075224840535}]:0.5658066584814949)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.32519422863485015,height_95%_HPD={2.3789278300657584,3.172038109174239}]:0.4644475276745412)#H1[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.5671476137624861,height_95%_HPD={2.642781864971081,3.7464839544173323}]:0.50431595532811)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.37846836847946724,height_95%_HPD={3.4135481251179556,4.16613930574594}]:0.6356730702725382,(A/Finland/87/2014|2014-02-14[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={3.2246575342464894,3.2246575342464903}]:0.2957649514803071,A/Finland/75/2014|2014-02-10[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={3.2356164383561463,3.235616438356147}]:0.2848060473706364)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9800221975582686,height_95%_HPD={3.354665697755289,3.743450535742036}]:0.8516397034564052)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.15760266370699222,height_95%_HPD={4.113023742567727,4.774845460206941}]:0.15344004897099595,(((#H1[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.5671476137624861,height_95%_HPD={2.642781864971081,3.7464839544173323}]:0.8902158341164745,(A/Helsinki/473N/2014|2014-02-10[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={3.2356164383561463,3.2356164383561463}]:0.5586840980887442,(A/New_York/WC_LVD_14_021/2014|2014-01-30[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={3.2657534246575324,3.2657534246575324}]:0.3010695143508779)#H7[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.18756936736958935,height_95%_HPD={3.2874880153274706,4.156371935059751}]:0.22747759743676976)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9367369589345172,height_95%_HPD={3.443564417559574,4.266686841492398}]:0.3279884612541246)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.4051054384017758,height_95%_HPD={3.6802851488912673,4.604024777469187}]:0.054978624593254644)#H6[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.03107658157602664,height_95%_HPD={3.759985289605951,4.660587904989298}]:0.28199225581035936,#H7[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.18756936736958935,height_95%_HPD={3.2874880153274706,4.156371935059751}]:0.8924369390945084)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2]:0.0662423600515556)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.7136514983351832,height_95%_HPD={4.187070086423123,4.960103675520736}]:0.4493035125726683)#H0[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.6958934517203108,height_95%_HPD={4.414101991973996,5.6546341852756425}]:1.3465149817968536)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.8190899001109878,height_95%_HPD={5.729605410033507,6.930595279727157}]:0.5707518426582974,A/Nizhnii_Novgorod/CRIE_BLM/2011|2011-01-26[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={6.276712328767189,6.276712328767189}]:0.6153602464152472)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.39178690344062156,height_95%_HPD={6.54818397604642,7.386923998797418}]:0.2678302799600205,((A/Durham/INS3_648/2012|2012-03-08[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={5.162145370162307,5.162145370162307}]:0.7327420607728605)#H8[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.1897891231964484,height_95%_HPD={5.232565487173167,6.755218354827745}]:0.7452841885742973,(#H8[&segments={1},seg0=false,seg1=true,segsCarried=1,posterior=0.1897891231964484,height_95%_HPD={5.232565487173167,6.755218354827745}]:0.6179077374935869,(#H6[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.03107658157602664,height_95%_HPD={3.759985289605951,4.660587904989298}]:1.5621540295083127,(#H0[&segments={0},seg0=true,seg1=false,segsCarried=1,posterior=0.6958934517203108,height_95%_HPD={4.414101991973996,5.6546341852756425}]:0.36130586314809765,A/Nepal/VIROAF5/2012|2012-08-26[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,height_95%_HPD={4.6949322554082755,4.6949322554082755}]:0.64117935846682)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9922308546059934,height_95%_HPD={4.939654158225106,5.938432906868147}]:0.4033100379256318)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.9678135405105438,height_95%_HPD={5.192755129661409,6.412948900277676}]:0.7733735166282809)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.4039955604883463,height_95%_HPD={5.881376822735449,7.408105564622942}]:0.1273764510807105)[&segments={0, 1},seg0=true,seg1=true,segsCarried=2,posterior=0.19089900110987792,height_95%_HPD={6.03060655192233,7.431527124398852}]:0.5197312356324506)[&segments={},seg0=false,seg1=false,segsCarried=0,posterior=0.7924528301886793,height_95%_HPD={6.640734581887006,7.8011536372693815}]:0.0;
end trees;

0 comments on commit c5234cd

Please sign in to comment.