Created
November 30, 2016 21:53
-
-
Save mlandis/570a3844d7688bc3cbb1a4abe774c58e to your computer and use it in GitHub Desktop.
Johan's K80+I model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read in the data | |
data <- readDiscreteCharacterData(data_filename) | |
# read in a tree (this could also be a stochastic tree variable) | |
tree <- readTrees(tree_filename)[1] | |
# assign a lognormal prior to the transition/transversion rate | |
kappa_sd <- 1.0 | |
kappa_mean <- -0.5 * kappa_sd^2 | |
kappa ~ dnLognormal(kappa_mean, kappa_sd) | |
moves[1] = mvScale(kappa) | |
# construct the K80 rate matrix | |
Q := fnK80(kappa) | |
# assign a uniform prior to the proportion of invariant sites | |
p_invar ~ dnUniform(0,1) | |
moves[2] = mvSlide(p_invar, delta=0.1) | |
# create the phylogenetic substitution model using K80 and +I | |
seq ~ dnPhyloCTMC(tree=tree, | |
Q=Q, | |
pInv=p_invar, | |
type="DNA", | |
nSites=data.nchar()) | |
# treat the data as observed | |
seq.clamp(data) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment