Learn R Programming

SolveBio for R

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:

  • Authentication with SolveBio's API
  • REST API query support
  • S3 object system for SolveBio API resources
  • Portability between most platforms: Linux, Windows, OS X.

Please see the SolveBio documentation for more information about the platform.

Installation

Installing this package requires an installed R environment.

install.packages("solvebio")
library(solvebio)

Usage

# 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
datasets <- Dataset.all()

# Retrieve a specific dataset (metadata)
ClinVar <- Dataset.get_by_full_path("solvebio:public:/ClinVar/3.7.4-2017-01-30/Variants-GRCh37")

# Query a dataset with filters as JSON:
filters <- '[["gene_symbol", "BRCA1"]]'
# or, filters as R code:
filters <- list(list('gene_symbol', 'BRCA1'), list('clinical_significance',
'Benign'))

# Execute the queries
# NOTE: paginate=TRUE may issue multiple requests, depending on the dataset and filters
results <- Dataset.query(id = ClinVar$id, filters = filters, limit = 1000, paginate = TRUE)

# Access the results (flattened by default)
results

Shiny

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.

Developers

To install the development version of this package from GitHub, you will need the devtools package.

install.packages(c("devtools", "httr", "jsonlite"))
library(devtools)
devtools::install_github("solvebio/solvebio-r", ref="master")
library(solvebio)

To run the test suite:

make test

Packaging and Releasing

  1. Bump the version using the bumpversion command (pip install bumpversion).

  2. Update the NEWS.md with changes.

  3. Update the DESCRIPTION file with the latest date.

  4. Regenerate roxygen2 and build/check the tarball:

    make clean make make check

  5. Submit to CRAN.

Copy Link

Version

Install

install.packages('solvebio')

Monthly Downloads

508

Version

2.15.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 16th, 2024

Functions in solvebio (2.15.0)

Dataset.delete

Dataset.delete
BeaconSet.query

BeaconSet.query
Dataset.facets

Dataset.facets
BeaconSet.delete

BeaconSet.delete
Dataset.data

Dataset.data
Dataset.activity

Dataset.activity
Dataset.disable_global_beacon

Dataset.disable_global_beacon
Dataset.enable_global_beacon

Dataset.enable_global_beacon
Dataset.all

Dataset.all
Dataset.query

Dataset.query
Dataset.get_by_full_path

Dataset.get_by_full_path
Dataset.get_or_create_by_full_path

Dataset.get_or_create_by_full_path
Dataset.get_global_beacon_status

Dataset.get_global_beacon_status
Dataset.fields

Dataset.fields
DatasetCommit.all

DatasetCommit.all
Dataset.update

Dataset.update
BeaconSet.retrieve

BeaconSet.retrieve
Dataset.retrieve

Dataset.retrieve
DatasetField.retrieve

DatasetField.retrieve
Dataset.template

Dataset.template
BeaconSet.update

BeaconSet.update
DatasetField.all

DatasetField.all
DatasetExport.retrieve

DatasetExport.retrieve
DatasetMigration.delete

DatasetMigration.delete
DatasetMigration.retrieve

DatasetMigration.retrieve
DatasetExport.all

DatasetExport.all
DatasetImport.delete

DatasetImport.delete
DatasetImport.retrieve

DatasetImport.retrieve
GlobalSearch.facets

GlobalSearch.facets
DatasetField.update

DatasetField.update
GlobalSearch.request

GlobalSearch.request
DatasetExport.create

DatasetExport.create
DatasetTemplate.delete

DatasetTemplate.delete
Dataset.create

Dataset.create
Dataset.count

Dataset.count
DatasetField.create

DatasetField.create
Object.get_download_url

Object.get_download_url
DatasetField.facets

DatasetField.facets
DatasetTemplate.create

DatasetTemplate.create
Object.data

Object.data
Object.create

Object.create
DatasetTemplate.all

DatasetTemplate.all
DatasetTemplate.retrieve

DatasetTemplate.retrieve
DatasetTemplate.update

DatasetTemplate.update
Task.all

Task.all
Vault.files

Vault.files
Task.follow

Task.follow
Object.get_global_beacon_status

Object.get_global_beacon_status
Expression.evaluate

Expression.evaluate
Vault.datasets

Vault.datasets
Vault.delete

Vault.delete
Object.enable_global_beacon

Object.enable_global_beacon
createEnv

createEnv
login

login
Vault.folders

Vault.folders
protectedServer

protectedServer
Vault.update

Vault.update
DatasetExport.get_download_url

DatasetExport.get_download_url
DatasetExport.delete

DatasetExport.delete
DatasetMigration.create

DatasetMigration.create
Object.delete

Object.delete
DatasetMigration.all

DatasetMigration.all
GlobalSearch.subjects_count

GlobalSearch.subjects_count
protectedServerJS

protectedServerUI
Object.get_by_full_path

Object.get_by_full_path
Object.get_by_path

Object.get_by_path
Object.upload_file

Object.upload_file
Object.all

Object.all
Object.fields

Object.fields
SavedQuery.all

SavedQuery.all
SavedQuery.delete

SavedQuery.delete
Vault.create_dataset

Vault.create_dataset
SavedQuery.create

SavedQuery.create
Vault.create_folder

Vault.create_folder
Vault.objects

Vault.objects
Vault.get_personal_vault

Vault.get_personal_vault
DatasetImport.all

DatasetImport.all
DatasetCommit.retrieve

DatasetCommit.retrieve
GlobalSearch.search

GlobalSearch.search
DatasetImport.create

DatasetImport.create
DatasetCommit.delete

DatasetCommit.delete
GlobalSearch.subjects

GlobalSearch.subjects
Object.disable_global_beacon

Object.disable_global_beacon
SavedQuery.update

SavedQuery.update
SavedQuery.retrieve

SavedQuery.retrieve
Object.get_or_upload_file

Object.get_or_upload_file
Object.query

Object.query
Vault.all

Vault.all
Object.update

Object.update
Object.retrieve

Object.retrieve
Task.retrieve

Task.retrieve
Vault.get_by_full_path

Vault.get_by_full_path
User.retrieve

User.retrieve
Vault.create

Vault.create
Vault.get_or_create_by_full_path

Vault.get_or_create_by_full_path
Vault.retrieve

Vault.retrieve
Vault.search

Vault.search
Beacon.delete

Beacon.delete
Application.delete

Application.delete
Application.update

Application.update
Application.retrieve

Application.retrieve
Annotator.annotate

Annotator.annotate
Beacon.all

Beacon.all
Beacon.query

Beacon.query
Beacon.create

Beacon.create
Application.create

Application.create
Application.all

Application.all
Beacon.retrieve

Beacon.retrieve
BeaconSet.all

BeaconSet.all
Beacon.update

Beacon.update
BeaconSet.create

BeaconSet.create