gdc_token: return a gdc token from file or environment

Description Usage Details Value References Examples

View source: R/gdc_token.R

Description

The GDC requires an auth token for downloading data that are "controlled access". For example, BAM files for human datasets, germline variant calls, and SNP array raw data all are protected as "controlled access". For these files, a GDC access token is required. See the https://docs.gdc.cancer.gov/Data_Portal/Users_Guide/Authentication/#gdc-authentication-tokens. Note that this function simply returns a string value. It is possible to keep the GDC token in a variable in R or to pass a string directly to the appropriate parameter. This function is simply a convenience function for alternative approaches to get a token from an environment variable or a file.

Usage

1

Details

This function will resolve locations of the GDC token in the following order:

If all of these fail, this function will return an error.

Value

character(1) (invisibly, to protect against inadvertently printing) the GDC token.

References

https://docs.gdc.cancer.gov/Data_Portal/Users_Guide/Authentication/#gdc-authentication-tokens

Examples

1
2
3
# This will not run before a GDC token
# is in place.  
token = try(gdc_token(),silent=TRUE)

GenomicDataCommons documentation built on Nov. 8, 2020, 11:08 p.m.