Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
genesysr
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Genesys PGR
genesysr
Commits
7ac98123
Commit
7ac98123
authored
6 years ago
by
Matija Obreza
Browse files
Options
Downloads
Patches
Plain Diff
Prepare for release on CRAN
- Included URL in DESCRIPTION - Ignore generated README.Rmd
parent
65c5af5a
No related branches found
Branches containing commit
Tags
0.9.1
Tags containing commit
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
.Rbuildignore
+3
-0
3 additions, 0 deletions
.Rbuildignore
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
DESCRIPTION
+8
-7
8 additions, 7 deletions
DESCRIPTION
NEWS.md
+5
-0
5 additions, 0 deletions
NEWS.md
R/api-client.R
+8
-6
8 additions, 6 deletions
R/api-client.R
R/filters.R
+7
-0
7 additions, 0 deletions
R/filters.R
with
33 additions
and
13 deletions
.Rbuildignore
+
3
−
0
View file @
7ac98123
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^README-.*\.png$
^cran-comments\.md$
This diff is collapsed.
Click to expand it.
.gitignore
+
2
−
0
View file @
7ac98123
...
...
@@ -3,3 +3,5 @@
.RData
.Ruserdata
man
README.Rmd
cran-comments.md
This diff is collapsed.
Click to expand it.
DESCRIPTION
+
8
−
7
View file @
7ac98123
Package: genesysr
Title: R client for Genesys PGR (www.genesys-pgr.org)
Version: 0.1
Version: 0.9.1
Title: Genesys PGR Client
Description: Access data on plant genetic resources from genebanks around the world published on Genesys (<https://www.genesys-pgr.org>).
Your use of data is subject to terms and conditions available at <https://www.genesys-pgr.org/content/legal/terms>.
Authors@R: person("Matija", "Obreza", email = "matija.obreza@croptrust.org",
role = c("aut", "cre"))
Description: Selected Genesys API calls implemented in R.
Allows for authentication and exposes common API calls.
Depends: R (>= 3.1.0)
License: Apache License 2.0
LazyData: true
Imports:
httr
httr,
jsonlite
License: Apache License 2.0 + see LICENSE
RoxygenNote: 6.0.1
URL: https://gitlab.croptrust.org/genesys-pgr/genesysr
This diff is collapsed.
Click to expand it.
NEWS.md
0 → 100644
+
5
−
0
View file @
7ac98123
# June 2018
First version of the Genesys API client for R is released.
This diff is collapsed.
Click to expand it.
R/api-client.R
+
8
−
6
View file @
7ac98123
...
...
@@ -21,7 +21,7 @@
#' Setup for Genesys Production
#'
#' Use the Genesys R Client with
\link{
https://www.genesys-pgr.org
}
requiring \code{\link{user_login}}
#' Use the Genesys R Client with
<
https://www.genesys-pgr.org
>
requiring \code{\link{user_login}}
#'
#' @export
setup_production
<-
function
()
{
...
...
@@ -30,7 +30,7 @@ setup_production <- function() {
#' Setup for Genesys Sandbox
#'
#' Use the Genesys R Client with
\link{
https://sandbox.genesys-pgr.org
}
requiring \code{\link{user_login}}
#' Use the Genesys R Client with
<
https://sandbox.genesys-pgr.org
>
requiring \code{\link{user_login}}
#'
#' @export
setup_sandbox
<-
function
()
{
...
...
@@ -39,7 +39,7 @@ setup_sandbox <- function() {
#' Configure the Genesys environment
#'
#' @param server Server base URL (e.g.
\link{
https://www.genesys-pgr.org
}
or
\link{
https://sandbox.genesys-pgr.org
}
)
#' @param server Server base URL (e.g.
"
https://www.genesys-pgr.org
"
or
"
https://sandbox.genesys-pgr.org
"
)
#' @param client_id OAuth client ID
#' @param client_secret OAuth client secret
#'
...
...
@@ -67,7 +67,9 @@ print_setup <- function() {
#' Provide OAuth2 token to use for authorization with Genesys
#'
#' @seealso \code{\link{login}}
#' @param authorization OAuth2 Authorization header obtained from somewhere else (e.g. an ENV variable)
#'
#' @seealso \code{\link{user_login}}, \code{\link{client_login}}
#' @export
authorization
<-
function
(
authorization
)
{
assign
(
"Authorization"
,
authorization
,
envir
=
.genesysEnv
)
...
...
@@ -145,7 +147,7 @@ client_login <- function() {
}
api_call
<-
function
(
path
,
method
=
"get"
,
server
=
GENESYS_SERVER
)
{
api_call
<-
function
(
path
,
method
=
"get"
)
{
resp
<-
httr
::
GET
(
api_url
(
path
),
httr
::
add_headers
(
Authorization
=
.genesysEnv
$
Authorization
)
...
...
@@ -162,7 +164,7 @@ api_call <- function(path, method = "get", server = GENESYS_SERVER) {
#' Get full Genesys API URL for a specific path
#'
#' @param path
#' @param path
relative path of the API endpoint (e.g. \code{/me})
#'
#' @return Absolute URL to an API call
#' @export
...
...
This diff is collapsed.
Click to expand it.
R/filters.R
+
7
−
0
View file @
7ac98123
...
...
@@ -17,6 +17,7 @@
#' See FAO/Bioversity Multi-Crop Passport Descriptors.
#'
#' @param filter Existing filters (or blank list if not provided)
#' @param DOI Accession DOI
#' @param ORIGCTY Country of origin
#' @param SAMPSTAT Biological status of sample
#'
...
...
@@ -37,6 +38,8 @@ mcpd_filter <- function(filter = list(), DOI = NULL, ORIGCTY = NULL, SAMPSTAT =
}
#' Add filter on accession DOI
#' @param filter Existing filters (or blank list if not provided)
#' @param DOI Accession DOI
#' @export
filter_DOI
<-
function
(
filter
=
list
(),
DOI
)
{
f
<-
c
(
filter
)
...
...
@@ -47,6 +50,8 @@ filter_DOI <- function(filter = list(), DOI) {
}
#' Add filter on Country of origin of material
#' @param filter Existing filters (or blank list if not provided)
#' @param ORIGCTY Country of origin
#' @export
filter_ORIGCTY
<-
function
(
filter
=
list
(),
ORIGCTY
)
{
f
<-
c
(
filter
)
...
...
@@ -57,6 +62,8 @@ filter_ORIGCTY <- function(filter = list(), ORIGCTY) {
}
#' Add filter on Biological status of sample
#' @param filter Existing filters (or blank list if not provided)
#' @param SAMPSTAT Biological status of sample
#' @export
filter_SAMPSTAT
<-
function
(
filter
=
list
(),
SAMPSTAT
)
{
f
<-
c
(
filter
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment