Skip to content

Commit

Permalink
fix: tests for pair_granges
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Jun 19, 2024
1 parent eec32cb commit 59b02c0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ importFrom(plyranges,anchor_5p)
importFrom(plyranges,anchor_center)
importFrom(plyranges,anchor_end)
importFrom(plyranges,anchor_start)
importFrom(plyranges,as_granges)
importFrom(plyranges,count_overlaps)
importFrom(plyranges,count_overlaps_directed)
importFrom(plyranges,filter_by_non_overlaps)
Expand Down
2 changes: 1 addition & 1 deletion R/pair-granges.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
pair_granges <- function(x) {

combs <- combn(length(x), 2)
InteractionSet::GInteractions(combs[1,], combs[2,], gr)
InteractionSet::GInteractions(combs[1,], combs[2,], x)

}
1 change: 1 addition & 0 deletions R/reexports-plyranges.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @rdname reexports
#' @importFrom plyranges as_granges
#' @importFrom plyranges anchor
#' @export
plyranges::anchor
Expand Down
20 changes: 10 additions & 10 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ library(testthat)
library(plyinteractions)

gi <- read.table(text = "
chr1 11 20 chr1 21 30 + +
chr1 11 20 chr1 51 55 + +
chr1 11 30 chr1 51 55 - -
chr1 11 30 chr2 51 60 - -",
col.names = c(
"seqnames1", "start1", "end1",
"seqnames2", "start2", "end2", "strand1", "strand2")
) |>
as_ginteractions() |>
mutate(score = runif(4), type = c('cis', 'cis', 'cis', 'trans'))
chr1 11 20 chr1 21 30 + +
chr1 11 20 chr1 51 55 + +
chr1 11 30 chr1 51 55 - -
chr1 11 30 chr2 51 60 - -",
col.names = c(
"seqnames1", "start1", "end1",
"seqnames2", "start2", "end2", "strand1", "strand2")
) |>
as_ginteractions() |>
mutate(score = runif(4), type = c('cis', 'cis', 'cis', 'trans'))

test_check("plyinteractions")

0 comments on commit 59b02c0

Please sign in to comment.