get_rsid: Get rsid name from position

Description Usage Arguments Value Examples

View source: R/rsid_search.R

Description

This method combines the cached and API version of get_rsid

Usage

1
2
3
4
5
6
7
8
9
get_rsid(
  chrom,
  pos,
  ref,
  alt,
  assembly = valid_references,
  cache_file = NULL,
  update_cache = TRUE
)

Arguments

chrom

The name of the contig for the SNP (the "chr" prefix will be ignored if present)

pos

The (1-based) position of the SNP

ref

The reference allele (only SNPs are supported)

alt

The alternate allele (only SNPs are supported)

assembly

Which reference genome to use ("hg18", "hg19", or "hg38")

cache_file

Which file to use for caching results. if NULL will not use cache

update_cache

A boolean indicating whether to update the cache results.

Value

an rsid identifier of the position provided

Examples

1
2
3
4
5
6
get_rsid("9", 125711603, "C", "A") # "rs10760259"
get_rsid("9", 136155000, "T", "C") # "rs635634"
get_rsid("9", 136155000, "C", "T") # "rs635634"
get_rsid("chr6", 32007459, "A",	"G") # "rs12525076"
get_rsid("chr6", 32007459, "G",	"A") # "rs12525076"
get_rsid("6", 32007459, "A",	"G") # "rs12525076"

richardslab/MRutils documentation built on Dec. 22, 2021, 4 p.m.