R Template
This notebook is a template for SolveBio R examples. Download the original notebook here.
Install and Load Packages
| install.packages("solvebio", repos = 'http://cran.us.r-project.org')
library("solvebio")
|
Log-in to SolveBio
You'll need your SolveBio API key to run this notebook. You can get your API key from your Security Settings.
| solvebio::login("YOUR API KEY")
|
Example: Get the top genes in ClinVar
| # Retrieve the top gene symbols in ClinVar
clinvar <- Dataset.get_by_full_path("solveBio:public:/ClinVar/3.7.4-2017-01-30/Combined-GRCh37")
facets <- Dataset.facets(id = clinvar$id, facets = list("gene_symbol"))
# Process list of (gene, count) pairs and plot them
results <- do.call(rbind, facets$gene_symbol)
barplot(as.numeric(results[,2]), names = results[,1], cex.names = 0.5)
|