swapRanges: Swap ranges in a GRanges.

Description Usage Arguments Value See Also Examples

Description

Swap out the range of a GRanges-object with another IRanges-object stored inside the same object. I.e., swapping cluster widths with cluster peaks.

Usage

1
2
3
4
5
6
7
swapRanges(object, ...)

## S4 method for signature 'GenomicRanges'
swapRanges(object, inputColumn = "thick", outputColumn = NULL)

## S4 method for signature 'RangedSummarizedExperiment'
swapRanges(object, ...)

Arguments

object

GRanges or RangedSummarizedExperiment: Primary ranges to be swapped out.

...

additional arguments passed to methods.

inputColumn

character: Name of column holding IRanges to be swapped in.

outputColumn

character or NULL: Name of column to hold swapped out ranges, if NULL original ranges are not saved.

Value

GRanges with inputColumn swapped in as ranges.

See Also

Other Swapping functions: swapScores()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(exampleUnidirectional)
gr <- rowRanges(exampleUnidirectional)

# Swap in peaks as main ranges
peaks <- swapRanges(gr)
head(width(gr))
head(width(peaks))

# swapRanges() can also be directly called on a RangedSummarizedExperiment:
swapRanges(exampleUnidirectional)

# The original can optionally be saved in the output object
swapRanges(gr, outputColumn = 'swapped')

MalteThodberg/CAGEfightR documentation built on Sept. 11, 2021, 4:42 a.m.