Landscape near Mt. Olympus, Greece
Orlando Schwery
Orlando Schwery - Code Orlando Schwery - Code | Orlando Schwery

Code

Writing and using code is the bread and butter of many computational biologists/phylogeneticists. Apart from actual packages, we often create random pieces of code that solve certain problems for us. In the hope that some others might find it useful, I’m attemtping to share such code bits here, preventing too much reinvention of the wheel.

Hex Sticker for R package MonoPhy

MonoPhy

R package that allows to explore monophyly (or lack thereof) at different taxonomic levels in a phylogeny. It allows for automated and custom input of taxonomic information, provides different ways of accessing the findings, plus a couple of visualisation options.

BoskR

R package to test the adequacy of birth-death diversification models, which can be installed from GitHub. A few models are hard-coded into the package, but helper functions allow to use the package with any desired model, as long as data can be simulated under it. It allows to use a variety of summary statistics, both traditional ones and ones based on Laplacian spectra from RPANDA. Notably, unlike other adequacy tests using posterior predictive simulations, this approach focuses on maximum likelihood implementations and uses point estimates as the input for simulations - with the associated pros and cons of computational burden and lack of variation.

A first study making use of the package already was published by Platania & Gómez‑Zurita (2023), who used it to validate their results when studying the evolution of leaf beetles.

adequaSSE

Coming soon…

BiSSE Box

Part of a course project in Brian O’Meara’s PhyloMeth class, I wrote a wrapper around BiSSE, that runs all combinations of model constraints in ML, chooses the best one and performs the Bayesian analysis on it.

Simulate Missing Diversity

Based on the add.random code by Liam Revell, I made a function that allows to randomly add tips to a phylogeny based on different sampling levels per clade. The idea is to get a simple approximation of how missing diversity could be distributed, e.g. for sensitivity analyses.

Plot MiSSE States

This simple function resulted from when I wanted to plot the inferred/reconstructed rate categories from the MiSSE model (essentially a SSE model with only hidden states and no observed trait states), as impemented in the hisse package. This allows to visualize the location of the rate categories on the tree, rather than just the inferred rates, which can be useful to spot unexpected behaviour or tips or nodes with highly ambivalent/uncertain category reconstructions. I wrote this for MiSSE, but it could in principle work for hidden states of other SSE models too.