BreedBase Example

Khaled Al-Shamaa

2022-05-19

QBMS

Linking data management systems to analytics is an important step in breeding digitalization. Breeders can use this R package to Query the Breeding Management System database (using BrAPI calls) and help them to retrieve their experiments data directly into R statistical analyzing environment.

Well, because Breedbase supports the BrAPI standard, most of the QBMS functionalities work smoothly with minor changes. For example, you need to give special attention to the set_qbms_config parameters (check the example below). Currently, some functions are not supported when working with BreedBase, like get_program_studies, get_germplasm_data, and list_trials filtered by year!

BreedBase

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.

BrAPI

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.

Install

install.packages("remotes")
remotes::install_github("icarda-git/QBMS")

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: https://brapi.org/servers.

Example

# load the QBMS library
library(QBMS)

# Cassava BreedBase server
set_qbms_config("https://cassavabase.org/brapi/v1/calls/", 
                time_out = 300, no_auth = TRUE, engine = "breedbase")

# list supported crops in the current bms server
list_crops()

# select a crop by name
set_crop("Cassava")

# list all breeding programs in the selected crop
list_programs()

# select a breeding program by name
set_program("IITA")

# list all studies/trials in the selected program
list_trials()

# select a specific study/trial by name
set_trial("20_Abuja")

# get observation variable ontology in the selected study/trial
get_trial_obs_ontology()

# list all environments/locations information in the selected study/trial
list_studies()

# select a specific environment/location by name
set_study("20NCRP12yrtAB")

# another option, select a specific study 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 environment/location
info <- get_study_info()
data <- get_study_data()
germplasm <- get_germplasm_list()

# retrieve multi-environment trial data of the selected study/trial
MET <- get_trial_data()

Troubleshooting the installation

  1. If the installation of QBMS generates errors saying that some of the existing packages cannot be removed, you can try to quit any R session, and try to start R in administrator (Windows) or SUDO mode (Linux/Ubuntu) then try installing again.

  2. If you get an error related to packages built under a current version of R, and updating your packages doesn’t help, you can consider overriding the error with the following code. Note: This might help you install QBMS but may result in other problems. If possible, it’s best to resolve the errors rather than ignoring them.

Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = TRUE)

remotes::install_github("icarda-git/QBMS", upgrade = "always")