Apply a given score function to all pairwise combinations of two named GRanges lists
pairwise_score.RdApply a given score function to all pairwise combinations of two named GRanges lists
Examples
gr_a1 <- GenomicRanges::GRanges(seqnames = c("chr1"), IRanges::IRanges(11, 20), strand = "-")
gr_a2 <- GenomicRanges::GRanges(seqnames = c("chr1"), IRanges::IRanges(24, 25), strand = "+")
gr_b1 <- GenomicRanges::GRanges(seqnames = c("chr1"), IRanges::IRanges(15, 24), strand = "-")
gr_b2 <- GenomicRanges::GRanges(seqnames = c("chr1"), IRanges::IRanges(16, 25), strand = "+")
# Fix the function parameters
score_func <- purrr::partial(
fc_enrichment,
genome_size = 30,
ignore.strand = FALSE
)
pairwise_score(
list("A" = gr_a1, "B" = gr_a2),
list("X" = gr_b1, "Y" = gr_b2),
score_func
)
#> gr1 gr2 score
#> 1 A X 1.8
#> 2 B X 0.0
#> 3 A Y 0.0
#> 4 B Y 3.0