Skip to contents

MyGene's _score can rank a fuzzy alias or retired match to a different gene above the exact symbol match. Querying "TTN" with the alias and retired scopes returns TTR (entrez 7276, score 19.07) ahead of TTN (7273, score 18.29). Taking the top-scored hit therefore returns the wrong gene, quietly.

Usage

mygene_pick_hit(hits, token)

Arguments

hits

A list of hit records from a MyGene response.

token

The identifier that was queried.

Value

One hit record, or NULL when hits is empty.

Details

So a hit whose official symbol equals the token wins, case-insensitively. Only when none does, which is the case for a deliberate alias such as "p53", does MyGene's own best-scored hit get used.

This is the single most important thing in this file. It is exported so a caller assembling its own hits can apply the same rule.

Examples

hits <- list(
  list(symbol = "TTR", entrezgene = "7276"),
  list(symbol = "TTN", entrezgene = "7273")
)
mygene_pick_hit(hits, "TTN")$entrezgene
#> [1] "7273"