mergeMCols: Merge metadata columns of two GRanges

View source: R/utils.R

mergeMColsR Documentation

Merge metadata columns of two GRanges

Description

Merges mcols(gr2) into mcols(gr1). NA's are set for rows that occur in one GRanges but not the other. Once merged, the output GRanges will be sorted.

Usage

mergeMCols(gr1, gr2, append.gr1 = "_1", append.gr2 = "_2")

Arguments

gr1

GRanges to merge metadata into

gr2

GRanges with data to be merged

append.gr1

String to append to gr1 columns that share names with gr2 (default: "_1")

append.gr2

String to append to gr2 columns that share names with gr1 (default: "_2")

Value

GRanges

Examples


gr1 <- GRanges(seqnames = "chr2", ranges = IRanges(103, 106), strand = "+", score = 5L, GC = 0.45)
gr2 <- GRanges(
    seqnames = c("chr1", "chr2"),
    ranges = IRanges(c(107, 113), width = 3),
    strand = c("+", "-"),
    score = 3:4, GC = c(0.3, 0.5))
gr3 <- mergeMCols(gr1, gr2)


huishenlab/bisplotti documentation built on Sept. 20, 2023, 10:13 p.m.