This version of SolveBio for R is compatible with Vault-based datasets only (released on July 28th, 2017).
This package contains the SolveBio R language bindings. SolveBio makes it easy to access genomic reference data.
Features of this package include:
Please see the SolveBio documentation for more information about the platform.
Installing this package requires an installed R environment.
install.packages("solvebio")
library(solvebio)
# By default it will look for a key in the $SOLVEBIO_API_KEY environment variable.
library(solvebio)
# You may also supply an API key in your code
login(api_key="<Your API key>")
# RStudio users can put the following line in ~/.Rprofile
# Sys.setenv(SOLVEBIO_API_KEY="<Your API key>")
# Retrieve a list of all datasets
<- Dataset.all()
datasets
# Retrieve a specific dataset (metadata)
<- Dataset.get_by_full_path("solvebio:public:/ClinVar/3.7.4-2017-01-30/Variants-GRCh37")
ClinVar
# Query a dataset with filters as JSON:
<- '[["gene_symbol", "BRCA1"]]'
filters # or, filters as R code:
<- list(list('gene_symbol', 'BRCA1'), list('clinical_significance',
filters 'Benign'))
# Execute the queries
# NOTE: paginate=TRUE may issue multiple requests, depending on the dataset and filters
<- Dataset.query(id = ClinVar$id, filters = filters, limit = 1000, paginate = TRUE)
results
# Access the results (flattened by default)
results
To use SolveBio in your Shiny app, refer to the docs on Developing Applications with R Shiny and SolveBio.
This package provides a Shiny server wrapper called
solvebio::protectedServer()
which requires users to
authenticate with SolveBio and authorize the app before proceeding. In
addition, you may enable token cookie storage by installing ShinyJS and adding JS code
(solvebio::protectedServerJS()
) to your Shiny UI.
An example app is available in the solvebio-shiny-example GitHub repository.
To install the development version of this package from GitHub, you
will need the devtools
package.
install.packages(c("devtools", "httr", "jsonlite"))
library(devtools)
::install_github("solvebio/solvebio-r", ref="master")
devtoolslibrary(solvebio)
To run the test suite:
make test
Bump the version using the bumpversion
command (pip
install bumpversion).
Update the NEWS.md with changes.
Update the DESCRIPTION file with the latest date.
Regenerate roxygen2 and build/check the tarball:
make clean make make check
Submit to CRAN.