fitch.mvsl: Unordered Fitch parsimony reconstruction of discrete...

fitch.mvslR Documentation

Unordered Fitch parsimony reconstruction of discrete character states


Implements an unordered Fitch parsimony reconstruction of discrete niche variables for use in the OU models where optima are modeled on discrete, categorical niche encodings. Allows for delayed and accelerated transformations to deal with ambiguities. Function was originally the fitch() function from the slouch package.


fitch.mvsl(phyltree, niche, deltran = FALSE, acctran = FALSE, root = NULL)



The phylogenetic tree in ape (phylo). For a phylogeny in phylo format the "standard" ape node indexing is assumed: for a tree with n tips, the tips should have indices 1:n and the root index n+1.


The specific niche variable in the slouch data.frame to be reconstructed, entered as data.frame$niche . The order of the niche's regimes has to correspond to the order of the tip nodes in phyltree.


Implements a delayed transformation algorithm in order to deal with ambiguous nodes


Implements an accelerated transformation algorithm to deal with ambiguous nodes


An optional argument allowing the user to define a character state for the root (useful if the root node is ambiguously reconstructed)


The fitch.mvsl function is meant to be interactive, where the user acts on the advice given in the returned messages whilst attempting to reconstruct ancestral states. If the root node is ambiguous after an initial reconstruction (a message will be printed to the screen if this is the case), this needs to be set by the user using the root = "state" argument in the function call. Any remaining ambiguous nodes can then be dealt with by specifying deltran or acctran ="TRUE" in the function call


The fitch.mvsl function returns a list with two or three elements. The first, $branch_regimes is a vector of reconstructed character states. Each entry of the vector corresponds to the respective edge in the $edge field in the provided tree. Notice that entries correspond to edges and not to nodes. If you require correspondence with nodes, then you can treat the given edge entry as the value for the node ending the edge. Actually, this is what the algorithm in the function estimates. The second field of the output object, $root_regimes is the regime at the root of the tree. If the provided tree was a raw phylo object, then the function will also return an enhanced version of it (field $phyltree). This is the tree that results from calling mvSLOUCH::phyltree_paths(phyltree) on the originally provided tree. This enhanced version is returns as calculating it is costly and the user might want to re-use it in some downstream analysis with mvSLOUCH. All mvSLOUCH user-level functions first enhance the provided phylogeny by mvSLOUCH::phyltree_paths(), but they first check if it is not already enhanced.


Jason Pienaar


Fitch, M.W. (1971) Defining the course of Evolution: Minimum change for a specific tree topology. Systematic Zoology 20:406–416.

Swofford, D. L. and W.P. Maddison (1987) Reconstructing ancestral character states under Wagner parsimony. Mathematical Biosciences 87: 199–229.

See Also

slouch::fitch, slouch::slouchtree.plot,, slouch::ouch2slouch


set.seed(12345, kind = "Mersenne-Twister", normal.kind = "Inversion")


mvSLOUCH documentation built on Nov. 21, 2023, 1:08 a.m.