knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
devtools::load_all()

Gemma API

Table of Contents

This is an R wrapper for Gemma's restful API.

To cite Gemma, please use: Zoubarev, A., et al., Gemma: A resource for the re-use, sharing and meta-analysis of expression profiling data. Bioinformatics, 2012.

Installation

devtools::install_github('PavlidisLab/gemmaAPI.R')

Documentation

For basic api calls see ?endpointFunctions. These functions return mostly unaltered data from a given API endpoint.

For high level functions see ?highLevelFunctions. These functions return data compiled from multiple api calls.

Examples

Download data for a dataset

data = 
    datasetInfo('GSE107999',
                request='data', # we want this endpoint to return data. see documentation
                filter = FALSE, # data request accepts filter argument we want non filtered data
                return = TRUE, # TRUE by default, all functions have this. if false there'll be no return
                file = NULL # NULL by default, all functions have this. If specificed, output will be saved.
    )

head(data) %>% knitr::kable(format ='markdown')

Get metadata for first 10 mouse studies.

mouseStudies = taxonInfo('mouse',request = 'datasets',limit = 0)
studyIDs = mouseStudies %>% purrr::map_int('id')
mouseMetadata = studyIDs[1:10] %>% lapply(compileMetadata,outputType = 'list') 
# default outputType is data.frame, which returns a single data frame with study and sample data all together.
mouseMetadata[[1]]$sampleData %>% head %>% knitr::kable(format ='markdown')

Download expression data a study

studyIDs %>% sapply(function(x){datasetInfo(x,request= 'data',return= FALSE, file = paste0('data/',x))})

Changelog

17 September 2018:



oganm/gemmaAPI documentation built on July 23, 2022, 8:26 p.m.