Skip to content

Commit

Permalink
feat: minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid18 committed Sep 25, 2023
1 parent 395f5ee commit 8d1a9d4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
10 changes: 6 additions & 4 deletions R/easylift.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
<https://github.com/nahid18/easylift>.


Expand All @@ -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},
}
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
<https://github.com/nahid18/easylift>.

A BibTeX entry for LaTeX users is
Expand All @@ -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},
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-easylift.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8d1a9d4

Please sign in to comment.