R/granges_overlap.R
granges_overlap.RdFind GenomicRanges overlap
Find overlap genomic position overlap between two GRanges objects.
granges_overlap(
dat1,
dat2,
chrom_col.1 = "chrom",
start_col.1 = "start",
end_col.1 = start_col.1,
chrom_col.2 = "chrom",
start_col.2 = "start",
end_col.2 = end_col.2,
return_merged = TRUE,
unique_only = TRUE,
style = "NCBI",
verbose = FALSE
)Dataset 1 (can be GRanges or data.table).
Dataset 2. (can be GRanges or data.table).
Name of the chromosome column in dat1.
Name of the start position column in dat1.
Name of the end position column in dat2.
Name of the chromosome column in dat2.
Name of the start position column in dat2.
Name of the end position column in dat2.
Whether to return an object with columns
from dat1 and dat2 merged.
Only return unique rows.
GRanges style (e.g. "NCBI, "UCSC") set by seqlevelsStyle.
Print messages.
dat1 <- echodata::BST1
dat2 <- echoannot::xgr_example
GenomicRanges::mcols(dat2) <- NULL
gr.hits <- echoannot::granges_overlap(dat1 = dat1,
dat2 = dat2,
chrom_col.1 = "CHR",
start_col.1 = "POS")
#> Converting dat to GRanges object.
#> 778 query SNP(s) detected with reference overlap.