addchr: Add 'chr' to GRanges seqnames

Description Usage Arguments Details Value Examples

Description

addchr takes a loops object or GRanges object and simply adds 'chr' to seqnames

Usage

1
2
3
4
5
6
7
addchr(dlo)

## S4 method for signature 'loops'
addchr(dlo)

## S4 method for signature 'GRanges'
addchr(dlo)

Arguments

dlo

A loops object or GRanges object

Details

Often times, performing functions on GRanges objects can go awry if the seqnames are systematically different. A common example of this is when some GRanges objects has the format of 'chr1' while the other has '1'. We can add 'chr' to the first object

Value

An identical loops object or GRanges object 'chr' added

Examples

1
2
3
4
5
6
library(GenomicRanges)
regA <- GRanges(c('1'),ranges=IRanges(c(36200000),c(36300000)))
addchr(regA)
regA
rmchr(regA)
regA

diffloop documentation built on Nov. 8, 2020, 5:48 p.m.