Learn R Programming

diffloop (version 1.0.2)

rmchr: Remove 'chr' from GRanges seqnames

Description

rmchr takes a loops object or GRanges object and simply removes the 'chr' from seqnames, if is present

Usage

rmchr(dlo)

## S3 method for class 'loops': rmchr(dlo)

## S3 method for class 'GRanges': rmchr(dlo)

Arguments

dlo
A loops object or GRanges object

Value

  • An identical loops/GRanges object except 'chr' removed

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 remove 'chr' from the first object

Examples

Run this code
library(GenomicRanges)
regA <- GRanges(c('1'),IRanges(c(36200000),c(36300000)))
addchr(regA)
regA
rmchr(regA)
regA

Run the code above in your browser using DataLab