Skip to contents

Pure. Takes an already-parsed response body and never touches the network, so it is tested directly against a stored response.

Usage

mygene_parse_hits(body, symbol = NA_character_)

Arguments

body

A parsed MyGene /query response, the whole body including hits.

symbol

The identifier that was queried, used to break the scoring tie described in mygene_pick_hit() and as the fallback symbol.

Value

A one-row tibble with symbol, name, summary, entrez, ensembl_gene, uniprot, hgnc, and type_of_gene. NULL when the body carries no usable hit.

Examples

body <- list(hits = list(list(
  symbol = "TP53",
  name = "tumor protein p53",
  entrezgene = "7157"
)))
mygene_parse_hits(body, "TP53")
#> # A tibble: 1 × 8
#>   symbol name             summary entrez ensembl_gene uniprot hgnc  type_of_gene
#>   <chr>  <chr>            <chr>   <chr>  <chr>        <chr>   <chr> <chr>       
#> 1 TP53   tumor protein p… NA      7157   NA           NA      NA    NA