The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
ukbflow interacts with the UK Biobank Research Analysis
Platform (RAP) via the DNAnexus dx toolkit. Authentication
is required to access your UKB project, submit jobs, and retrieve
results.
Two working modes are supported:
Keep your token private. Treat it like a password — do not share it or commit it to version control.
The recommended approach is to store your token in
~/.Renviron, a local file that is never committed to git.
This keeps the token out of your scripts entirely.
usethis::edit_r_environ()
# Add the following line, then save and restart R:
# DX_API_TOKEN=your_token_hereAfter restarting R, the token is available to
auth_login() automatically.
The token is cached locally by the dx toolkit and persists across R sessions. In most local workflows, you only need to log in once — subsequent R sessions usually do not require re-authentication unless the token expires, the local dx session is cleared, or you explicitly log out.
If you prefer to pass the token directly (e.g., in an interactive session), you can do so:
Security note: Avoid saving
auth_login("token")calls in script files. Prefer the.Renvironapproach for any workflow you intend to save or share.
auth_status() returns the current user and active
project. Use this to confirm your session before running any
analysis.
auth_list_projects()
#> project-XXXXXXXXXXXX : My UKB Project (CONTRIBUTOR)
#> project-YYYYYYYYYYYY : Shared Analysis Project (VIEW)This returns all RAP projects accessible to your account, along with
their project IDs. Project IDs take the form
project-XXXXXXXXXXXX and are required for
auth_select_project().
ukbflow uses project IDs rather than names to avoid
ambiguity. Use auth_list_projects() to find the correct ID
first.
Once selected, the project context is saved by the dx toolkit and persists across sessions.
Logging out invalidates the current DNAnexus session on the remote platform. The local token file is not removed but becomes invalid. A new token must be generated from the DNAnexus platform before logging in again.
DNAnexus API tokens have a limited validity period set at creation time. When a token expires:
auth_login() or other dx-dependent functions will
failOr update ~/.Renviron with the new token and call
auth_login() without arguments.
library(ukbflow)
auth_login() # authenticate
auth_status() # verify session
auth_list_projects() # find your project ID
auth_select_project("project-XXXXXXXXXXXX") # set active project
# ... run your analysis ...
auth_logout() # optional: clear session?auth_login, ?auth_status,
?auth_list_projects, ?auth_select_project,
?auth_logoutThese binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.