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_1_A0B0        31
#> 2: BAL_27a_A0B0        20
#> 3:  BAL_43_A0B0         9
#> 4:  BAL_13_A0B0        29
#> 5:  BAL_29_A1B0        18
#> 6: BAL_44b_A0B0         7
#>                                                                                                                                                                                                                                       sample.description
#>                                                                                                                                                                                                                                                   <char>
#> 1:                                                             Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=0 (Non-acute rejection).\nSource GEO sample is GSM36426\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=0 (Non-acute rejection). One of two samples from the same patient, different visits\nSource GEO sample is GSM36437\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).\nSource GEO sample is GSM36448\nLast updated (according to GEO): May 27 2005
#> 4:                                                             Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=0 (Non-acute rejection).\nSource GEO sample is GSM36428\nLast updated (according to GEO): May 27 2005
#> 5:                                                             Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=1 and B=0 (Non-acute rejection).\nSource GEO sample is GSM36439\nLast updated (according to GEO): May 27 2005
#> 6:  Bronchoalveolar lavage cells from a patient with an ISHLT biopsy score of A=0 and B=0 (Non-acute rejection). One of two samples from the same patient, different visits\nSource GEO sample is GSM36450\nLast updated (according to GEO): May 27 2005
#>    sample.outlier sample.accession sample.database sample.characteristics
#>            <lgcl>           <char>          <char>                 <list>
#> 1:          FALSE         GSM36426             GEO           c("molec....
#> 2:          FALSE         GSM36437             GEO           c("molec....
#> 3:          FALSE         GSM36448             GEO           c("molec....
#> 4:          FALSE         GSM36428             GEO           c("molec....
#> 5:          FALSE         GSM36439             GEO           c("molec....
#> 6:          FALSE         GSM36450             GEO           c("molec....
#>    sample.factorValues
#>                 <list>
#> 1:        c("block....
#> 2:        c("block....
#> 3:        c("block....
#> 4:        c("block....
#> 5:        c("block....
#> 6:        c("disea....