Convert CHR:BP to rsID (not recommended)
add_rsid.RdThis function takes a dataframe that must include columns 'CHR' and 'BP', and it appends the corresponding rsID by querying the SNPlocs.Hsapiens.dbSNP155.GRCh37 database. The function returns a dataframe with the rsIDs included.
Examples
if (FALSE) { # \dontrun{
pacman::p_load(data.table, BSgenome, leo.gwas)
library("SNPlocs.Hsapiens.dbSNP155.GRCh37") # for GRCh37
library("SNPlocs.Hsapiens.dbSNP155.GRCh38") # for GRCh38
df <- data.frame(
CHR = c(1, 1),
BP = c(15211, 15820)
)
result <- add_rsid(df); result
} # }