swapRanges {CAGEfightR} | R Documentation |
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.
swapRanges(object, ...) ## S4 method for signature 'GenomicRanges' swapRanges(object, inputColumn = "thick", outputColumn = NULL) ## S4 method for signature 'RangedSummarizedExperiment' swapRanges(object, ...)
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. |
GRanges with inputColumn swapped in as ranges.
Other Swapping functions: swapScores
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')