View source: R/liftover_coord.R
| liftover_coord | R Documentation |
This function allows users to lift genomic co-ordinates from one genome build to another. It uses an over.chain liftOver conversion file. Conversion files can be downloaded from UCSC.
liftover_coord(df, path_to_chain)
df |
a
Any additional columns included will be preserved. |
path_to_chain |
a |
Dataframe with coordinates in different genome build.
file_path <-
system.file(
"testdata",
"liftover_test_data.txt",
package = "rutils",
mustWork = TRUE
)
hg19_path <-
system.file(
"testdata",
"hg19ToHg38.over.chain",
package = "rutils",
mustWork = TRUE
)
genomic_df <-
readr::read_delim(file_path,
delim = " ",
col_types =
readr::cols(
SNP = readr::col_character(),
CHR = readr::col_factor(),
BP_hg19 = readr::col_integer(),
BP_hg38 = readr::col_integer()
)
)
liftover_coord(
df =
genomic_df %>%
dplyr::select(SNP,
CHR,
BP = BP_hg19
),
path_to_chain = hg19_path
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.