Learn R Programming

⚠️There's a newer version (2.1.1) of this package.Take me there.

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.

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 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::fetch_accessions(filters)

Copy Link

Version

Install

install.packages('genesysr')

Monthly Downloads

214

Version

0.9.2

License

Apache License 2.0

Maintainer

Matija Obreza

Last Published

September 2nd, 2019

Functions in genesysr (0.9.2)

.onLoad

Configure package defaults on load
.post

HTTP POST method
mcpd_filter

Make or adjust filter using MCPD terminology
client_login

Login to Genesys as a service client (system-to-system)
.MAX_ALLOWED_PAGES

Max pages to retrieve
me

Who am i?
user_login

Login to Genesys as a user
filter_ORIGCTY

Add filter on Country of origin of material
.fetch_accessions_page

Fetch accession passport data (paginated)
.check_auth

Ensure that environment has OAuth token
filter_SAMPSTAT

Add filter on Biological status of sample
setup_sandbox

Setup for Genesys Sandbox
fetch_accessions

Fetch accession passport data
setup_production

Setup for Genesys Production
filter_DOI

Add filter on accession DOI
print_setup

Print Genesys client configuration
setup

Configure the Genesys environment
api_url

Get full Genesys API URL for a specific path
authorization

Provide OAuth2 token to use for authorization with Genesys