Shared tools
These tools are shared between the models.
Tree importing
CodonMolecularEvolution.import_colored_figtree_nexus_as_tagged_tree
— Functionimport_colored_figtree_nexus_as_tagged_tree(fname; custom_labels=String[])
Takes a nexus file from FigTree, where branches have been colored. Replaces all color tags with group tags that can be used in the models. Can add custom labels too. Should consider an entire custom dictionary as well in future.
Examples
julia> treestring, tags, tag_colors = import_colored_figtree_nexus_as_tagged_tree("data/Ace2_no_background.nex")
("(((XM_027533928_Bos_indicus_x_Bos_taurus{G1}:0.097072,(XM_042974087_Panthera_tigris{G1}:0.038016,... more ...;", ["{G2}", "{G1}"], ["#ff0015", "#0011ff"])
treestring
is truncated. NEXUS tree file
CodonMolecularEvolution.import_grouped_label_tree
— Functionimport_grouped_label_tree(tree_file)
Takes a Newick tree file and return Newick tree, Newick tree with replaced tags, group tags, original tags, and randomly generated colours for each tag
CodonMolecularEvolution.import_labeled_phylotree_newick
— Functionimport_labeled_phylotree_newick(fname)
Import a tagged phylogeny from phylotree and return the treestring and tags.
Model fitting
CodonMolecularEvolution.optimize_MG94_F3x4
— Functionoptimize_MG94_F3x4(seqnames, seqs, tree; leaf_name_transform=x -> x, genetic_code=MolecularEvolution.universal_code)
Optimizes the MG94+F3x4 model on a tree, given a set of sequences and a tree. Returns the optimized tree, LL, alpha, beta, nucmatrix, F3x4, and eqfreqs. The leafnametransform kwarg can be used to transform the leaf names in the tree to match the seqnames.