Retrieve the samples of a dataset

get_dataset_samples(
  dataset,
  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

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 data table with information about the samples of the queried dataset. A list if raw = TRUE. A 404 error if the given identifier does not map to any object.

The fields of the output data.table are:

  • sample.name: Internal name given to the sample.

  • sample.ID: Internal ID of the sample

  • sample.description: Free text description of the sample

  • sample.outlier: Whether or not the sample is marked as an outlier

  • sample.accession: Accession ID of the sample in it's original database

  • sample.database: Database of origin for the sample

  • sample.characteristics: Characteristics of the sample. This field is a data table

  • sample.factorValues: Experimental factor values of the sample. This field is a data table

Examples

head(get_dataset_samples("GSE2018"))
#>     sample.name sample.ID
#>          <char>     <int>
#> 1: BAL_47c_A0B1         1
#> 2: BAL_47b_A0B1         2
#> 3: BAL_47a_A0B0         3
#> 4:  BAL_46_A2B0         4
#> 5: BAL_45b_A2B0         5
#> 6: BAL_45a_A1B0         6
#>                                                                                                                                                                                                                                          sample.description
#>                                                                                                                                                                                                                                                      <char>
#> 1:  Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=1 (Non-acute rejection). One of three samples from the same patient, different visits.\nSource GEO sample is GSM36456\nLast updated (according to GEO): May 27 2005
#> 2:  Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=1 (Non-acute rejection). One of three samples from the same patient, different visits.\nSource GEO sample is GSM36455\nLast updated (according to GEO): May 27 2005
#> 3:  Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=0 (Non-acute rejection). One of three samples from the same patient, different visits.\nSource GEO sample is GSM36454\nLast updated (according to GEO): May 27 2005
#> 4:                                                                    Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=2 and B=0 (Acute rejection).\nSource GEO sample is GSM36453\nLast updated (according to GEO): May 27 2005
#> 5:         Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=2 and B=0 (Acute rejection). One of two samples from the same patient, different visits\nSource GEO sample is GSM36452\nLast updated (according to GEO): May 27 2005
#> 6:    Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=1 and B=0 (Non-acute rejection). One of two samples from the same patient, different visits.\nSource GEO sample is GSM36451\nLast updated (according to GEO): May 27 2005
#>    sample.outlier sample.accession sample.database sample.characteristics
#>            <lgcl>           <char>          <char>                 <list>
#> 1:          FALSE         GSM36456             GEO           c("molec....
#> 2:          FALSE         GSM36455             GEO           c("molec....
#> 3:          FALSE         GSM36454             GEO           c("molec....
#> 4:          FALSE         GSM36453             GEO           c("molec....
#> 5:          FALSE         GSM36452             GEO           c("molec....
#> 6:          FALSE         GSM36451             GEO           c("molec....
#>    sample.factorValues
#>                 <list>
#> 1:        c("block....
#> 2:        c("block....
#> 3:        c("block....
#> 4:        c("disea....
#> 5:        c("block....
#> 6:        c("block....