BPP Tutorial - chutter/PhyloConfigR GitHub Wiki
Contents
A) Create BPP input alignment
A) Create BPP input alignment
Input:
- A directory of multiple sequence alignments
- A tree file from IQTree or any program that makes trees readable into R
- A population IMAP file. If one is not provided, the function will create one with population equal to sample.
- first install and load the R package. Its a good idea to install new (or check) every time as this package is being updated frequently.
devtools::install_github("chutter/PhyloConfigR")
library(PhyloConfigR)
- Second, you will want all your alignments in a single directory saved in Phylip format. If you have a population file already made, include the path to that as well. A tree file that can be read by the R package ape read.tree function is needed. This tree file is converted to BPP format and printed as a string to be saved to file. This tree string is then copied and pasted into the configuration file when a starting tree is needed.
Situation 1. Population file provided so an IMAP file is not created.
generateBPP(alignment.directory = directory/to/alignments,
tree.file = path/to/tree/file,
outgroups = c("taxa_1"),
output.name = "bpp-alignment",
population.file = "provided",
overwrite = FALSE)
Situation 2. No population file, name each population with the sample name. The sample and population name will be the same in the IMAP.
generateBPP(alignment.directory = directory/to/alignments,
tree.file = path/to/tree/file,
outgroups = c("taxa_1", "taxa_2"),
output.name = "bpp-alignment",
population.file = "sample",
overwrite = FALSE)
Situation 3. No population file, each sample is a single population. Each sample is named with a 3 letter long random letter code to match the population IMAP file.
generateBPP(alignment.directory = directory/to/alignments,
tree.file = path/to/tree/file,
outgroups = c("taxa_1", "taxa_2", "taxa_3"),
output.name = "bpp-alignment",
population.file = "letter",
overwrite = FALSE)