Retrieve the expression data matrix of a set of datasets and genes

get_dataset_expression_for_genes(
  datasets,
  genes,
  keepNonSpecific = FALSE,
  consolidate = NA_character_,
  raw = getOption("gemma.raw", FALSE),
  memoised = getOption("gemma.memoised", FALSE),
  file = getOption("gemma.file", NA_character_),
  overwrite = getOption("gemma.overwrite", FALSE)
)

Arguments

datasets

A vector of dataset IDs or short names

genes

A vector of NCBI IDs, Ensembl IDs or gene symbols.

keepNonSpecific

logical. FALSE by default. If TRUE, results from probesets that are not specific to the gene will also be returned.

consolidate

An option for gene expression level consolidation. If empty, will return every probe for the genes. "pickmax" to pick the probe with the highest expression, "pickvar" to pick the prove with the highest variance and "average" for returning the average expression

raw

TRUE to receive results as-is from Gemma, or FALSE to enable parsing. Raw results usually contain additional fields and flags that are omitted in the parsed results.

memoised

Whether or not to save to cache for future calls with the same inputs and use the result saved in cache if a result is already saved. Doing options(gemma.memoised = TRUE) will ensure that the cache is always used. Use forget_gemma_memoised to clear the cache.

file

The name of a file to save the results to, or NULL to not write results to a file. If raw == TRUE, the output will be the raw endpoint from the API, likely a JSON or a gzip file. Otherwise, it will be a RDS file.

overwrite

Whether or not to overwrite if a file exists at the specified filename.

Value

A list of data frames

Examples

get_dataset_expression_for_genes("GSE2018", genes = c(10225, 2841))
#> $`1`
#>        Probe GeneSymbol NCBIid BAL_47c_A0B1 BAL_47b_A0B1 BAL_47a_A0B0
#>       <char>     <char>  <int>        <num>        <num>        <num>
#> 1: 210279_at      GPR18   2841     4.648810     4.692016     4.582546
#> 2: 206761_at       CD96  10225     4.542716     4.582452     4.525138
#>    BAL_46_A2B0 BAL_45b_A2B0 BAL_45a_A1B0 BAL_44b_A0B0 BAL_44a_A0B0 BAL_43_A0B0
#>          <num>        <num>        <num>        <num>        <num>       <num>
#> 1:    5.469026     5.948961     4.656690     4.556524     4.538479    4.447625
#> 2:    5.013087     5.268057     4.541356     4.386026     4.480109    4.488685
#>    BAL_42_A0B0 BAL_41_A1B0 BAL_40_A0B0 BAL_4_A0B0 BAL_39_A0B1 BAL_33_A0B1
#>          <num>       <num>       <num>      <num>       <num>       <num>
#> 1:    4.663407    4.471560    4.686329   4.695328    4.660488    4.460669
#> 2:    4.580567    4.656262    4.662121   4.656544    4.443481    4.512166
#>    BAL_31_A0B1 BAL_3_A1B0 BAL_29_A1B0 BAL_27b_A2B1 BAL_27a_A0B0 BAL_26_A2B0
#>          <num>      <num>       <num>        <num>        <num>       <num>
#> 1:    4.874795   4.821701    4.691512     5.266263     4.654372    5.232383
#> 2:    4.550056   4.677616    4.661147     5.003438     4.721373    4.887611
#>    BAL_25_A0B0 BAL_21_A0B0 BAL_20b_A1B1 BAL_20a_A1B1 BAL_19_A0B0 BAL_18_A1B0
#>          <num>       <num>        <num>        <num>       <num>       <num>
#> 1:    4.483595    4.784791     5.831111          NaN    4.746777    4.569245
#> 2:    4.437924    4.731956     5.258778          NaN    4.568647    4.374732
#>    BAL_17_A0B0 BAL_13_A0B0 BAL_12_A1B0 BAL_1_A0B0 BAL_15b_A0B0 BAL_15a_A0B1
#>          <num>       <num>       <num>      <num>        <num>        <num>
#> 1:    4.509543    4.688759    4.654849   4.637970     4.768349     4.562564
#> 2:    4.415465    4.725440    4.503594   4.406503     4.712064     4.443919
#>    BAL_37_A1B1
#>          <num>
#> 1:    5.837180
#> 2:    5.227731
#> 
#> attr(,"call")
#> [1] "https://gemma.msl.ubc.ca/rest/v2/datasets/GSE2018/expressions/genes/10225%2C2841?keepNonSpecific=false"
#> attr(,"env")
#> <environment: 0x5586ca279150>