README.md

fastgenomicsRclient

Connect to any FASTGenomics instance and manipulate / retrieve data.

Full documentation.

For general information and usage examples please refer to the FASTGenomics documentation.

Installation

You can install the development version like this:

Hint devtools needs some system packages to work, see this page for details. The exact steps vary for each Linux distribution so your best bet is to search for "devtools r install your linix distribution".

Hint We need libsodium, this can be installed like this on Ubuntu:

sudo apt-get install libsodium-dev
install.packages("remotes")
remotes::install_github("FASTGenomics/r_client")

Example

First you need to authorize yourself. This packlage currently only supports login via Personal Access Tokens (PATs). See our Authorization Guide for more details.

  1. Create a PAT for your account here
  2. Save the created PAT somewhere.

If you need more guidance, please read our Authorization Guide.

connection <- fastgenomicsRclient::connect("https://fastgenomics.org/", "user@example.com") # this will show a display where you can enter your PAT
datasets <- fastgenomicsRclient::get_datasets(connection)
print(datasets@content) # all datasets available to you

Warning Never store your PAT in a variable or somewhere where it can be compromised. Anybody with your PAT can modify your data as he sees fit. If your PAT is compromised, revoke it!

Run tests

If you want the unit tests of this package, set these environment variables Note: You can obtain a PAT (Personal access token) using this guide In no circumstances, share your PAT with anyone or commit it to source control!

Sys.setenv(FGBASEURL="URL", FG_EMAIL="TEST_ACCOUNT", FG_PAT="PAT")

then run the tests through RStudio (Build -> Test Pakcage) or run devtools::test()

Troubleshooting

HTTP2 framing error

If you encounter an HTTP2 framing error try disabling HTTP2 with

library("httr")
httr::set_config(config(http_version = 0))

User permissions

If you get 403 FORBIDDEN errors when using the API, your user account has not the necessary permissions for an operation. Please contact us at feedback@fastgenomics.org to get access to such functions.

Jupyter notebook compatibility

Due to a known bug in R kernel for jupyter the R session is not considered interactive (interactive() returns FALSE). This causes the password prompts used by the keyring package (either askpass or getPass depending on the version of keyring) to return NULL resulting in subsequent cryptic errors from keyring.

In this case, use the method connect_with_pat_insecure which does not store your PAT securely, but in memory. Be aware that you should not store the PAT in the Notebook and avoid sharing the FgConnection object.

Keyring backends

If for some reason the default backend of the keyring package does not work for you, you can switch to a different backend by specifying

options(keyring_backend = "env")

You can find the list of available backends here.



FASTGenomics/r_client documentation built on June 25, 2019, 12:12 a.m.