Ancestral character mapping
We used an algorithm of stochastic mapping of discrete characters via Bayesian inference (Bollback 2006) to reconstruct the trajectory of diet states across the rodent phylogenies. We used the functionmake.simmap of the Phytools package (Revell 2012), implemented in the R environment. Stochastic mapping based on Bayesian inference allows calculation of the discrete ancestral state (s) of the phylogeny’s nodes and the timing of changes along the branches. Stochastic mapping output shows the most probable ancestral state (s) of a node; this output is based on the mean posterior probability of finding a given state and the timing of changes along the phylogeny branches. The mean posterior probability is based on a sample of the posterior probability across a desired number of simulations; here, we used 100 phylogenies and 100 simulations per phylogeny.
Evolutionary processes can produce both symmetric and asymmetric transitions across diet states (Joy et al. 2016), so we first defined whether transitions across diet states are equal (“SYM”, symmetric model) or different (“ARD”, all-rates-different model) (Table S1, see Supplementary Methods in the Online Supporting Information). As the model with symmetric transition rates had more support than the model with asymmetric rates, we conducted definitive stochastic character mapping using the complete set of 100 phylogenies, with 100 simulations per phylogeny, to more robustly estimate parameters under the symmetric evolutionary model. The output of the stochastic mapping procedure consisted of a set of 10,000 estimates of diet states and length of time that a given diet state persisted per node. This time length is based on the branch length between two nodes with a common diet state. To attribute diet category and estimated time to each node, we built an adjacency matrix with phylogeny tips (species) in the rows, and internal-node numbers in the columns. Values of 1 were attributed to nodes belonging to the evolutionary history of a species. The first column is the phylogeny root and is completely filled with 1’s, as it belongs to the evolutionary history of all species; the last column is the most recent internal node leading to a tip. These 1’s were then replaced by the reconstructed diet category and time. When more than one state was equally probable at a given node, we used the state present longer at that node.