README.md
97f4dc91
 
17868beb
 # easylift
 
 <!-- badges: start -->
 
 [![GitHub
 issues](https://img.shields.io/github/issues/nahid18/easylift)](https://github.com/nahid18/easylift/issues)
 [![GitHub
 pulls](https://img.shields.io/github/issues-pr/nahid18/easylift)](https://github.com/nahid18/easylift/pulls)
 <!-- badges: end -->
 
 The goal of `easylift` is to perform genomic liftover given `GRanges`
 and `chain` file.
 
cb2387e1
 ## Installation
17868beb
 
 ``` r
cec11650
 if (!require("BiocManager", quietly = TRUE))
     install.packages("BiocManager")
 
eff4a9a7
 BiocManager::install("easylift")
17868beb
 ```
 
cec11650
 ## Documentation
 
 To view documentation:
 
 ``` r
 browseVignettes("easylift")
 ```
 
 ## Import
17868beb
 
9baff943
 Import the libraries
17868beb
 
 ``` r
 library("easylift")
 ```
 
cec11650
 Call `easylift` with `GRanges` object, target genome and the chain file.
17868beb
 
 ``` r
eff4a9a7
 gr <- GRanges(
   seqname = Rle(
     c("chr1", "chr2"), 
     c(100000, 100000)
   ),
   ranges = IRanges(
     start = 1, 
     end = 200000
   )
 )
e4091e24
 # Here, "hg19" is the source genome
17868beb
 genome(gr) <- "hg19"
 chain <- "hg19ToHg38.over.chain.gz"
9baff943
 
e4091e24
 # Here, "hg38" is the target genome
 easylift(gr, "hg38", chain)
17868beb
 ```
 
e4091e24
 ### BiocFileCache
 
cec11650
 To use `BiocFileCache` for the chain file, add it to the cache:
eff4a9a7
 
 ``` r
a6de3cb6
 chain_file <- "/path/to/your/hg19ToHg38.over.chain.gz"
eff4a9a7
 bfc <- BiocFileCache()
e4091e24
 
 # Add chain file to cache if already not available
 if (nrow(bfcquery(bfc, basename(chain_file))) == 0)
     bfcadd(bfc, chain_file)
eff4a9a7
 ```
 
cec11650
 Then, use it in `easylift`:
eff4a9a7
 
 ``` r
e4091e24
 easylift(gr, "hg38") 
 # or
 gr |> easylift("hg38") 
eff4a9a7
 ```
 
17868beb
 ## Citation
 
aa2acc51
 To cite package `easylift` in publications use:
17868beb
 
54efd726
 Al Nahid A, Pagès H, Love M (2023). *easylift: An R package to perform
9423c0e7
 genomic liftover*. R package version 1.0.0,
31c04813
 <https://github.com/nahid18/easylift>.
 
 A BibTeX entry for LaTeX users is
 
       @Manual{,
878fdf96
         title = {easylift: An R package to perform genomic liftover},
54efd726
         author = {Abdullah Al Nahid, Hervé Pagès, Michael Love},
31c04813
         year = {2023},
9423c0e7
         note = {R package version 1.0.0},
31c04813
         url = {https://github.com/nahid18/easylift},
       }
17868beb
 
 Please note that the `easylift` was only made possible thanks to many
 other R and bioinformatics software authors, which are cited either in
 the vignettes and/or the paper(s) describing this package.
 
 ## Code of Conduct
 
 Please note that the `easylift` project is released with a [Contributor
 Code of Conduct](http://bioconductor.org/about/code-of-conduct/). By
 contributing to this project, you agree to abide by its terms.