Retrieve the annotations of a dataset

get_dataset_annotations(
  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 annotations 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:

  • class.name: Name of the annotation class (e.g. organism part)

  • class.URI: URI for the annotation class

  • term.name: Name of the annotation term (e.g. lung)

  • term.URI: URI for the annotation term

  • object.class: Class of object that the term originated from.

Examples

get_dataset_annotations("GSE2018")
#>       class.name                            class.URI
#>           <char>                               <char>
#> 1:       disease http://www.ebi.ac.uk/efo/EFO_0000408
#> 2: organism part http://www.ebi.ac.uk/efo/EFO_0000635
#> 3:       disease http://www.ebi.ac.uk/efo/EFO_0000408
#>                                         term.name
#>                                            <char>
#> 1:                                          acute
#> 2:                                           lung
#> 3: disease related to solid organ transplantation
#>                                         term.URI  object.class
#>                                           <char>        <char>
#> 1:   http://purl.obolibrary.org/obo/PATO_0000389   FactorValue
#> 2: http://purl.obolibrary.org/obo/UBERON_0002048 ExperimentTag
#> 3:  http://purl.obolibrary.org/obo/MONDO_0700221   FactorValue