Skip to contents

The batch POST, which is the reason this client is worth installing. An N-symbol list is one round trip rather than N, and the round trip is where essentially all the time goes.

Usage

mygene_genes(symbols, species = "human", chunk_size = MYGENE_BATCH, ...)

Arguments

symbols

Gene symbols, Ensembl gene ids, or Entrez ids.

species

Passed through to MyGene.

chunk_size

Identifiers per request, at most MYGENE_BATCH.

...

Passed to biohttp::post_json_many().

Value

A biohttp envelope whose data is a tibble with one row per entry in symbols, in the same order.

Details

MyGene takes at most 1000 identifiers per POST, see MYGENE_BATCH. A longer list is chunked, the chunks are dispatched through biohttp::post_json_many(), and the hits are merged back onto symbols in input order. A chunk that failed yields a row of NA per identifier rather than taking the whole call down, following gnomad_constraints(); only when every chunk failed is the failing envelope returned.

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

# \donttest{
res <- mygene_genes(c("TP53", "BRCA1", "EGFR"))
biohttp::body_or_null(res)
#> # A tibble: 3 × 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… This g… 7157   ENSG0000014… P04637  11998 protein-cod…
#> 2 BRCA1  BRCA1 DNA repai… This g… 672    ENSG0000001… P38398  1100  protein-cod…
#> 3 EGFR   epidermal growt… The pr… 1956   ENSG0000014… P00533  3236  protein-cod…
# }