Input/Output
MolecularEvolution.write_nexus
— Functionwrite_nexus(fname::String,tree::FelNode)
Writes the tree as a nexus file, suitable for opening in eg. FigTree. Data in the node_data
dictionary will be converted into annotations. Only tested for simple node_data
formats and types.
MolecularEvolution.newick
— Functionnewick(root)
Returns a newick string representation of the tree.
MolecularEvolution.read_newick_tree
— Functionreadnewicktree(treefile)
Reads in a tree from a file, of type FelNode
MolecularEvolution.populate_tree!
— Functionpopulate_tree!(tree::FelNode, starting_message, names, data; init_all_messages = true, tolerate_missing = 1)
Takes a tree, and a starting_message
(which will serve as the memory template for populating messages all over the tree). starting_message
can be a message (ie. a vector of Partitions), but will also work with a single Partition (although the tree) will still be populated with a length-1 vector of Partitions. Further, as long as obs2partition
is implemented for your Partition type, the leaf nodes will be populated with the data from data
, matching the names on each leaf. When a leaf on the tree has a name that doesn't match anything in names
, then if
tolerate_missing = 0
, an error will be throwntolerate_missing = 1
, a warning will be thrown, and the message will be set to the uninformative message (requires identity!(::Partition) to be defined)tolerate_missing = 2
, the message will be set to the uninformative message, without warnings (requires identity!(::Partition) to be defined)
MolecularEvolution.read_fasta
— Functionread_fasta(filepath::String)
Reads in a fasta file and returns a tuple of (seqnames, seqs).
MolecularEvolution.write_fasta
— Functionwrite_fasta(filepath::String, sequences::Vector{String}; seq_names = nothing)
Writes a fasta file from a vector of sequences, with optional seq_names.