Skip to contents

Functions

Character partitioning

See vignette("char-part") for a complete workflow that uses these functions to conduct automated morphological character partitioning as a pre-processing step for clock (time-calibrated) Bayesian phylogenetic analysis of morphological data using the programs Mr. Bayes or BEAST2.

get_gower_dist()
Compute Gower distances between characters
get_sil_widths() plot(<sil_width_df>)
Calculate silhouette widths index for various numbers of partitions
make_clusters() plot(<cluster_df>)
Estimate and plot character partitions
cluster_to_nexus()
Export character partitions to a Nexus file
write_partitioned_alignments()
Write character partitions as separate Nexus files (for use in BEAUti)

Evolutionary rates & selection mode (MrBayes)

See vignette("rates-selection_MrBayes") for a complete workflow that uses these functions to extract evolutionary rate parameters estimated from relaxed clock Bayesian inference analyses produced by the program Mr. Bayes and use evolutionary rate based inference of selection mode (or strength) adapted to clock-based rates.

get_clockrate_table_MrBayes()
Extract evolutionary rates from a Bayesian clock tree produced by Mr. Bayes
clockrate_dens_plot()
Plot clock rate distributions
clockrate_reg_plot()
Plot regression lines between sets of rates
clockrate_summary()
Compute rate summary statistics across clades and clocks
combine_log()
Combine and filter (.p) log files from Mr.Bayes
clock_reshape()
Convert clock rate tables from wide to long format
plot_back_rates()
Plots distribution of background rates extracted from posterior log files.
get_pwt_rates_MrBayes()
Conduct pairwise t-tests between node rates and clock base rate from a Mr.Bayes output.
plot_treerates_sgn()
Plot Bayesian evolutionary tree with rate thresholds for selection mode

Evolutionary rates & selection mode (BEAST2)

See vignette("rates-selection_BEAST2") for a complete workflow that uses these functions to extract evolutionary rate parameters estimated from relaxed clock Bayesian inference analyses produced by the program BEAST2 and use evolutionary rate based inference of selection mode (or strength) adapted to clock-based rates.

get_clockrate_table_BEAST2()
Extract evolutionary rates from Bayesian clock trees produced by BEAST2
clockrate_dens_plot()
Plot clock rate distributions
clockrate_reg_plot()
Plot regression lines between sets of rates
clockrate_summary()
Compute rate summary statistics across clades and clocks
clock_reshape()
Convert clock rate tables from wide to long format
plot_back_rates()
Plots distribution of background rates extracted from posterior log files.
get_pwt_rates_BEAST2()
Conduct pairwise t-tests between node rates and clock base rates from a BEAST2 output.
plot_treerates_sgn()
Plot Bayesian evolutionary tree with rate thresholds for selection mode

Analyzing FBD parameters

See vignette("fbd-params") for a complete workflow that uses these functions to extract FBD parameters estimated from relaxed clock Bayesian inference analyses produced by Mr. Bayes and BEAST2.

combine_log()
Combine and filter (.p) log files from Mr.Bayes
FBD_dens_plot()
Density plots for each FBD parameter
FBD_normality_plot()
Inspect FBD parameter distributions visually
FBD_reshape()
Convert an FBD posterior parameter table from wide to long format
FBD_summary()
Summarize FBD posterior parameter estimates
FBD_tests1()
Test assumptions of normality and homoscedasticity for FBD posterior parameters
FBD_tests2()
Test for differences in FBD parameter values

Analyzing Trees With Offsets

See vignette("offset_handling") for a complete workflow that uses these functions to summarize trees with offsets (with fossil species only) as produced by the SA package in BEAST2.

drop.dummy.beast()
Remove dummy tip from beast summary trees, accounting for metadata on the tips
drop.dummy.mb()
Remove dummy tip from Mr. Bayes summary trees, accounting for metadata on the tips
offset.to.dummy()
Convert trees produced by a BEAST2 FBD analysis with offset to trees with correct ages.
offset.to.dummy.metadata()
Convert trees produced by a BEAST2 FBD analysis with offset to trees with correct ages, accounting for possible metadata on the tips.
write.beast.treedata()
Export multiple treedata objects (S4 class tree files) to BEAST NEXUS file

Datasets

RateTable_Means_1p_Clades
Mean clock rates by node and clade (single clock)
RateTable_Means_3p_Clades
Mean clock rates by node and clade (3 clock partitions)
characters
A morphological phylogenetic data matrix
post_trees
Multiple phylogenetic clock trees
posterior1p
Posterior parameter samples (single clock)
posterior3p
Posterior parameter samples (3 clock partions)
tree1p
Phylogenetic tree with a single clock partition
tree3p
Phylogenetic tree with 3 clock partitions
tree_clock1
BEAST2 phylogenetic tree with clock rates from partition 1
tree_clock2
BEAST2 phylogenetic tree with clock rates from partition 2