Search for annotation tags

search_annotations(
  query,
  raw = getOption("gemma.raw", FALSE),
  memoised = getOption("gemma.memoised", FALSE),
  file = getOption("gemma.file", NA_character_),
  overwrite = getOption("gemma.overwrite", FALSE)
)

Arguments

query

The search query. Queries can include plain text or ontology terms They also support conjunctions ("alpha AND beta"), disjunctions ("alpha OR beta") grouping ("(alpha OR beta) AND gamma"), prefixing ("alpha*"), wildcard characters ("BRCA?") and fuzzy matches ("alpha~").

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 annotations (annotation search result value objects) matching the given identifiers. A list if raw = TRUE. A 400 error if required parameters are missing.

The fields of the output data.table are:

  • category.name: Category that the annotation belongs to

  • category.URI: URI for the category.name

  • value.name: Annotation term

  • value.URI: URI for the value.name

  • usageCount: Number of times the annotation is used in Gemma. Results are sorted by this field in decreasing order.

Examples

search_annotations("traumatic")
#>     category.name                            category.URI
#>            <char>                                  <char>
#>  1: disease model http://gemma.msl.ubc.ca/ont/TGEMO_00101
#>  2:          <NA>                                    <NA>
#>  3:          <NA>                                    <NA>
#>  4:          <NA>                                    <NA>
#>  5:          <NA>                                    <NA>
#>  6:          <NA>                                    <NA>
#>  7:          <NA>                                    <NA>
#>  8:          <NA>                                    <NA>
#>  9:          <NA>                                    <NA>
#> 10:          <NA>                                    <NA>
#> 11:          <NA>                                    <NA>
#> 12:          <NA>                                    <NA>
#> 13:          <NA>                                    <NA>
#> 14:          <NA>                                    <NA>
#> 15:          <NA>                                    <NA>
#> 16:          <NA>                                    <NA>
#> 17:          <NA>                                    <NA>
#> 18:          <NA>                                    <NA>
#> 19:          <NA>                                    <NA>
#> 20:          <NA>                                    <NA>
#>     category.name                            category.URI
#>            <char>                                  <char>
#>                                               value.name
#>                                                   <char>
#>  1:                               traumatic brain injury
#>  2:                             traumatic encephalopathy
#>  3:                                       traumatic acid
#>  4:                                   traumatic glaucoma
#>  5:                         traumatic avascular necrosis
#>  6:                        traumatic myositis ossificans
#>  7:                                 traumatic neuropathy
#>  8:             traumatic brain injury, non-human animal
#>  9:       traumatic ear canal avulsion, non-human animal
#> 10:           traumatic hemoperitoneum, non-human animal
#> 11:     traumatic pericardial effusion, non-human animal
#> 12:             traumatic pericarditis, non-human animal
#> 13:          traumatic dental fracture, non-human animal
#> 14:              traumatic pharyngitis, non-human animal
#> 15:     traumatic rectovaginal fistula, non-human animal
#> 16:          traumatic splenic rupture, non-human animal
#> 17:    traumatic diaphragmatic rupture, non-human animal
#> 18:                 traumatic myositis, non-human animal
#> 19:                traumatic keratitis, non-human animal
#> 20: traumatic nasolacrimal duct injury, non-human animal
#>                                               value.name
#>                                                   <char>
#>                                        value.URI usageCount
#>                                           <char>      <int>
#>  1: http://purl.obolibrary.org/obo/MONDO_0858950         39
#>  2: http://purl.obolibrary.org/obo/MONDO_0043512          2
#>  3:  http://purl.obolibrary.org/obo/CHEBI_545687          0
#>  4: http://purl.obolibrary.org/obo/MONDO_0001626          0
#>  5: http://purl.obolibrary.org/obo/MONDO_0018375          0
#>  6: http://purl.obolibrary.org/obo/MONDO_0021929          0
#>  7: http://purl.obolibrary.org/obo/MONDO_0100634          0
#>  8: http://purl.obolibrary.org/obo/MONDO_1013018          0
#>  9: http://purl.obolibrary.org/obo/MONDO_1013810          0
#> 10: http://purl.obolibrary.org/obo/MONDO_1013844          0
#> 11: http://purl.obolibrary.org/obo/MONDO_1013869          0
#> 12: http://purl.obolibrary.org/obo/MONDO_1013962          0
#> 13: http://purl.obolibrary.org/obo/MONDO_1014296          0
#> 14: http://purl.obolibrary.org/obo/MONDO_1014363          0
#> 15: http://purl.obolibrary.org/obo/MONDO_1014372          0
#> 16: http://purl.obolibrary.org/obo/MONDO_1014698          0
#> 17: http://purl.obolibrary.org/obo/MONDO_1015354          0
#> 18: http://purl.obolibrary.org/obo/MONDO_1015837          0
#> 19: http://purl.obolibrary.org/obo/MONDO_1016429          0
#> 20: http://purl.obolibrary.org/obo/MONDO_1016444          0
#>                                        value.URI usageCount
#>                                           <char>      <int>