Retrieve raw expression data of a dataset

get_dataset_raw_expression(
  dataset,
  quantitationType,
  raw = getOption("gemma.raw", FALSE),
  memoised = getOption("gemma.memoised", FALSE),
  file = getOption("gemma.file", NA_character_),
  overwrite = getOption("gemma.overwrite", FALSE)
)

Arguments

dataset

A numerical dataset identifier or a dataset short name

quantitationType

Quantitation type id. These can be acquired using get_dataset_quantitation_types function. This endpoint can only return non-processed quantitation types.

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

If raw is FALSE (default), a data table of the expression matrix for the queried dataset. If raw is TRUE, returns the binary file in raw form.

Examples

q_types <- get_dataset_quantitation_types("GSE59918")
get_dataset_raw_expression("GSE59918", q_types$id[q_types$name == "Counts"])
#>            Probe GeneSymbol
#>            <int>     <char>
#>     1: 100034253      Gnl3l
#>     2: 100036765     Ccdc92
#>     3: 100049583      Trex1
#>     4: 100101439           
#>     5: 100124593      Cxcr6
#>    ---                     
#> 31212:     94338      Smpd3
#> 31213:     94339      Mmp23
#> 31214:     94340      Acsl5
#> 31215:     94341     Kcnj13
#> 31216:     94342       Bag6
#>                                                             GeneName    NCBIid
#>                                                               <char>     <int>
#>     1:                                    G protein nucleolar 3 like 100034253
#>     2:                              coiled-coil domain containing 92 100036765
#>     3:                              three prime repair exonuclease 1 100049583
#>     4:                                                                      NA
#>     5:                              C-X-C motif chemokine receptor 6 100124593
#>    ---                                                                        
#> 31212:                             sphingomyelin phosphodiesterase 3     94338
#> 31213:                                    matrix metallopeptidase 23     94339
#> 31214:                acyl-CoA synthetase long-chain family member 5     94340
#> 31215: potassium inwardly-rectifying channel, subfamily J, member 13     94341
#> 31216:                                             BAG cochaperone 6     94342
#>        rat hippocampus Fru_rep3 rat hippocampus Fru_rep1
#>                           <num>                    <num>
#>     1:                   589.00                   834.00
#>     2:                   782.76                   868.61
#>     3:                    60.00                    66.00
#>     4:                     0.00                     0.00
#>     5:                     1.00                     1.00
#>    ---                                                  
#> 31212:                  1442.00                  1699.00
#> 31213:                    35.00                    17.00
#> 31214:                   828.00                  1215.00
#> 31215:                   281.00                  2100.00
#> 31216:                  1594.00                  2016.00
#>        rat hypothalamus Ctrl_rep1 rat hypothalamus Ctrl_rep2
#>                             <num>                      <num>
#>     1:                     1059.0                      953.0
#>     2:                     4147.9                     4084.7
#>     3:                      422.0                      388.0
#>     4:                        0.0                        0.0
#>     5:                        4.0                        0.0
#>    ---                                                      
#> 31212:                      880.0                      809.0
#> 31213:                      135.0                      127.0
#> 31214:                      518.0                      484.0
#> 31215:                      237.0                      120.0
#> 31216:                     5472.0                     4465.0
#>        rat hippocampus Fru_rep4 rat hippocampus Fru_rep2
#>                           <num>                    <num>
#>     1:                  1090.00                   769.00
#>     2:                   684.74                   862.79
#>     3:                    57.00                    96.00
#>     4:                     0.00                     0.00
#>     5:                     1.00                     9.00
#>    ---                                                  
#> 31212:                  2361.00                  1736.00
#> 31213:                    21.00                    83.00
#> 31214:                  1863.00                  1254.00
#> 31215:                  2345.00                   711.00
#> 31216:                  2064.00                  1881.00
#>        rat hypothalamus Fru_rep3 rat hippocampus Ctrl_rep1
#>                            <num>                     <num>
#>     1:                    1187.0                    539.00
#>     2:                    4158.3                    774.63
#>     3:                     416.0                     59.00
#>     4:                       0.0                      0.00
#>     5:                       2.0                      2.00
#>    ---                                                    
#> 31212:                     913.0                   1176.00
#> 31213:                     141.0                     33.00
#> 31214:                     459.0                    845.00
#> 31215:                     142.0                   1165.00
#> 31216:                    5576.0                   1661.00
#>        rat hypothalamus Ctrl_rep4 rat hypothalamus Fru_rep2
#>                             <num>                     <num>
#>     1:                      729.0                    1224.0
#>     2:                     4629.4                    4380.2
#>     3:                      373.0                     356.0
#>     4:                        0.0                       0.0
#>     5:                        6.0                       3.0
#>    ---                                                     
#> 31212:                      703.0                     926.0
#> 31213:                      130.0                      79.0
#> 31214:                      390.0                     524.0
#> 31215:                      282.0                       6.0
#> 31216:                     4690.0                    5364.0
#>        rat hypothalamus Fru_rep1 rat hippocampus Ctrl_rep4
#>                            <num>                     <num>
#>     1:                    1191.0                    648.00
#>     2:                    4681.6                    768.66
#>     3:                     420.0                     64.00
#>     4:                       0.0                      0.00
#>     5:                       4.0                      2.00
#>    ---                                                    
#> 31212:                    1004.0                   1541.00
#> 31213:                     133.0                     51.00
#> 31214:                     581.0                   1431.00
#> 31215:                      85.0                   1199.00
#> 31216:                    5406.0                   1978.00
#>        rat hippocampus Ctrl_rep3 rat hippocampus Ctrl_rep2
#>                            <num>                     <num>
#>     1:                    1126.0                    770.00
#>     2:                    1273.7                    871.83
#>     3:                      72.0                     55.00
#>     4:                       0.0                      0.00
#>     5:                       0.0                      0.00
#>    ---                                                    
#> 31212:                    2456.0                   1620.00
#> 31213:                      25.0                     16.00
#> 31214:                    1412.0                   1177.00
#> 31215:                     269.0                    641.00
#> 31216:                    2807.0                   1626.00
#>        rat hypothalamus Ctrl_rep3 rat hypothalamus Fru_rep4
#>                             <num>                     <num>
#>     1:                      932.0                     263.0
#>     2:                     3527.7                    3229.1
#>     3:                      345.0                     449.0
#>     4:                        1.0                       0.0
#>     5:                        7.0                       0.0
#>    ---                                                     
#> 31212:                      883.0                     406.0
#> 31213:                      146.0                      85.0
#> 31214:                      594.0                     310.0
#> 31215:                      246.0                      73.0
#> 31216:                     4698.0                    3896.0