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. When a gene has several Ensembl ids, ensembl_gene is the one on a reference chromosome (1 to 22, X, Y or MT), and NA when none of them is. Picking it needs genomic_pos in the body, which mygene_gene() and mygene_genes() ask for. A body fetched without it gives NA for any gene with several ids.

References

Xin et al. (2016). High-performance web services for querying gene and variant annotation. Genome Biology 17, 91. doi:10.1186/s13059-016-0953-9

Service documentation: https://mygene.info/

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