diff --git a/DESCRIPTION b/DESCRIPTION index 7c41370..7257357 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: easylift Title: An R package to perform genomic liftover -Version: 0.99.4 +Version: 0.99.5 Date: 2023-09-25 Authors@R: c( diff --git a/R/easylift.R b/R/easylift.R index 6baef32..0df7a40 100644 --- a/R/easylift.R +++ b/R/easylift.R @@ -46,16 +46,18 @@ #' which is the basis for \code{easylift}. #' @export easylift <- function(x, to, chain) { - # Check if genome(x) has multiple unique values + # Check if GRanges object is provided + if (anyNA(GenomeInfoDb::genome(x))) { + stop("The genome information is missing. Please set genome(x) before using easylift.") + } + + # Check if the input GRanges contains genomic coordinates from multiple genomes unique_genomes <- unique(GenomeInfoDb::genome(x)) if (length(unique_genomes) > 1) { stop("The 'GRanges' object 'x' contains genomic coordinates from multiple genomes. ", "Please provide 'x' with coordinates from a single genome assembly.") } - if (anyNA(GenomeInfoDb::genome(x))) { - stop("The genome information is missing. Please set genome(x) before using easylift.") - } # Convert the input GRanges to the "UCSC" seqlevels style if not already if (GenomeInfoDb::seqlevelsStyle(x) != "UCSC") { GenomeInfoDb::seqlevelsStyle(x) <- "UCSC" diff --git a/README.Rmd b/README.Rmd index a79c25d..ae8b320 100644 --- a/README.Rmd +++ b/README.Rmd @@ -71,7 +71,7 @@ easylift(gr, "hg38") To cite package ‘easylift’ in publications use: Al Nahid A, Love M (2023). _easylift: An R package to perform - genomic liftover_. R package version 0.99.4, + genomic liftover_. R package version 0.99.5, . @@ -82,7 +82,7 @@ A BibTeX entry for LaTeX users is title = {easylift: An R package to perform genomic liftover}, author = {Abdullah Al Nahid and Michael Love}, year = {2023}, - note = {R package version 0.99.4}, + note = {R package version 0.99.5}, url = {https://github.com/nahid18/easylift}, } ``` diff --git a/README.md b/README.md index d599441..7a87834 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ easylift(gr, "hg38") To cite package ‘easylift’ in publications use: Al Nahid A, Love M (2023). *easylift: An R package to perform genomic -liftover*. R package version 0.99.4, +liftover*. R package version 0.99.5, . A BibTeX entry for LaTeX users is @@ -78,7 +78,7 @@ A BibTeX entry for LaTeX users is title = {easylift: An R package to perform genomic liftover}, author = {Abdullah Al Nahid and Michael Love}, year = {2023}, - note = {R package version 0.99.4}, + note = {R package version 0.99.5}, url = {https://github.com/nahid18/easylift}, } diff --git a/tests/testthat/test-easylift.R b/tests/testthat/test-easylift.R index 1bee59e..258d0dc 100644 --- a/tests/testthat/test-easylift.R +++ b/tests/testthat/test-easylift.R @@ -67,9 +67,9 @@ test_that("easylift succeeds with BiocFileCache", { expect_true(nrow(q) > 0, "Chain file should exist in cache.") # Create a test GRanges object - gr <- GRanges( + gr <- GenomicRanges::GRanges( seqname = Rle(c("chr1", "chr2"), c(100000, 100000)), - ranges = IRanges(start = 1, end = 200000) + ranges = IRanges::IRanges(start = 1, end = 200000) ) genome(gr) <- "hg19"