BreedBase Example

Khaled Al-Shamaa



This R package assists breeders in linking data systems with their analytic pipelines, a crucial step in digitizing breeding processes. It supports querying and retrieving phenotypic and genotypic data from systems like EBS, BMS, BreedBase, and GIGWA (using BrAPI calls). Extra helper functions support environmental data sources, including TerraClimate and FAO HWSDv2 soil database.


Breedbase is a comprehensive breeding management and analysis software. It can be used to design field layouts, collect phenotypic information using tablets, support the collection of genotyping samples in a field, store large amounts of high density genotypic information, and provide Genomic Selection related analyses and predictions.


The Breeding API (BrAPI) project is an effort to enable interoperability among plant breeding databases. BrAPI is a standardized RESTful web service API specification for communicating plant breeding data. This community driven standard is free to be used by anyone interested in plant breeding data management.


if (!require("remotes")) install.packages("remotes")

You can find a set of Breedbase based servers available for several crops and accessible with no authentication required are listed at the BrAPI website on the following page under the group of Boyce Thompson Institute (BTI), discovery and innovation in the life sciences:


# load the QBMS library

# Cassava BreedBase server
set_qbms_config("", no_auth = TRUE, engine = "breedbase")

# login_breedbase("username", "password")

# list supported crops in the current BreedBase server

# list all breeding programs in the selected crop

# select a breeding program by name

# list all folders in the selected program

# select a specific folder by name, choose the last/final folder that contains 
# your experiments in any nested folder structure

# list all studies/experiments in the selected folder

# select a specific study/experiment by name

# another option, select a specific study/experiment by location name (first match)
# studies <- list_studies()
# set_study(studies[studies$locationName == "Abuja", "studyName"][1])

# retrieve general information, data, and germplasm list 
# of the selected study/experiment
info <- get_study_info()
data <- get_study_data()

# not effecient call at the BreedBase backend BrAPI endpoint
germplasm <- get_germplasm_list()

# get observation variable ontology in the selected study/experiment
ontology <- get_trial_obs_ontology()

# replace long trait names with short ones from the ontology 
fields <- colnames(data) 

for (i in 1:length(fields)) {
  j <- which(ontology$name %in% fields[i])
  if (length(j) > 0) fields[i] <- ontology$synonyms[[j]][1]

colnames(data) <- fields

# retrieve all studies/experiments data in the selected folder
MET <- get_trial_data()