Learn R Programming

Genesys R client

The genesysr R package provides functions for authentication with Genesys and functions to fetch accession data from https://www.genesys-pgr.org database.

Note: See NEWS.md

Installing the development version

devtools::install_git('https://gitlab.croptrust.org/genesys-pgr/genesysr')

Using genesysr

  1. Setup and configure
  2. Authenticate
  3. User authentication
  4. Client authentication
  5. Query

Setup and configuration

library('genesysr')

# www.genesys-pgr.org
genesysr::setup_production()

# or sandbox.genesys-pgr.org
genesysr::setup_sandbox()

# or custom
genesysr::setup(server = "http://localhost:8080",
  client_id = "...", client_secret = "...")

User authentication

The package is configured with default Genesys R client credentials that require user authentication:

# Setup
genesysr::setup_production()

# Open Genesys web page in browser and get verifier code
genesysr::user_login()

Client authentication

Accessing Genesys without user interaction requires that a client is registered on Genesys with client credentials grant. Contact helpdesk@genesys-pgr.org{.email} for assistance.

# Setup
library('genesysr')
genesysr::setup(server = "https://api.genesys-pgr.org",
  client_id = "someId.....@www.genesys-pgr.org",
  client_secret = "your-private-secret")

# Obtain access tokens
genesysr::client_login()

Query Genesys

filters <- mcpd_filter(ORIGCTY = c("DEU", "SVN"))
accessions <- genesysr::get_accessions(filters)

# Sort columns, hand-pick first few columns
require(data.table)
setcolorder(accessions, unique(c("id", "instituteCode", "accessionNumber", "taxonomy.genus", sort(names(accessions)))))

Copy Link

Version

Install

install.packages('genesysr')

Monthly Downloads

224

Version

2.2.0

License

Apache License 2.0

Maintainer

Matija Obreza

Last Published

August 19th, 2025

Functions in genesysr (2.2.0)

SELECT_GEO_FIELDS

List of passport data fields relevant for GIS analysis
authorization

Provide OAuth2 token to use for authorization with Genesys
client_login

Login to Genesys as a service client (system-to-system)
api2_url

Get partial API v2 URL for the provided path
check_landorsea

Run Land-or-Sea check on MCPD data using https://validator.genesys-pgr.org. Uploads only rows where DECLATITUDE and DECLONGITUDE are provided. In practice it is better to use `check_country` if ORIGCTY data exists.
check_country

Run Land-or-Sea check on MCPD data. Uploads only rows where ORIGCTY, DECLATITUDE and DECLONGITUDE are provided.
check_taxonomy

Check MCPD taxonomic data (GENUS, SPECIES, SPAUTHOR, SUBTAXA, SUBTAUTHOR) using https://validator.genesys-pgr.org.
download_mcpd

Download passport data for one genebank in Excel format and save it to disk
filter_DOI

Add filter on accession DOI
download_pdci

Download PDCI data for one genebank in Excel format and save it to disk.
filter_SAMPSTAT

Add filter on Biological status of sample
mcpd_filter

Make or adjust filter using MCPD terminology
filter_GENUS

Add filter by genus
list_species

Fetch taxonomic data of selected accessions.
user_login

Login to Genesys as a user
setup_production

Setup for Genesys Production
setup

Configure the Genesys environment
setup_sandbox

Setup for Genesys Sandbox
filter_INSTCODE

Add filter by genus
print_setup

Print Genesys client configuration
.MAX_ALLOWED_PAGES

Max pages to retrieve
.post

HTTP POST method
SELECT_ALL_FIELDS

List of all supported passport data fields
list_institutes

List FAO WIEWS institutes.
get_accessions

Get accession passport data as a data table.
SELECT_INFO_FIELDS

List of basic passport data fields
filter_ORIGCTY

Add filter on Country of origin of material
me

Who am i? Loads and prints the user profile from Genesys as JSON. You need to be logged in.
filter_SPECIES

Add filter on specific epithet
list_crops

Fetch Genesys crops. Note that the list of Genesys crops does not fully correspond with various CROPNAME in MCPD provided by genebanks.
.postForm

HTTP POST method
.fetch_csv_page

Fetch a page of data from Genesys
.fieldsToSelect

Map MCPD column names to their Genesys JSON equivalents
.onLoad

Configure package defaults on load
.check_auth

Ensure that environment has OAuth token
.list_accessions_page

Get one page of accession passport data