Simulate DNA Alignments Using Node Substitutions


[Up] [Top]

Documentation for package ‘nodeSub’ version 1.2.8

Help Pages

nodeSub-package Package providing functions to simulate sequences under different DNA evolution models
calc_expected_hidden_nodes Calculate the number of expected hidden nodes in a phylogenetic tree
calc_fraction Calculate the expected fraction of substitutions at the nodes, relative to the fraction at the branches
calc_required_node_time Calculate the required node time to obtain a desired fraction of substitutions at the node
calc_sum_stats calculate summary statistics of a phylogenetic tree, compared with a reference tree. The following statistics are calculated: the beta statistic, gamma statistic, crown age, mean branch length, number of tips, the nLTT statistic and the laplacian difference, given by RPANDA's JSDtree. Because JSDtree can sometimes cause issues, some additional checks are performed to ensure that is possible to run this function.
count_hidden Function to calculate the number of hidden speciation events, e.g. speciation events that have lead to an extinct species. Thus, these hidden speciation events can only be detected in complete trees (as opposed to reconstructed trees).
create_balanced_tree create a balanced tree out of branching times
create_equal_alignment function create an alignment with identical information content
create_equal_alignment_explicit function create an alignment with identical information content, using the explicit method to simulate substitutions
create_unbalanced_tree create an unbalanced tree out of branching times
estimate_marginal_models estimate the marginal likelihood of the relaxed and strict clock model for a provided alignment
get_p_matrix calculate p matrix
infer_phylogeny infer the time calibrated phylogeny associated with the provided alignment. This function uses the R package babette to infer the phylogeny using BEAST2.
nodeSub Package providing functions to simulate sequences under different DNA evolution models
reduce_tree Function to remove speciation events occuring after an extinction event. Extinct species are pruned randomly, such that only a single extinct species per branching event (if any extinct species) remains.
sim_linked simulate a sequence assuming conditional substitutions on the node.
sim_normal Simulate sequences for a given evolutionary tree, using a standard model of sequence evolution along the branches. Code for this function was heavily inspired by the function 'simSeq' from the phangorn package.
sim_normal_explicit simulate a sequence assuming substitutions are only accumulated along the branches, using the explicit simulation method (e.g. reverse substitutions are modeled explicitly)
sim_unlinked Simulate a sequence assuming node substitutions are not shared amongst offspring, given two substitution matrices: one for substitutions occuring on the nodes, and one for substitutions occuring along the branches.
sim_unlinked_explicit Simulate a sequence assuming node substitutions are not shared amongst offspring, using the explicit simulation method (e.g. reverse substitutions are modeled explicitly)
slow_matrix this function calculates the p matrix within R this is slower than the C++ implementation in 'get_p_matrix' but provides a way to debug and verify