generated from jhudsl/AnVIL_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-bayesian-estimation.Rmd
62 lines (37 loc) · 1.95 KB
/
10-bayesian-estimation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# (PART\*) BAYESIAN ESTIMATION {-}
```{r, include = FALSE}
ottrpal::set_knitr_image_path()
```
# The Bayesian approach
## Bayes' theorem
# Bayesian tree estimation using babette
## Installing beast2 (using mauricier)
Before we can start using `babette`, we need to also install the beast2 program. We can do this directly from the R command line (the RStudio console), although it involves installing from a remote source instead of installing from CRAN (`install.packages`) or installing from AnVIL (`AnVIL::install`). The authors of `babette` have created a secondary program called `beastierinstall` that will do all the work of installing beast2 for us.
When prompted about updating packages, you can just hit enter. Nothing needs to be updated.
```{r, warning=FALSE, message = FALSE}
remotes::install_github("richelbilderbeek/beastierinstall")
library(beastierinstall)
install_beast2()
```
## Formatting the input file (beautier/BEAUTi)
Unfortunately, beast2 requires input files to be in xml format (as opposed to fasta or nexus format, like many other phylogenetic programs). When you use the beast2 package directly, you can convert your data into xml format using the accessory program BEAUTi.
## Running the analysis (beastier/beast2)
## Visualizing posterior parameter estimates (tracerer/tracer)
## Visualizing posterior phylogenies (babette/DensiTree)
```{r, echo = FALSE, warning=FALSE, message = FALSE}
library(ape)
```
```{r, warning=FALSE, message = FALSE}
#library(ape) #if you haven't previously loaded ape
#the first argument in the read.Genbank command is a vector
#of all the accession numbers we are using. We use the c("")
#to concatenate a string of characters that read.Genbank will
#interpret.
read.GenBank(c("JX915632","EF105403.1","DQ073553.1",
"FJ481575.1","EF204545.1","AJ314771.1","FJ481569.1",
"DQ073533.1","AY804128.1","AY303125.2","KF887414.1",
"D82941.1","JX276655.1"), as.character=F)
```
```{r}
sessionInfo()
```