Likelihood
There are several prior distributions for tree structures implemented in this package. Also there is a function which calculates the likelihood of a tree given a model using Felsensteins algorithm.
Likelihood Calculator functionality
Prior
MCPhylo.TreeDistribution
— TypeTreeDistribution(length_distr::LengthDistribution, topology_distr::TopologyDistribution)
Wrapper struct for the TreeDistribution. Contains a length distribution and a topology distribution. Can be constructed with no arguments, one of the distributions, or both of them. Fallbacks are UniformBranchLength for the length distribution & and UniformTopology for the topology distribution.
Branch length distributions
MCPhylo.CompoundDirichlet
— TypeCompoundDirichlet(alpha::Float64, a::Float64, beta::Float64, c::Float64, nterm::Float64)
This structure implememts the CompoundDirichlet distribution described in Zhang, Rannala and Yang 2012. (DOI:10.1093/sysbio/sys030)
MCPhylo.exponentialBL
— TypeexponentialBL(scale::Float64) <: ContinuousUnivariateDistribution
This structure implememts an exponential prior on the branch lengths of a tree.
MCPhylo.UniformBranchLength
— TypeUniformBranchLength()
Fallback struct that is used when no length distribution is given
MCPhylo.BirthDeath
— TypeStrict Molecular Clock - BirthDeath Implemented following Yang & Rannala 1997 doi.org/10.1093/oxfordjournals.molbev.a025811
MCPhylo.BirthDeathSimplified
— TypeStrict Molecular Clock - Simplified Birth Death Implemented folloing Yang & Rannala 1996 doi.org/10.1007/BF02338839
Topology distributions
MCPhylo.UniformConstrained
— TypeUniformConstrained(
constraint_dict::Dict{Symbol,
Union{Vector{Vector{S}}, Vector{Tuple{Vector{S}, Vector{S}}}}
} where S <: AbstractString)
Wrapper struct for the topology distribution. Contains a dictionary with constraints. Empty constructor results in an empty dictionary as a fallback.
MCPhylo.UniformTopology
— TypeUniformTopology()
Fallback struct that is used when no topology distribution is given.
Gamma Rates
MCPhylo.discrete_gamma_rates
— Functionfunction discrete_gamma_rates(α::T, β::S,k::Int64; method::Symbol=:mean, sig::Int64=1)::Array{Float64} where {T<:Real, S<:Real}
This function calculates the rates of the discretized gamma distribution. It returns a vector of either the mean or the median weights in each category, such that each category is of equal proportion.
See: Yang, 1994, Maximum likelihood phylogenetic estimation from DNA sequences with variable rates over sites: Approximate methods. (https://doi.org/10.1007/BF00160154)
Substitution Models
MCPhylo.JC
— FunctionJC(base_freq::Vector{Float64},
SubstitutionRates::Vector{Float64})::Tuple{Array{Float64,2}, Array{Float64,1}, Array{Float64,2}}
Calculate the eigenvalue decomposition of the Q matrix of the Jukes-Cantor model. The SubstitutionRates
are ignored, and just for call stability.
The function returns the Eigenvectors, Eigenvalues and inverse of eigenvectors.
MCPhylo.Restriction
— FunctionRestriction(base_freq::Vector{Float64},
SubstitutionRates::Vector{Float64})::Tuple{Array{Float64,2}, Array{Float64,1}, Array{Float64,2}}
Calculate the eigenvalue decomposition of the Q matrix of the restriction site model. The SubstitutionRates
are ignored, and just for call stability.
The function returns the Eigenvectors, Eigenvalues, inverse of eigenvectors and the scale factor for expected number changes per site
MCPhylo.freeK
— Functionfunction freeK(base_freq::Vector{Float64},SubstitutionRates::AbstractArray)::Tuple{Array{N,2}, Array{N,1}, Array{N,2}, M} where {N <: Number, M <: Number}
FreeK model of substitution.
MCPhylo.GTR
— FunctionGTR(base_freq::Vector{Float64},
SubstitutionRates::Vector{Float64})::Tuple{Array{Float64,2}, Array{Float64,1}, Array{Float64,2}}
Calculate the eigenvalue decomposition of the Q matrix of the General Time Reversible model.
The function returns the Eigenvectors, Eigenvalues and inverse of eigenvectors.