Learn R Programming

delimtools

IMPORTANT

This software is under active development, and as such cannot be assumed to be free of bugs or poor functionality. Always inspect results carefully. If you find a problem, please report it with as much detail as possible in Issues. Unfortunately in it’s current form, some of the functions (abgd_tbl(), asap_tbl() and mptp_tbl()) will not work on Windows operating systems, only on Unix (MacOS, Linux). This is because third party binaries (executable programs) are required. We are working to implement importing results from the webservers that are commonly used to run these analyses. There are also difficulties with installing R required package dependancies to run gmyc_tbl() and bgmyc_tbl() because these are no longer under development and available on CRAN, and must be installed from archived sources. Please refer to https://legallab.github.io/delimtools/articles/install.html for instructions on how to install.

Overview

The official GitHub repository for the R package delimtools (Bittencourt et al., in prep.).

delimtools provides helper functions for the analysis of single-locus species delimitation methods such as GMYC (Monaghan et al., 2009), bGMYC (Reid & Carstens, 2012), mPTP (Kapli et al., 2017) and ASAP (Puillandre et al., 2020). These software run multiple different platforms (e.g. R, Unix, webservers), and also do not output their results in a consistent format to allow easy comparison. To address these shortcomings we have developed a suite of functions to standardise and simplify generating single-locus species delimitations.

Dependencies

Delimtools mainly depends on the tidyverse and ggtree packages. To install these, run the command lines below:

Install tidyverse:

install.packages("tidyverse")

Install ggtree

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("ggtree")

Installation

To install delimtools you may execute the following commands. We recommend the usage of the latest CRAN release always.

Latest stable version from CRAN

install.packages("delimtools")

Development version from GitHub:

devtools::install_github("LegalLab/delimtools")

Or a specific version via renv:

renv::install("LegalLab/delimtools@v0.1.0")

Examples

Here, we will demonstrate a single-locus species delimitation analysis on a Geophagus eartheater cichlid dataset (Ximenes et al., 2021) using a variety of methods. For full details please see the GitHub repository accompanying this R package at github.com/boopsboops/delimtools-testing.

library(delimtools)
library(dplyr)

# make tip label table
tip.tab <- geophagus_info |> 
  filter(gbAccession %in% geophagus_beast@phylo$tip.label) |>
  mutate(labs= glue::glue("{gbAccession} | {scientificName}")) |> 
  select(gbAccession, labs, scientificName)

# get cols
cols <- delim_brewer(delim= geophagus_delims, package="randomcoloR", seed=42)

# plot
delim_autoplot(delim = geophagus_delims, 
               tr = geophagus_beast, 
               consensus = TRUE,
               n_match = 4,
               delim_order = c("asap","abgd","locmin","gmyc","bgmyc","ptp", "mptp","morph"),
               tbl_labs = tip.tab, 
               col_vec = cols,
               hexpand = 0.7,
               widths = c(0.5, 0.5))
#> Warning: `aes_()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`
#> ℹ The deprecated feature was likely used in the ggtree package.
#>   Please report the issue at <https://github.com/YuLab-SMU/ggtree/issues>.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning in fortify(data, ...): Arguments in `...` must be used.
#> ✖ Problematic arguments:
#> • as.Date = as.Date
#> • yscale_mapping = yscale_mapping
#> • hang = hang
#> • color = "grey50"
#> • size = 1
#> ℹ Did you misspell an argument name?
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> ℹ The deprecated feature was likely used in the ggtree package.
#>   Please report the issue at <https://github.com/YuLab-SMU/ggtree/issues>.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the ggtree package.
#>   Please report the issue at <https://github.com/YuLab-SMU/ggtree/issues>.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Current contributors

Meta

Copy Link

Version

Install

install.packages('delimtools')

Monthly Downloads

214

Version

0.2.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Pedro Bittencourt

Last Published

September 29th, 2025

Functions in delimtools (0.2.1)

geophagus_bootstraps

Geophagus Eartheaters Bootstrap Trees
get_delim_cols

Extract Labels and Colors from Species Delimitation Partitions
hap_unite

Unite Haplotype Summaries with Species Delimitation Outputs
hap_collapse

Removes Duplicated Sequences from Alignment
min_brlen

A function to report the smallest tip-to-tip distances in a phylogenetic tree
match_ratio

Compute Agreement Between Alternative Species Delimitation Partitions
gmyc_tbl

Turns GMYC Results Into a Tibble
get_dwc

Get Darwin Core Terms and Definitions
geophagus_delims

Geophagus Eartheaters Species Partitions
haplotype_tbl

Summarise Haplotypes Down to One Row
delim_autoplot2

Plot Phylogenetic Trees With Species Delimitation Partitions
locmin_tbl

Turns Local Minima Results into a Tibble
geophagus_posterior

Geophagus Eartheaters Posterior Trees
morph_tbl

Generating a Morphological Delimitation Table
mptp_tbl

A Command-Line Interface for mPTP - multi-rate Poisson Tree Processes
delim_consensus

Estimate a Majority-Vote Consensus
report_delim

Report Unique Species Partitions
geophagus_info

Geophagus Earthearts Associated Metadata
confidence_intervals

Confidence Intervals for Species Delimitations Methods
asap_tbl

A Command-Line Interface for ASAP - Assemble Species by Automatic Partitioning
as_dwc

Rename Columns using Darwin Core Standard Terms
check_identifiers

Checks for Differences Between Identifiers in Metadata and DNA Sequence Files
collapse_others

Summarise Haplotype Metadata Down to One Row
boot_dna

Boostrapping DNA sequences
bgmyc_tbl

Turns bGMYC Results Into a Tibble
clean_dna

Removes Gaps, Ambiguities and Missing Data from DNA Sequences
abgd_tbl

A Command-Line Interface for ABGD - Automatic Barcode Gap Discovery
check_delim

Checks If Two or More Species Delimitation Outputs are (Nearly) Equal
delim_join

Join Multiple Species Delimitation Methods Outputs
drop_sequences

Remove Sequences of a DNAbin list object
dwc_terms

Print Darwin Core Terms, Definitions and Examples as Bullet Lists
delimtools-package

Helper Functions for Species Delimitation Analysis
delim_brewer

Customize Delimitation Colors
delim_autoplot

Plot Phylogenetic Trees With Species Delimitation Partitions
geophagus

Cytochrome C Oxidase Sequences of Geophagus Eartheaters
geophagus_raxml

Geophagus Eartheaters Phylogram
geophagus_beast

Geophagus Eartheaters Ultrametric Tree